From: David Rientjes Date: Fri, 10 Jan 2025 00:24:33 +0000 (-0800) Subject: sched/debug: Change need_resched warnings to pr_err X-Git-Tag: block-6.14-20240131~50^2~13 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=8061b9f5e111a3012f8b691e5b75dd81eafbb793;p=linux-block.git 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 Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Madadi Vineeth Reddy Acked-by: Josh Don Link: https://lkml.kernel.org/r/e8d52023-5291-26bd-5299-8bb9eb604929@google.com --- diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c index 5e8e84a2bcb1..fd7e85220715 100644 --- a/kernel/sched/debug.c +++ b/kernel/sched/debug.c @@ -1292,8 +1292,10 @@ void resched_latency_warn(int cpu, u64 latency) { static DEFINE_RATELIMIT_STATE(latency_check_ratelimit, 60 * 60 * HZ, 1); - WARN(__ratelimit(&latency_check_ratelimit), - "sched: CPU %d need_resched set for > %llu ns (%d ticks) " - "without schedule\n", - cpu, latency, cpu_rq(cpu)->ticks_without_resched); + if (likely(!__ratelimit(&latency_check_ratelimit))) + return; + + pr_err("sched: CPU %d need_resched set for > %llu ns (%d ticks) without schedule\n", + cpu, latency, cpu_rq(cpu)->ticks_without_resched); + dump_stack(); }