]> asedeno.scripts.mit.edu Git - linux.git/commit
rcu: Reset CPU hints when reporting a quiescent state
authorJoel Fernandes (Google) <joel@joelfernandes.org>
Thu, 5 Sep 2019 17:26:41 +0000 (10:26 -0700)
committerPaul E. McKenney <paulmck@kernel.org>
Mon, 28 Oct 2019 14:02:21 +0000 (07:02 -0700)
commit516e5ae0c94016294d3ef175454215b235d03945
treef94a8808e6f86e0287eddf5a1ae77a1bee3a0d6b
parentb200a0489517d9e5a52e983183e890f573454ebd
rcu: Reset CPU hints when reporting a quiescent state

In some cases, tracing shows that need_heavy_qs is still set even though
urgent_qs was cleared upon reporting of a quiescent state.  One such
case is when the softirq reports that a CPU has passed quiescent state.

Commit 671a63517cf9 ("rcu: Avoid unnecessary softirq when system is
idle") fixed a bug where core_needs_qs was not being cleared.  In order
to avoid running into similar situations with the urgent-grace-period
flags, this commit causes rcu_disable_urgency_upon_qs(), previously
rcu_disable_tick_upon_qs(), to clear the urgency hints, ->rcu_urgent_qs
and ->rcu_need_heavy_qs.  Note that it is possible for CPUs to go
offline with these urgency hints still set.  This is handled because
rcu_disable_urgency_upon_qs() is also invoked during the online process.

Because these hints can be cleared both by the corresponding CPU and by
the grace-period kthread, this commit also adds a number of READ_ONCE()
and WRITE_ONCE() calls.

Tested overnight with rcutorture running for 60 minutes on all
configurations of RCU.

Signed-off-by: "Joel Fernandes (Google)" <joel@joelfernandes.org>
[ paulmck: Clear urgency flags in rcu_disable_urgency_upon_qs(). ]
[ paulmck: Remove ->core_needs_qs from the set cleared at quiescent state. ]
[ paulmck: Make rcu_disable_urgency_upon_qs static per kbuild test robot. ]
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
kernel/rcu/tree.c