summaryrefslogtreecommitdiff
path: root/kernel/rcu/rcu_segcblist.h
diff options
context:
space:
mode:
authorFrederic Weisbecker <frederic@kernel.org>2021-10-11 17:51:30 +0300
committerPaul E. McKenney <paulmck@kernel.org>2021-12-08 03:24:44 +0300
commit118e0d4a1bc85d4ecea0427e440a72d21ffbfa6a (patch)
tree201c06531e250335ce5120a0331ed0c301f13a05 /kernel/rcu/rcu_segcblist.h
parent614ddad17f22a22e035e2ea37a04815f50362017 (diff)
downloadlinux-118e0d4a1bc85d4ecea0427e440a72d21ffbfa6a.tar.xz
rcu/nocb: Make local rcu_nocb_lock_irqsave() safe against concurrent deoffloading
rcu_nocb_lock_irqsave() can be preempted between the call to rcu_segcblist_is_offloaded() and the actual locking. This matters now that rcu_core() is preemptible on PREEMPT_RT and the (de-)offloading process can interrupt the softirq or the rcuc kthread. As a result we may locklessly call into code that requires nocb locking. In practice this is a problem while we accelerate callbacks on rcu_core(). Simply disabling interrupts before (instead of after) checking the NOCB offload state fixes the issue. Reported-and-tested-by: Valentin Schneider <valentin.schneider@arm.com> Tested-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Frederic Weisbecker <frederic@kernel.org> Cc: Valentin Schneider <valentin.schneider@arm.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Cc: Josh Triplett <josh@joshtriplett.org> Cc: Joel Fernandes <joel@joelfernandes.org> Cc: Boqun Feng <boqun.feng@gmail.com> Cc: Neeraj Upadhyay <neeraju@codeaurora.org> Cc: Uladzislau Rezki <urezki@gmail.com> Cc: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Diffstat (limited to 'kernel/rcu/rcu_segcblist.h')
0 files changed, 0 insertions, 0 deletions