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-Url: https://git.stricted.de/?a=commitdiff_plain;h=3055addadbe9bfb2365006a1c13fd342a8d30d52;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [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 49cbf7cffebd..f181ff4dd32e 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();