Skip to content

Commit 8061b9f

Browse files
rientjesPeter Zijlstra
authored andcommitted
sched/debug: Change need_resched warnings to pr_err
need_resched warnings, if enabled, are treated as WARNINGs. If kernel.panic_on_warn is enabled, then this causes a kernel panic. It's highly unlikely that a panic is desired for these warnings, only a stack trace is normally required to debug and resolve. Thus, switch need_resched warnings to simply be a printk with an associated stack trace so they are no longer in scope for panic_on_warn. Signed-off-by: David Rientjes <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Reviewed-by: Madadi Vineeth Reddy <[email protected]> Acked-by: Josh Don <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent 2cf9ac4 commit 8061b9f

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

kernel/sched/debug.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1292,8 +1292,10 @@ void resched_latency_warn(int cpu, u64 latency)
12921292
{
12931293
static DEFINE_RATELIMIT_STATE(latency_check_ratelimit, 60 * 60 * HZ, 1);
12941294

1295-
WARN(__ratelimit(&latency_check_ratelimit),
1296-
"sched: CPU %d need_resched set for > %llu ns (%d ticks) "
1297-
"without schedule\n",
1298-
cpu, latency, cpu_rq(cpu)->ticks_without_resched);
1295+
if (likely(!__ratelimit(&latency_check_ratelimit)))
1296+
return;
1297+
1298+
pr_err("sched: CPU %d need_resched set for > %llu ns (%d ticks) without schedule\n",
1299+
cpu, latency, cpu_rq(cpu)->ticks_without_resched);
1300+
dump_stack();
12991301
}

0 commit comments

Comments
 (0)