kernel/trace: fix watchdog soft lockup
PATCH v2 1/1 kernel/trace: fix watchdog soft lockup
When building a allmodconfig kernel for arm64 and boot that in qemu, CONFIG_FTRACE_STARTUP_TEST gets enabled and that takes time so the watchdog expires and prints out a message like this:
'watchdog: BUG: soft lockup - CPU#0 stuck for 22s! [swapper/0:1]' Depending on what the what test gets called from init_trace_selftests() it stays minutes in the loop.
Rework so that function cond_resched() gets called in the init_trace_selftests loop.
--- kernel/trace/trace.c | 4 ++++ 1 file changed, 4 insertions(+)
kernel/trace/trace.c +4 -0
@@ -1547,6 +1547,10 @@ static __init int init_trace_selftests(void)pr_info ("Running postponed tracer tests:\n" );list_for_each_entry_safe (p, n, &postponed_selftests, list) { +/* This loop can take minutes when sanitizers are enabled, so +* lets make sure we allow RCU processing. +*/ +cond_resched (); ret =run_tracer_selftest (p->type);/* If the test fails, then warn and remove from available_tracers */ if (ret <0 ) {
Signature · 1 line
2.19.2
Steven Rostedt
maintainerQuoted 9 lines · On Fri, 30 Nov 2018 15:56:22 +0100 Anders Roxell <[email protected]>…
When building a allmodconfig kernel for arm64 and boot that in qemu,
CONFIG_FTRACE_STARTUP_TESTgets enabled and that takes time so the watchdog expires and prints out a message like this:
'watchdog: BUG: soft lockup - CPU#0 stuck for 22s! [swapper/0:1]' Depending on what the what test gets called frominit_trace_selftests()it stays minutes in the loop.
Rework so that functioncond_resched()gets called in theinit_trace_selftestsloop.
This looks fine to me. Should it be marked for stable, and pushed into this release cycle, or wait till the next merge window?
-- Steve
Quoted 22 lines
Co-developed-by Arnd Bergmann <[email protected]>Signed-off-by Arnd Bergmann <[email protected]>Signed-off-by Anders Roxell <[email protected]>--- kernel/trace/trace.c | 4 ++++ 1 file changed, 4 insertions(+)kernel/trace/trace.c +4
-0@@ -1547,6 +1547,10 @@ static __init int init_trace_selftests(void)pr_info ("Running postponed tracer tests:\n" );list_for_each_entry_safe (p, n, &postponed_selftests, list) { +/* This loop can take minutes when sanitizers are enabled, so +* lets make sure we allow RCU processing. +*/ +cond_resched (); ret =run_tracer_selftest (p->type);/* If the test fails, then warn and remove from available_tracers */ if (ret <0 ) {
Quoted 14 lines · Steven Rostedt
Quoted 9 lines · On Fri, 30 Nov 2018 15:56:22 +0100 Anders Roxell <[email protected]>…
When building a allmodconfig kernel for arm64 and boot that in qemu,
CONFIG_FTRACE_STARTUP_TESTgets enabled and that takes time so the watchdog expires and prints out a message like this:
'watchdog: BUG: soft lockup - CPU#0 stuck for 22s! [swapper/0:1]' Depending on what the what test gets called frominit_trace_selftests()it stays minutes in the loop.
Rework so that functioncond_resched()gets called in theinit_trace_selftestsloop.
Quoted 2 lines
This looks fine to me. Should it be marked for stable, and pushed into this release cycle, or wait till the next merge window?
Steve, I'm sorry for the late reply and no its not urgent. Maybe it can make it into v5.2 ?
Cheers,
Anders
Quoted 26 lines
-- Steve
Quoted 22 lines
Co-developed-by Arnd Bergmann <[email protected]>Signed-off-by Arnd Bergmann <[email protected]>Signed-off-by Anders Roxell <[email protected]>--- kernel/trace/trace.c | 4 ++++ 1 file changed, 4 insertions(+)kernel/trace/trace.c +4
-0@@ -1547,6 +1547,10 @@ static __init int init_trace_selftests(void)pr_info ("Running postponed tracer tests:\n" );list_for_each_entry_safe (p, n, &postponed_selftests, list) { +/* This loop can take minutes when sanitizers are enabled, so +* lets make sure we allow RCU processing. +*/ +cond_resched (); ret =run_tracer_selftest (p->type);/* If the test fails, then warn and remove from available_tracers */ if (ret <0 ) {