Skip to content

Commit 580bb35

Browse files
committed
Revert: "ring-buffer: Do not have boot mapped buffers hook to CPU hotplug"
A crash happened when testing cpu hotplug with respect to the memory mapped ring buffers. It was assumed that the hot plug code was adding a per CPU buffer that was already created that caused the crash. The real problem was due to ref counting and was fixed by commit 2cf9733 ("ring-buffer: Fix refcount setting of boot mapped buffers"). When a per CPU buffer is created, it will not be created again even with CPU hotplug, so the fix to not use CPU hotplug was a red herring. In fact, it caused only the boot CPU buffer to be created, leaving the other CPU per CPU buffers disabled. Revert that change as it was not the culprit of the fix it was intended to be. Cc: Masami Hiramatsu <[email protected]> Cc: Mathieu Desnoyers <[email protected]> Link: https://lore.kernel.org/[email protected] Fixes: 912da2c ("ring-buffer: Do not have boot mapped buffers hook to CPU hotplug") Signed-off-by: Steven Rostedt (Google) <[email protected]>
1 parent 09661f7 commit 580bb35

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

kernel/trace/ring_buffer.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2337,12 +2337,9 @@ static struct trace_buffer *alloc_buffer(unsigned long size, unsigned flags,
23372337
if (!buffer->buffers[cpu])
23382338
goto fail_free_buffers;
23392339

2340-
/* If already mapped, do not hook to CPU hotplug */
2341-
if (!start) {
2342-
ret = cpuhp_state_add_instance(CPUHP_TRACE_RB_PREPARE, &buffer->node);
2343-
if (ret < 0)
2344-
goto fail_free_buffers;
2345-
}
2340+
ret = cpuhp_state_add_instance(CPUHP_TRACE_RB_PREPARE, &buffer->node);
2341+
if (ret < 0)
2342+
goto fail_free_buffers;
23462343

23472344
mutex_init(&buffer->mutex);
23482345

0 commit comments

Comments
 (0)