Re: [PATCH RFC tip/core/rcu 4/4] rcu: Ensure that RCU_FAST_NO_HZ timers expire on correct CPU

Paul E. McKenney
2012-04-26T15:55:34Z

On Thu, Apr 26, 2012 at 03:04:56PM +0200, Peter Zijlstra wrote:
> On Mon, 2012-04-23 at 09:16 -0700, Paul E. McKenney wrote:
> > - mod_timer(&per_cpu(rcu_idle_gp_timer, cpu),
> > - per_cpu(rcu_idle_gp_timer_expires, cpu));
> > + tp = &per_cpu(rcu_idle_gp_timer, cpu);
> > + tp->expires = per_cpu(rcu_idle_gp_timer_expires, cpu);
> > + add_timer_on(tp, cpu);
>
> The simpler change looks to use mod_timer_pinned()

Good point!

Except... Now that you mention it, I don't see how mod_timer_pinned()
actually helps. It looks to me like a CPU-hotplug operation will
migrate the timers anyway.

This is actually (in theory) harmless in the RCU_FAST_NO_HZ case, because
the CPU_DYING stuff will force a wakeup of the CPU in question, which
will cancel the timer. But still, mod_timer_pinned() has a rather
misleading name. ;-)

But a line is a line, so I made this change.

Thanx, Paul