Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

Peter Zijlstra
2017-07-12T18:10:21Z

On Tue, Jul 11, 2017 at 06:09:27PM +0200, Frederic Weisbecker wrote:

> So I'd rather put that on can_stop_idle_tick().

That function needs a fix.. That's not in fact an identity (although it
turns out it is for the 4 default HZ values).

diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
index c7a899c5ce64..91433bc4a723 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -882,7 +882,7 @@ static bool can_stop_idle_tick(int cpu, struct tick_sched *ts)
}

if (unlikely(ts->nohz_mode == NOHZ_MODE_INACTIVE)) {
- ts->sleep_length = NSEC_PER_SEC / HZ;
+ ts->sleep_length = TICK_NSEC;
return false;
}