]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
srcu: Use raw spinlocks so call_srcu() can be used under preempt_disable()
authorPaul E. McKenney <paulmck@kernel.org>
Sat, 14 Mar 2026 11:12:58 +0000 (04:12 -0700)
committerBoqun Feng <boqun@kernel.org>
Wed, 25 Mar 2026 15:55:50 +0000 (08:55 -0700)
commit175b45ed343a9c547b5f45293d3ea08d38a7b6f4
tree400b6a34e075d0d37990dc418db76a9f83fd64be
parentf338e77383789c0cae23ca3d48adcc5e9e137e3c
srcu: Use raw spinlocks so call_srcu() can be used under preempt_disable()

Tree SRCU has used non-raw spinlocks for many years, motivated by a desire
to avoid unnecessary real-time latency and the absence of any reason to
use raw spinlocks.  However, the recent use of SRCU in tracing as the
underlying implementation of RCU Tasks Trace means that call_srcu()
is invoked from preemption-disabled regions of code, which in turn
requires that any locks acquired by call_srcu() or its callees must be
raw spinlocks.

This commit therefore converts SRCU's spinlocks to raw spinlocks.

[boqun: Add Fixes tag]

Reported-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Fixes: c27cea4416a3 ("rcu: Re-implement RCU Tasks Trace in terms of SRCU-fast")
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Boqun Feng <boqun@kernel.org>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
include/linux/srcutree.h
kernel/rcu/rcu.h
kernel/rcu/srcutree.c