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

From: Paul E. McKenney

Date: Tue Dec 01 2026 - 14:54:11 EST


On Tue, Dec 01, 2026 at 09:56:51AM -0500, Steven Rostedt wrote:
> Paul,
>
> We currently use two different RCU flavors to synchronize tracepoints. One
> for normal tracepoints and one for "system call" tracepoints (AKA,
> tracepoints that can 'fault').
>
> When we added the system call tracepoints, normal tracpoints used
> preempt_disable to synchronize them, but we needed the system call
> tracepoints to be able to fault to read user space and could not use
> preempt_disable().
>
> For system call tracepoints we used rcu_read_lock_trace() and
> synchronize_rcu_tasks_trace() for synchronization. But to handle all
> tracepoints (normal and system call ones), when unregistering a tracepoint,
> we had to call both synchronize_rcu() and synchronize_rcu_task_trace().
>
> Shortly after, we updated normal tracepoints to use SRCU fast. Today normal
> tracepoints synchronize after waiting for the tracepoint_src grace periods
> to end.
>
> My question is, what is preventing us from using rcu_read_lock_trace() for
> all tracepoints and remove the SRCU tracepoint_srcu implementation?
>
> This would simplify things tremendously if we can do that.

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

One potential drawback is delays from other rcu_read_lock_trace() callers,
but they are supposed to limit themselves to page-fault-duration sleeps,
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?

Thanx, Paul