Skip to content

Commit 62c982d

Browse files
committed
sched/debug: Change need_resched warnings to pr_err
JIRA: https://issues.redhat.com/browse/RHEL-78821 commit 8061b9f Author: David Rientjes <rientjes@google.com> Date: Thu Jan 9 16:24:33 2025 -0800 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 <rientjes@google.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Reviewed-by: Madadi Vineeth Reddy <vineethr@linux.ibm.com> Acked-by: Josh Don <joshdon@google.com> Link: https://lkml.kernel.org/r/e8d52023-5291-26bd-5299-8bb9eb604929@google.com Signed-off-by: Phil Auld <pauld@redhat.com>
1 parent 53acf96 commit 62c982d

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
@@ -1116,8 +1116,10 @@ void resched_latency_warn(int cpu, u64 latency)
11161116
{
11171117
static DEFINE_RATELIMIT_STATE(latency_check_ratelimit, 60 * 60 * HZ, 1);
11181118

1119-
WARN(__ratelimit(&latency_check_ratelimit),
1120-
"sched: CPU %d need_resched set for > %llu ns (%d ticks) "
1121-
"without schedule\n",
1122-
cpu, latency, cpu_rq(cpu)->ticks_without_resched);
1119+
if (likely(!__ratelimit(&latency_check_ratelimit)))
1120+
return;
1121+
1122+
pr_err("sched: CPU %d need_resched set for > %llu ns (%d ticks) without schedule\n",
1123+
cpu, latency, cpu_rq(cpu)->ticks_without_resched);
1124+
dump_stack();
11231125
}

0 commit comments

Comments
 (0)