Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

tracing: perf: Have perf tracepoint callbacks always disable preemption

In preparation to convert protection of tracepoints from being protected
by a preempt disabled section to being protected by SRCU, have all the
perf callbacks disable preemption as perf expects preemption to be
disabled when processing tracepoints.

While at it, convert the perf system call callback preempt_disable() to a
guard(preempt).

Link: https://lore.kernel.org/all/20250613152218.1924093-1-bigeasy@linutronix.de/
Link: https://patch.msgid.link/20260108220550.2f6638f3@fedora

Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: "Paul E. McKenney" <paulmck@kernel.org>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20260126231256.174621257@kernel.org
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>

+2 -2
+2 -2
include/trace/perf.h
··· 71 71 u64 __count __attribute__((unused)); \ 72 72 struct task_struct *__task __attribute__((unused)); \ 73 73 \ 74 + guard(preempt_notrace)(); \ 74 75 do_perf_trace_##call(__data, args); \ 75 76 } 76 77 ··· 86 85 struct task_struct *__task __attribute__((unused)); \ 87 86 \ 88 87 might_fault(); \ 89 - preempt_disable_notrace(); \ 88 + guard(preempt_notrace)(); \ 90 89 do_perf_trace_##call(__data, args); \ 91 - preempt_enable_notrace(); \ 92 90 } 93 91 94 92 /*