Re: [PATCH] hrtimer: Reset hrtimer cpu base proper on CPU hotplug

From: Paul E. McKenney
Date: Tue Jan 30 2018 - 04:43:12 EST


On Mon, Jan 29, 2018 at 01:57:38AM -0800, Paul E. McKenney wrote:
> On Mon, Jan 29, 2018 at 09:20:48AM +0100, Sebastian Sewior wrote:
> > On 2018-01-26 14:09:17 [-0800], Paul E. McKenney wrote:
> > > find this one. ;-) But it did pass rcutorture testing for a great many
> > > years, didn't it? :-/
> >
> > It started to trigger better (or at all) on our test box with
> > modprobe kvm_intel preemption_timer=n
> >
> > on the host kernel so maybe a completely unrelated change helped to
> > trigger this.
>
> Good point!
>
> And testing continues, currently at 108 hours of TREE01 without any
> waylayed timers, so looking good! ;-)
>
> Just kicked off another 70 hours worth.

And those completed without incident for a total of 178 hours. I believe
we can call this one fixed. Thank you all!!!

One question... Is the patch shown below needed, or is this just yet
another case of me being confused? (The lack of it is not triggering,
but...)

Thanx, Paul

------------------------------------------------------------------------

commit accb0edb85526a05b934eac49658d05ea0216fc4
Author: Paul E. McKenney <paulmck@xxxxxxxxxxxxxxxxxx>
Date: Thu Dec 7 13:18:44 2017 -0800

timers: Ensure that timer_base ->clk accounts for time offline

The timer_base ->must_forward_clk is set to indicate that the next timer
operation on that timer_base must check for passage of time. One instance
of time passage is when the timer wheel goes idle, and another is when
the corresponding CPU is offline. Note that it is not appropriate to set
->is_idle because that could result in IPIing an offline CPU. Therefore,
this commit instead sets ->must_forward_clk at CPU-offline time.

Signed-off-by: Paul E. McKenney <paulmck@xxxxxxxxxxxxxxxxxx>

diff --git a/kernel/time/timer.c b/kernel/time/timer.c
index ffebcf878fba..94cce780c574 100644
--- a/kernel/time/timer.c
+++ b/kernel/time/timer.c
@@ -1875,6 +1875,7 @@ int timers_dead_cpu(unsigned int cpu)

BUG_ON(old_base->running_timer);

+ old_base->must_forward_clk = true;
for (i = 0; i < WHEEL_SIZE; i++)
migrate_timer_list(new_base, old_base->vectors + i);