]> Gentwo Git Trees - linux/.git/commit
tracing: Add bulk garbage collection of freeing event_trigger_data
authorSteven Rostedt <rostedt@goodmis.org>
Tue, 25 Nov 2025 21:40:06 +0000 (16:40 -0500)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Wed, 26 Nov 2025 20:13:30 +0000 (15:13 -0500)
commit61d445af0a7c70018111919e47beaaee15653f2f
tree6d8d26e1b05ef61c8d2dc57c2e0e1b979709c252
parent78c7051394945bb2a26993f289e935c922070872
tracing: Add bulk garbage collection of freeing event_trigger_data

The event trigger data requires a full tracepoint_synchronize_unregister()
call before freeing. That call can take 100s of milliseconds to complete.
In order to allow for bulk freeing of the trigger data, it can not call
the tracepoint_synchronize_unregister() for every individual trigger data
being free.

Create a kthread that gets created the first time a trigger data is freed,
and have it use the lockless llist to get the list of data to free, run
the tracepoint_synchronize_unregister() then free everything in the list.

By freeing hundreds of event_trigger_data elements together, it only
requires two runs of the synchronization function, and not hundreds of
runs. This speeds up the operation by orders of magnitude (milliseconds
instead of several seconds).

Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Tom Zanussi <zanussi@kernel.org>
Link: https://patch.msgid.link/20251125214032.151674992@kernel.org
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
kernel/trace/trace.h
kernel/trace/trace_events_trigger.c