aboutsummaryrefslogtreecommitdiff
path: root/kernel/trace/trace_osnoise.c
diff options
context:
space:
mode:
authorGravatar Steven Rostedt <rostedt@goodmis.org> 2022-12-09 10:11:51 -0500
committerGravatar Steven Rostedt (Google) <rostedt@goodmis.org> 2022-12-10 13:36:04 -0500
commit88ca6a71dcab4a4ba6e6e2ff66415a5c4f86e874 (patch)
tree9c2139208943fde4586355fc8cd313a70691d606 /kernel/trace/trace_osnoise.c
parenttracing/hist: Fix issue of losting command info in error_log (diff)
downloadlinux-88ca6a71dcab4a4ba6e6e2ff66415a5c4f86e874.tar.gz
linux-88ca6a71dcab4a4ba6e6e2ff66415a5c4f86e874.tar.bz2
linux-88ca6a71dcab4a4ba6e6e2ff66415a5c4f86e874.zip
ring-buffer: Handle resize in early boot up
With the new command line option that allows trace event triggers to be added at boot, the "snapshot" trigger will allocate the snapshot buffer very early, when interrupts can not be enabled. Allocating the ring buffer is not the problem, but it also resizes it, which is, as the resize code does synchronization that can not be preformed at early boot. To handle this, first change the raw_spin_lock_irq() in rb_insert_pages() to raw_spin_lock_irqsave(), such that the unlocking of that spin lock will not enable interrupts. Next, where it calls schedule_work_on(), disable migration and check if the CPU to update is the current CPU, and if so, perform the work directly, otherwise re-enable migration and call the schedule_work_on() to the CPU that is being updated. The rb_insert_pages() just needs to be run on the CPU that it is updating, and does not need preemption nor interrupts disabled when calling it. Link: https://lore.kernel.org/lkml/Y5J%2FCajlNh1gexvo@google.com/ Link: https://lore.kernel.org/linux-trace-kernel/20221209101151.1fec1167@gandalf.local.home Cc: Masami Hiramatsu <mhiramat@kernel.org> Cc: Andrew Morton <akpm@linux-foundation.org> Fixes: a01fdc897fa5 ("tracing: Add trace_trigger kernel command line option") Reported-by: Ross Zwisler <zwisler@google.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Tested-by: Ross Zwisler <zwisler@google.com> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace/trace_osnoise.c')
0 files changed, 0 insertions, 0 deletions