]> www.infradead.org Git - users/jedix/linux-maple.git/commit
tracing: Just use this_cpu_read() to access ignore_pid
authorSteven Rostedt <rostedt@goodmis.org>
Mon, 5 May 2025 21:21:07 +0000 (17:21 -0400)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Thu, 8 May 2025 13:36:09 +0000 (09:36 -0400)
commit1577683a925f63862e81d27246a3a0bc1f6e39ad
tree340270575dcf5487de92ae7fbc4ed69c63d3768d
parentc638ebd8232e69daed2f2573365c48cd1e064a89
tracing: Just use this_cpu_read() to access ignore_pid

The ignore_pid boolean on the per CPU data descriptor is updated at
sched_switch when a new task is scheduled in. If the new task is to be
ignored, it is set to true, otherwise it is set to false. The current task
should always have the correct value as it is updated when the task is
scheduled in.

Instead of breaking up the read of this value, which requires preemption
to be disabled, just use this_cpu_read() which gives a snapshot of the
value. Since the value will always be correct for a given task (because
it's updated at sched switch) it doesn't need preemption disabled.

This will also allow trace events to be called with preemption enabled.

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>
Link: https://lore.kernel.org/20250505212235.038958766@goodmis.org
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
kernel/trace/trace_events.c