Re: [PATCH] Call get_time() only when necessary in run_hrtimer_queue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dimitri Sivanich a écrit :

The hrtimer work in -mm does improve on the situation, although there
appears to be some occasional cache line contention for xtime.  The
following patch (which is similiar to my previously submitted patch)
is applicable to 2.6.16-mm1 and does take care of at least a good
portion of that.

I am not sure your patch is correct.


Index: linux/kernel/hrtimer.c
===================================================================
--- linux.orig/kernel/hrtimer.c	2006-03-27 09:43:40.000000000 -0600
+++ linux/kernel/hrtimer.c	2006-03-27 12:35:47.416054373 -0600
@@ -604,14 +604,17 @@ int hrtimer_get_res(const clockid_t whic
  */
 static inline void run_hrtimer_queue(struct hrtimer_base *base)
 {
-	struct rb_node *node;
+	struct rb_node *node = base->first;
+
+	if (!node)
+		return;
if (base->get_softirq_time)
 		base->softirq_time = base->get_softirq_time();
spin_lock_irq(&base->lock); - while ((node = base->first)) {
+	while (node) {

Are you sure of this change ?

base->first may have changed just before you locked the base->lock (spin_lock_irq(&base->lock);)

Eric

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux