From: Dimitri Sivanich Date: Fri, 31 Mar 2006 10:31:20 +0000 (-0800) Subject: [PATCH] hrtimer: call get_softirq_time() only when necessary in run_hrtimer_queue() X-Git-Tag: v2.6.17-rc1~60 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3055addadbe9bfb2365006a1c13fd342a8d30d52;p=linux-2.6 [PATCH] hrtimer: call get_softirq_time() only when necessary in run_hrtimer_queue() 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 Signed-off-by: Thomas Gleixner Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c index 49cbf7cffe..f181ff4dd3 100644 --- a/kernel/hrtimer.c +++ b/kernel/hrtimer.c @@ -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();