summaryrefslogtreecommitdiffstats
path: root/include/linux/rcutree.h
diff options
context:
space:
mode:
authorPaul E. McKenney2018-06-28 21:45:23 +0200
committerPaul E. McKenney2018-08-31 01:02:36 +0200
commite11ec65cc8d63c41fc468363b65826a5ae4b8c66 (patch)
treecf8fc0b086e673a109889d308e906722d5d22c77 /include/linux/rcutree.h
parentrcu: Remove now-unused ->b.exp_need_qs field from the rcu_special union (diff)
downloadkernel-qcow2-linux-e11ec65cc8d63c41fc468363b65826a5ae4b8c66.tar.gz
kernel-qcow2-linux-e11ec65cc8d63c41fc468363b65826a5ae4b8c66.tar.xz
kernel-qcow2-linux-e11ec65cc8d63c41fc468363b65826a5ae4b8c66.zip
rcu: Add warning to detect half-interrupts
RCU's dyntick-idle code is written to tolerate half-interrupts, that it, either an interrupt that invokes rcu_irq_enter() but never invokes the corresponding rcu_irq_exit() on the one hand, or an interrupt that never invokes rcu_irq_enter() but does invoke the "corresponding" rcu_irq_exit() on the other. These things really did happen at one time, as evidenced by this ca-2011 LKML post: http://lkml.kernel.org/r/20111014170019.GE2428@linux.vnet.ibm.com The reason why RCU tolerates half-interrupts is that usermode helpers used exceptions to invoke a system call from within the kernel such that the system call did a normal return (not a return from exception) to the calling context. This caused rcu_irq_enter() to be invoked without a matching rcu_irq_exit(). However, usermode helpers have since been rewritten to make much more housebroken use of workqueues, kernel threads, and do_execve(), and therefore should no longer produce half-interrupts. No one knows of any other source of half-interrupts, but then again, no one seems insane enough to go audit the entire kernel to verify that half-interrupts really are a relic of the past. This commit therefore adds a pair of WARN_ON_ONCE() calls that will trigger in the presence of half interrupts, which the code will continue to handle correctly. If neither of these WARN_ON_ONCE() trigger by mid-2021, then perhaps RCU can stop handling half-interrupts, which would be a considerable simplification. Reported-by: Steven Rostedt <rostedt@goodmis.org> Reported-by: Joel Fernandes <joel@joelfernandes.org> Reported-by: Andy Lutomirski <luto@kernel.org> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Reviewed-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Diffstat (limited to 'include/linux/rcutree.h')
0 files changed, 0 insertions, 0 deletions