.. | .. |
---|
75 | 75 | touch_softlockup_watchdog(); |
---|
76 | 76 | } |
---|
77 | 77 | |
---|
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 | | - |
---|
84 | 78 | clear_bit_unlock(0, &backtrace_flag); |
---|
85 | 79 | put_cpu(); |
---|
86 | 80 | } |
---|
| 81 | + |
---|
| 82 | +// Dump stacks even for idle CPUs. |
---|
| 83 | +static bool backtrace_idle; |
---|
| 84 | +module_param(backtrace_idle, bool, 0644); |
---|
87 | 85 | |
---|
88 | 86 | bool nmi_cpu_backtrace(struct pt_regs *regs) |
---|
89 | 87 | { |
---|
90 | 88 | int cpu = smp_processor_id(); |
---|
91 | 89 | |
---|
92 | 90 | 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))) { |
---|
94 | 92 | pr_warn("NMI backtrace for cpu %d skipped: idling at %pS\n", |
---|
95 | 93 | cpu, (void *)instruction_pointer(regs)); |
---|
96 | 94 | } else { |
---|