linux/kernel/rcu
Paul E. McKenney a58163d8ca rcu: Migrate callbacks earlier in the CPU-offline timeline
RCU callbacks must be migrated away from an outgoing CPU, and this is
done near the end of the CPU-hotplug operation, after the outgoing CPU is
long gone.  Unfortunately, this means that other CPU-hotplug callbacks
can execute while the outgoing CPU's callbacks are still immobilized
on the long-gone CPU's callback lists.  If any of these CPU-hotplug
callbacks must wait, either directly or indirectly, for the invocation
of any of the immobilized RCU callbacks, the system will hang.

This commit avoids such hangs by migrating the callbacks away from the
outgoing CPU immediately upon its departure, shortly after the return
from __cpu_die() in takedown_cpu().  Thus, RCU is able to advance these
callbacks and invoke them, which allows all the after-the-fact CPU-hotplug
callbacks to wait on these RCU callbacks without risk of a hang.

While in the neighborhood, this commit also moves rcu_send_cbs_to_orphanage()
and rcu_adopt_orphan_cbs() under a pre-existing #ifdef to avoid including
dead code on the one hand and to avoid define-without-use warnings on the
other hand.

Reported-by: Jeffrey Hugo <jhugo@codeaurora.org>
Link: http://lkml.kernel.org/r/db9c91f6-1b17-6136-84f0-03c3c2581ab4@codeaurora.org
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Anna-Maria Gleixner <anna-maria@linutronix.de>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: Richard Weinberger <richard@nod.at>
2017-07-25 13:03:43 -07:00
..
Kconfig rcu: Remove RCU CPU stall warnings from Tiny RCU 2017-06-08 18:52:45 -07:00
Kconfig.debug rcu: Move RCU debug Kconfig options to kernel/rcu 2017-06-08 18:52:44 -07:00
Makefile rcu: Remove debugfs tracing 2017-06-08 18:52:43 -07:00
rcu.h rcu: Eliminate NOCBs CPU-state Kconfig options 2017-06-08 18:52:43 -07:00
rcu_segcblist.c rcu: Separately compile large rcu_segcblist functions 2017-05-02 07:21:02 -07:00
rcu_segcblist.h rcu: Open-code the rcu_cblist_n_lazy_cbs() function 2017-05-02 09:22:48 -07:00
rcuperf.c rcu: Move expediting-related access/control out of rcupdate.h 2017-06-08 18:52:28 -07:00
rcutorture.c srcu: Remove Classic SRCU 2017-06-08 18:52:42 -07:00
srcutiny.c srcu: Apply trivial callback lists to shrink Tiny SRCU 2017-06-08 18:52:35 -07:00
srcutree.c srcu: Use rnp->lock wrappers to replace explicit memory barriers 2017-06-08 18:52:38 -07:00
sync.c locking, rcu, cgroup: Avoid synchronize_sched() in __cgroup_procs_write() 2016-08-18 15:36:59 +02:00
tiny.c rcu: Remove RCU CPU stall warnings from Tiny RCU 2017-06-08 18:52:45 -07:00
tiny_plugin.h rcu: Remove RCU CPU stall warnings from Tiny RCU 2017-06-08 18:52:45 -07:00
tree.c rcu: Migrate callbacks earlier in the CPU-offline timeline 2017-07-25 13:03:43 -07:00
tree.h rcu: Remove debugfs tracing 2017-06-08 18:52:43 -07:00
tree_exp.h rcu: Make sync_rcu_preempt_exp_done() return bool 2017-06-08 08:25:27 -07:00
tree_plugin.h rcu: Eliminate NOCBs CPU-state Kconfig options 2017-06-08 18:52:43 -07:00
update.c rcu: Move rcu_expedited and rcu_normal externs from rcupdate.h 2017-06-08 18:52:27 -07:00