1
0
Fork 0
remarkable-linux/kernel/rcu
Paul E. McKenney 97535791d8 rcu: Allow for page faults in NMI handlers
commit 28585a8326 upstream.

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

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-10-18 09:35:38 +02:00
..
Makefile rcutorture: Add RCU grace-period performance tests 2016-03-31 13:37:38 -07:00
rcu.h rcu: Narrow early boot window of illegal synchronous grace periods 2017-01-26 08:24:37 +01:00
rcuperf.c rcuperf: Consistently insert space between flag and message 2016-08-22 10:06:16 -07:00
rcutorture.c Merge branches 'doc.2016.08.22c', 'exp.2016.08.22c', 'fixes.2016.09.14a', 'hotplug.2016.08.22c' and 'torture.2016.08.22c' into HEAD 2016-09-14 12:58:49 -07:00
srcu.c rcu: Add rcu_normal kernel parameter to suppress expediting 2015-12-04 12:26:53 -08: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 cond_resched() from Tiny synchronize_sched() 2017-01-26 08:24:37 +01:00
tiny_plugin.h rcu: Narrow early boot window of illegal synchronous grace periods 2017-01-26 08:24:37 +01:00
tree.c rcu: Allow for page faults in NMI handlers 2017-10-18 09:35:38 +02:00
tree.h rcu: Drive expedited grace periods from workqueue 2016-08-22 09:30:25 -07:00
tree_exp.h rcu: Narrow early boot window of illegal synchronous grace periods 2017-01-26 08:24:37 +01:00
tree_plugin.h rcu: Add memory barriers for NOCB leader wakeup 2017-07-21 07:42:22 +02:00
tree_trace.c rcu: Drive expedited grace periods from workqueue 2016-08-22 09:30:25 -07:00
update.c rcu: Narrow early boot window of illegal synchronous grace periods 2017-01-26 08:24:37 +01:00