[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20181119141003.6470-1-smuchun@gmail.com>
Date: Mon, 19 Nov 2018 22:10:03 +0800
From: Muchun Song <smuchun@...il.com>
To: john.stultz@...aro.org, tglx@...utronix.de, sboyd@...nel.org
Cc: linux-kernel@...r.kernel.org
Subject: [PATCH] timers: Make the lower-level timer function first call than higher-level
The elements of the heads array are a linked list of timer events that
expire at the current time. And it can contain up to LVL_DEPTH levels
and the lower the level represents the smaller the time granularity.
Now the result is that the function, which will be called when the timer
expires, in the higher-level is called first than the lower-level function.
I think it might be better to call the lower-level timer function first
than the higher-level function. Because the lower-level has the smaller
granularity and delay has less impact on higher-level. So fix it.
Signed-off-by: Muchun Song <smuchun@...il.com>
---
kernel/time/timer.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/kernel/time/timer.c b/kernel/time/timer.c
index fa49cd753dea..7c757b27aa58 100644
--- a/kernel/time/timer.c
+++ b/kernel/time/timer.c
@@ -1674,12 +1674,13 @@ static inline void __run_timers(struct timer_base *base)
base->must_forward_clk = false;
while (time_after_eq(jiffies, base->clk)) {
+ int i;
levels = collect_expired_timers(base, heads);
base->clk++;
- while (levels--)
- expire_timers(base, heads + levels);
+ for (i = 0; i < levels; i++)
+ expire_timers(base, heads + i);
}
base->running_timer = NULL;
raw_spin_unlock_irq(&base->lock);
--
2.17.1
Powered by blists - more mailing lists