Re: [PATCH RFC 0/2] rcu: Add debugfs interface for pending callback monitoring

From: Breno Leitao

Date: Tue May 12 2026 - 03:49:36 EST


On Mon, May 11, 2026 at 06:08:53PM +0100, Gustavo Luiz Duarte wrote:
> > You actually don't need debugfs for this. You can just use bpftrace and
> > instrument trace_rcu_ (with other RCU tracing Kconfig options enabled?). I had
> > something like that working sometime ago.
>
> My initial attempt to do this using tracepoints was probing
> trace_rcu_segcb_stats, but this would add significant overhead to
> every callback enqueue/dequeue event which is too expensive for a
> production environment

An additional benefit of this debugfs-based approach is that it eliminates
the dependency on bpftrace and custom scripts. While instrumenting tracepoints
with bpftrace is certainly feasible for a limited number of servers, deploying
it fleet-wide becomes problematic. It requires distributing and maintaining
additional binaries on every host, just to collect metrics that a few lines
of kernel code can expose more efficiently.

So while bpftrace can technically accomplish this, it may not be the
most appropriate solution for this particular use case.