This is a follow-up on
https://lore.kernel.org/all/20241206120709.736f943e@gandalf.local.home/T/#u (local)
The problem is that trace points disable preemption due to sched-RCU.
The arguments passed to tracepoints may used locks (yes, they should
not) and eBPF programs can be attached to tracepoints which may use
locks which become sleeping locks on PREEMPT_RT.
Mathieu said regarding the need for preempt_notrace:
| There are a few things to consider here about the constraints of the
| callsites where the tracepoints are inserted. In general, those need to
| be:
|
| - NMI-safe
| - notrace
| - usable from the scheduler (with rq lock held)
| - usable to trace the RCU implementation
This is covered by the here suggested rcu_read_lock_notrace().
Mathieu's suggested steps were:
| Well the first step would be to introduce a rcu_read_lock/unlock_notrace.
Patch #1
| This solves the problem at the tracepoint level, but requires that we
| initially move the preempt disable to the tracer callbacks. Then we
| can figure out within each tracer what needs to be done to further
| reduce the preempt off critical section.
Here I am stuck. Patch #2 is probably not correct due to "move the
preempt disable to the tracer callbacks". I didn't figure out where they
are…
Sebastian Andrzej Siewior (2):
rcu: Add rcu_read_lock_notrace()
trace: Use rcu_read_lock() instead preempt_disable()
include/linux/rcupdate.h | 41 +++++++++++++++++++++++++++++++++++++
include/linux/tracepoint.h | 2 +-
kernel/rcu/tree_plugin.h | 14 +++++++++++++
kernel/trace/trace_events.c | 8 +-------
4 files changed, 57 insertions(+), 8 deletions(-)
--
2.49.0