linux-stable/kernel/rcu
Joel Fernandes (Google) 516e5ae0c9 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 671a63517c ("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>
2019-10-28 07:02:21 -07:00
..
Kconfig rcu: Use CONFIG_PREEMPTION 2019-07-31 19:03:35 +02:00
Kconfig.debug rcu: Add support for consolidated-RCU reader checking 2019-08-09 11:00:35 -07:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
rcu.h rcu: Add kernel parameter to dump trace after RCU CPU stall warning 2019-08-01 14:05:51 -07:00
rcu_segcblist.c rcu/nocb: Add bypass callback queueing 2019-08-13 14:37:32 -07:00
rcu_segcblist.h rcu/nocb: Add bypass callback queueing 2019-08-13 14:37:32 -07:00
rcuperf.c rcuperf: Make rcuperf kernel test more robust for !expedited mode 2019-08-01 14:30:22 -07:00
rcutorture.c rcutorture: Emulate dyntick aspect of userspace nohz_full sojourn 2019-10-05 10:46:05 -07:00
srcutiny.c srcu: Remove cleanup_srcu_struct_quiesced() 2019-03-26 14:39:24 -07:00
srcutree.c srcu: Avoid srcutorture security-based pointer obfuscation 2019-08-01 14:05:51 -07:00
sync.c rcu/sync: Simplify the state machine 2019-05-28 09:05:23 -07:00
tiny.c rcu: rcu_qs -- Use raise_softirq_irqoff to not save irqs twice 2019-03-26 14:37:49 -07:00
tree.c rcu: Reset CPU hints when reporting a quiescent state 2019-10-28 07:02:21 -07:00
tree.h rcu: Force tick on for nohz_full CPUs not reaching quiescent states 2019-10-28 07:02:21 -07:00
tree_exp.h rcu: Fix spelling mistake "greate"->"great" 2019-08-12 11:25:06 -07:00
tree_plugin.h rcu/nocb: Don't wake no-CBs GP kthread if timer posted under overload 2019-08-13 14:38:24 -07:00
tree_stall.h Merge branch 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2019-09-16 17:25:49 -07:00
update.c Merge branches 'consolidate.2019.08.01b', 'fixes.2019.08.12a', 'lists.2019.08.13a' and 'torture.2019.08.01b' into HEAD 2019-08-13 14:30:30 -07:00