[PATCH] lib/nmi_backtrace: print out the CPUs which fail to respond to NMI
From: Feng Tang
Date: Wed May 20 2026 - 23:04:10 EST
When debugging RCU stall cases, usually all CPUs will respond to the
NMI and print out the backtrace. But in some nasty or hardware related
cases, some CPUs may fail to respond in 10 seconds, and very likely
this is sign of severe issues.
Paul E. McKenney has implemented the NMI backtrace stall check for x86,
and for other architectures, it should be also helpful to at least
print out those CPUs which failed to repond to the NMI, so that users
can get an early heads-up for possible CPU hard stall.
Signed-off-by: Feng Tang <feng.tang@xxxxxxxxxxxxxxxxx>
---
lib/nmi_backtrace.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/lib/nmi_backtrace.c b/lib/nmi_backtrace.c
index 33c154264bfe..a113d3d669be 100644
--- a/lib/nmi_backtrace.c
+++ b/lib/nmi_backtrace.c
@@ -75,7 +75,13 @@ void nmi_trigger_cpumask_backtrace(const cpumask_t *mask,
mdelay(1);
touch_softlockup_watchdog();
}
- nmi_backtrace_stall_check(to_cpumask(backtrace_mask));
+
+ if (!cpumask_empty(to_cpumask(backtrace_mask))) {
+ pr_warn("After 10 seconds, these CPUS still haven't responded to the NMI: %*pbl\n",
+ cpumask_pr_args(to_cpumask(backtrace_mask)));
+
+ nmi_backtrace_stall_check(to_cpumask(backtrace_mask));
+ }
/*
* Force flush any remote buffers that might be stuck in IRQ context
--
2.39.5 (Apple Git-154)