linux_old1/kernel/rcu
Paul E. McKenney 28585a8326 rcu: Allow for page faults in NMI handlers
A number of architecture invoke rcu_irq_enter() on exception entry in
order to allow RCU read-side critical sections in the exception handler
when the exception is from an idle or nohz_full CPU.  This works, at
least unless the exception happens in an NMI handler.  In that case,
rcu_nmi_enter() would already have exited the extended quiescent state,
which would mean that rcu_irq_enter() would (incorrectly) cause RCU
to think that it is again in an extended quiescent state.  This will
in turn result in lockdep splats in response to later RCU read-side
critical sections.

This commit therefore causes rcu_irq_enter() and rcu_irq_exit() to
take no action if there is an rcu_nmi_enter() in effect, thus avoiding
the unscheduled return to RCU quiescent state.  This in turn should
make the kernel safe for on-demand RCU voyeurism.

Link: http://lkml.kernel.org/r/20170922211022.GA18084@linux.vnet.ibm.com

Cc: stable@vger.kernel.org
Fixes: 0be964be0 ("module: Sanitize RCU usage and locking")
Reported-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2017-09-23 16:49:42 -04: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: Allow for page faults in NMI handlers 2017-09-23 16:49:42 -04: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