Commit 12c48e8
tracing: Stop current tracer when resizing buffer
commit d78ab79 upstream.
When the ring buffer is being resized, it can cause side effects to the
running tracer. For instance, there's a race with irqsoff tracer that
swaps individual per cpu buffers between the main buffer and the snapshot
buffer. The resize operation modifies the main buffer and then the
snapshot buffer. If a swap happens in between those two operations it will
break the tracer.
Simply stop the running tracer before resizing the buffers and enable it
again when finished.
Link: https://lkml.kernel.org/r/20231205220010.748996423@goodmis.org
Cc: stable@vger.kernel.org
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>
Fixes: 3928a8a ("ftrace: make work with new ring buffer")
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent 1741e17 commit 12c48e8
1 file changed
+7
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6394 | 6394 | | |
6395 | 6395 | | |
6396 | 6396 | | |
| 6397 | + | |
| 6398 | + | |
| 6399 | + | |
6397 | 6400 | | |
6398 | 6401 | | |
6399 | | - | |
| 6402 | + | |
6400 | 6403 | | |
6401 | 6404 | | |
6402 | 6405 | | |
| |||
6424 | 6427 | | |
6425 | 6428 | | |
6426 | 6429 | | |
6427 | | - | |
| 6430 | + | |
6428 | 6431 | | |
6429 | 6432 | | |
6430 | 6433 | | |
| |||
6433 | 6436 | | |
6434 | 6437 | | |
6435 | 6438 | | |
6436 | | - | |
| 6439 | + | |
| 6440 | + | |
6437 | 6441 | | |
6438 | 6442 | | |
6439 | 6443 | | |
| |||
0 commit comments