]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
rcu: Re-implement RCU Tasks Trace in terms of SRCU-fast
authorPaul E. McKenney <paulmck@kernel.org>
Mon, 29 Dec 2025 19:10:56 +0000 (11:10 -0800)
committerBoqun Feng <boqun.feng@gmail.com>
Thu, 1 Jan 2026 08:39:46 +0000 (16:39 +0800)
commitc27cea4416a396a1c5b6b3529dd925f92a69e7d3
tree2864d98e7d673f19cda8dc6a5611b77ff4bd05fb
parent8f0b4cce4481fb22653697cced8d0d04027cb1e8
rcu: Re-implement RCU Tasks Trace in terms of SRCU-fast

This commit saves more than 500 lines of RCU code by re-implementing
RCU Tasks Trace in terms of SRCU-fast.  Follow-up work will remove
more code that does not cause problems by its presence, but that is no
longer required.

This variant places smp_mb() in rcu_read_{,un}lock_trace(), and in the
same place that srcu_read_{,un}lock() would put them. These smp_mb()
calls will be removed on common-case architectures in a later commit.
In the meantime, it serves to enforce ordering between the underlying
srcu_read_{,un}lock_fast() markers and the intervening critical section,
even on architectures that permit attaching tracepoints on regions of
code not watched by RCU.  Such architectures defeat SRCU-fast's use of
implicit single-instruction, interrupts-disabled, and atomic-operation
RCU read-side critical sections, which have no effect when RCU is not
watching.  The aforementioned later commit will insert these smp_mb()
calls only on architectures that have not used noinstr to prevent
attaching tracepoints to code where RCU is not watching.

[ paulmck: Apply kernel test robot, Boqun Feng, and Zqiang feedback. ]
[ paulmck: Split out Tiny SRCU fixes per Andrii Nakryiko feedback. ]

Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Tested-by: kernel test robot <oliver.sang@intel.com>
Cc: Andrii Nakryiko <andrii@kernel.org>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: bpf@vger.kernel.org
Reviewed-by: Joel Fernandes <joelagnelf@nvidia.com>
Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
include/linux/rcupdate_trace.h
include/linux/sched.h
kernel/rcu/tasks.h