Re: [ANNOUNCE] high-res-timers patches for 2.6.6

From: Stephen Hemminger
Date: Mon Jun 21 2004 - 18:14:18 EST


A couple of comments on posix-hrt-core-04.06.09.patch

1. Comment in hrtime.h is out of date, you are using seq_lock to do the read
stuff now, an example is...

+ * Global locking issues:
+ *
+ * Time is locked with the xtime_lock using read/write locks.
+ * Note: It is assumed that the do_timer() call is protected by
+ * write_lock(&xtime_lock).
+ *
+ * Using code must not change, but only read, the protected
+ * variables (xtime, jiffies, any temps tha need protection in the
+ * arch_get_cycles() code). Usage is as follows:
+ *
+ * read_lock_irq(&xtime_lock);
+ * do the reads
+ * read_unlock_irq(&xtime)


2. Don't like new definition of running_timer; use explicit memory barriers
not volatile please.

struct tvec_t_base_s {
spinlock_t lock;
unsigned long timer_jiffies;
- struct timer_list *running_timer;
- tvec_root_t tv1;
- tvec_t tv2;
- tvec_t tv3;
- tvec_t tv4;
- tvec_t tv5;
+ volatile struct timer_list * volatile running_timer;
+ struct list_head tv[NEW_TVEC_SIZE]line_aligned_in_smp;

3. The IF_HIGH_RES() macro looks cute, but get confusing, and makes the code
less readable.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/