Skip to content

Commit 9da705d

Browse files
committed
tracing: Have tracer selftests call cond_resched() before running
As there are more and more internal selftests being added to the Linux kernel (KSAN, lockdep, etc) the selftests are taking longer to run when these are enabled. Add a cond_resched() to the calling of do_run_tracer_selftest() to force a schedule if NEED_RESCHED is set, otherwise the soft lockup watchdog may trigger on boot up. Link: https://lkml.kernel.org/r/20230528051742.1325503-3-rostedt@goodmis.org Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
1 parent e8352cf commit 9da705d

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

kernel/trace/trace.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2045,6 +2045,13 @@ static int do_run_tracer_selftest(struct tracer *type)
20452045
{
20462046
int ret;
20472047

2048+
/*
2049+
* Tests can take a long time, especially if they are run one after the
2050+
* other, as does happen during bootup when all the tracers are
2051+
* registered. This could cause the soft lockup watchdog to trigger.
2052+
*/
2053+
cond_resched();
2054+
20482055
tracing_selftest_running = true;
20492056
ret = run_tracer_selftest(type);
20502057
tracing_selftest_running = false;

0 commit comments

Comments
 (0)