]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
srcu: Require special srcu_struct define/init for SRCU-fast readers
authorPaul E. McKenney <paulmck@kernel.org>
Wed, 5 Nov 2025 20:32:07 +0000 (12:32 -0800)
committerFrederic Weisbecker <frederic@kernel.org>
Wed, 5 Nov 2025 22:58:26 +0000 (23:58 +0100)
commit8235bcfd39e865763e764b4c968012bdfb808af1
treed5cc386a73733b193787880d1225885fe2996ab2
parente4ed20c1603c9e2846de31034cb4d50b3ef59ec8
srcu: Require special srcu_struct define/init for SRCU-fast readers

This commit adds CONFIG_PROVE_RCU=y checking to enforce the new rule that
srcu_struct structures passed to srcu_read_lock_fast() and other SRCU-fast
read-side markers be either initialized with init_srcu_struct_fast()
on the one hand or defined using either DEFINE_SRCU_FAST() or
DEFINE_STATIC_SRCU_FAST().  This will enable removal of the non-debug
read-side checks from srcu_read_lock_fast() and friends, which on my
laptop provides a 25% speedup (which admittedly amounts to about half
a nanosecond, but when tracing fastpaths...)

Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: <bpf@vger.kernel.org>
Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
include/linux/srcu.h
kernel/rcu/srcutree.c