dynticks: Fix one off jiffy update
Sigh. /me wanted to be too clever and needs to order more brown paperbags now.
The rework of the jiffy update code introduced a one off error, which led to a one off accounting error for last_jiffy_update. This made jiffies lag behind.
Noticed by Karsten Wiese (cpufreq_ondemand weirdness).
Signed-off-by Thomas Gleixner <[email protected]>
kernel/time/tick-sched.c +3 -3
@@ -43,7 +43,7 @@ struct tick_sched *tick_get_tick_sched(i*/ static void tick_do_update_jiffies64 (ktime_t now) { -unsigned long ticks =1 ; +unsigned long ticks =0 ;ktime_t delta;/* Reevalute with xtime_lock held */
@@ -60,12 +60,12 @@ static void tick_do_update_jiffies64(ktiif (unlikely (delta.tv64 >= tick_period.tv64)) {s64 incr =ktime_to_ns (tick_period); - ticks +=ktime_divns (delta, incr); + ticks =ktime_divns (delta, incr); last_jiffies_update =ktime_add_ns (last_jiffies_update, incr * ticks); } -do_timer (ticks); +do_timer (++ticks); }write_sequnlock (&xtime_lock); }
Quoted 8 lines · Thomas Gleixner
Sigh. /me wanted to be too clever and needs to order more brown paperbags now.
The rework of the jiffy update code introduced a one off error, which led to a one off accounting error for
last_jiffy_update. This made jiffies lag behind.Noticed by Karsten Wiese (
cpufreq_ondemandweirdness).
Karsten - thanks for tracking this regression down to the jiffies update code! I'm wondering, do you still the suspend slowness problem with this fix applied as well?
Ingo