Re: Can rcu_tasks_trace be used for *all* tracepoints?

From: Steven Rostedt

Date: Tue Dec 01 2026 - 15:07:45 EST


On Tue, 1 Dec 2026 11:54:08 -0800
"Paul E. McKenney" <paulmck@xxxxxxxxxx> wrote:

> In recent kernels, rcu_read_lock_trace() is a thin wrapper around SRCU,
> specifically, __srcu_read_lock_fast(), so it is clearly possible. ;-)

That's what I noticed. What's the difference from using
rcu_read_lock_trace() and the current tracepoint:

guard(srcu_fast_notrace)(&tracepoint_srcu);

?

>
> One potential drawback is delays from other rcu_read_lock_trace() callers,
> but they are supposed to limit themselves to page-fault-duration sleeps,

Which is basically what traecpoints do now. As to free a tracepoint, you
need to wait for:

extern struct srcu_struct tracepoint_srcu;
static inline void tracepoint_synchronize_unregister(void)
{
synchronize_rcu_tasks_trace();
synchronize_srcu(&tracepoint_srcu);
}

Thus tracepoints *already* have to wait for rcu_tasks_trace(). As we didn't
want to complicate the code and differentiate generic code that uses both
syscall tracepoints and regular tracepoints, it assumes that it could be
either, and it waits for both. It does so serially too, so this change
could actually speed up the wait times.

> so perhaps that is not a problem. The drawback in the opposite direction
> (tracepoints using rcu_read_lock_trace() and friends) is reader delays
> in tracepoints affecting other callers, but your readers should be quite
> fast, correct?

The current users of rcu_read_lock_trace() are the slow system call
tracepoints. The other ones are even safe for preempt_disable(), so it will
not slow things down at all.

-- Steve