Commit 09d8091c authored by Steven Rostedt (Red Hat)'s avatar Steven Rostedt (Red Hat) Committed by Steven Rostedt
Browse files

tracing: Remove locking trace_types_lock from tracing_reset_all_online_cpus()

Commit a8227415 "tracing: Protect ftrace_trace_arrays list in trace_events.c"
added taking the trace_types_lock mutex in trace_events.c as there were
several locations that needed it for protection. Unfortunately, it also
encapsulated a call to tracing_reset_all_online_cpus() which also takes
the trace_types_lock, causing a deadlock.

This happens when a module has tracepoints and has been traced. When the
module is removed, the trace events module notifier will grab the
trace_types_lock, do a bunch of clean ups, and also clears the buffer
by calling tracing_reset_all_online_cpus. This doesn't happen often
which explains why it wasn't caught right away.

Commit a8227415 was marked for stable, which means this must be
sent to stable too.


Reported-by: default avatarArend van Spril <>
Tested-by: default avatarArend van Spriel <>
Cc: Alexander Z Lam <>
Cc: Vaibhav Nagarnaik <>
Cc: David Sharp <>
Cc: # 3.10
Signed-off-by: default avatarSteven Rostedt <>
parent 195a8afc
......@@ -1224,18 +1224,17 @@ void tracing_reset_current(int cpu)
tracing_reset(&global_trace.trace_buffer, cpu);
/* Must have trace_types_lock held */
void tracing_reset_all_online_cpus(void)
struct trace_array *tr;
list_for_each_entry(tr, &ftrace_trace_arrays, list) {
#define SAVED_CMDLINES 128
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment