hc
2023-12-08 01573e231f18eb2d99162747186f59511f56b64d
kernel/lib/nmi_backtrace.c
....@@ -75,22 +75,20 @@
7575 touch_softlockup_watchdog();
7676 }
7777
78
- /*
79
- * Force flush any remote buffers that might be stuck in IRQ context
80
- * and therefore could not run their irq_work.
81
- */
82
- printk_safe_flush();
83
-
8478 clear_bit_unlock(0, &backtrace_flag);
8579 put_cpu();
8680 }
81
+
82
+// Dump stacks even for idle CPUs.
83
+static bool backtrace_idle;
84
+module_param(backtrace_idle, bool, 0644);
8785
8886 bool nmi_cpu_backtrace(struct pt_regs *regs)
8987 {
9088 int cpu = smp_processor_id();
9189
9290 if (cpumask_test_cpu(cpu, to_cpumask(backtrace_mask))) {
93
- if (regs && cpu_in_idle(instruction_pointer(regs))) {
91
+ if (!READ_ONCE(backtrace_idle) && regs && cpu_in_idle(instruction_pointer(regs))) {
9492 pr_warn("NMI backtrace for cpu %d skipped: idling at %pS\n",
9593 cpu, (void *)instruction_pointer(regs));
9694 } else {