Skip to content

Commit 1671827

Browse files
committed
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>
1 parent 84c2344 commit 1671827

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

include/trace/perf.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ perf_trace_##call(void *__data, proto) \
7171
u64 __count __attribute__((unused)); \
7272
struct task_struct *__task __attribute__((unused)); \
7373
\
74+
guard(preempt_notrace)(); \
7475
do_perf_trace_##call(__data, args); \
7576
}
7677

@@ -85,9 +86,8 @@ perf_trace_##call(void *__data, proto) \
8586
struct task_struct *__task __attribute__((unused)); \
8687
\
8788
might_fault(); \
88-
preempt_disable_notrace(); \
89+
guard(preempt_notrace)(); \
8990
do_perf_trace_##call(__data, args); \
90-
preempt_enable_notrace(); \
9191
}
9292

9393
/*

0 commit comments

Comments
 (0)