hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/lib/nmi_backtrace.c
....@@ -85,12 +85,16 @@
8585 put_cpu();
8686 }
8787
88
+// Dump stacks even for idle CPUs.
89
+static bool backtrace_idle;
90
+module_param(backtrace_idle, bool, 0644);
91
+
8892 bool nmi_cpu_backtrace(struct pt_regs *regs)
8993 {
9094 int cpu = smp_processor_id();
9195
9296 if (cpumask_test_cpu(cpu, to_cpumask(backtrace_mask))) {
93
- if (regs && cpu_in_idle(instruction_pointer(regs))) {
97
+ if (!READ_ONCE(backtrace_idle) && regs && cpu_in_idle(instruction_pointer(regs))) {
9498 pr_warn("NMI backtrace for cpu %d skipped: idling at %pS\n",
9599 cpu, (void *)instruction_pointer(regs));
96100 } else {