[PATCH] hrtimer: call get_softirq_time() only when necessary in run_hrtimer_queue()
authorDimitri Sivanich <sivanich@sgi.com>
Fri, 31 Mar 2006 10:31:20 +0000 (02:31 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Fri, 31 Mar 2006 20:18:58 +0000 (12:18 -0800)
It seems that run_hrtimer_queue() is calling get_softirq_time() more
often than it needs to.

With this patch, it only calls get_softirq_time() if there's a
pending timer.

Signed-off-by: Dimitri Sivanich <sivanich@sgi.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
kernel/hrtimer.c

index 49cbf7cffebd1e75c8142b180c472f7f1f0a786c..f181ff4dd32ec18221955508d515c3b8da81c6a6 100644 (file)
@@ -606,6 +606,9 @@ static inline void run_hrtimer_queue(struct hrtimer_base *base)
 {
        struct rb_node *node;
 
+       if (!base->first)
+               return;
+
        if (base->get_softirq_time)
                base->softirq_time = base->get_softirq_time();