.. | .. |
---|
85 | 85 | put_cpu(); |
---|
86 | 86 | } |
---|
87 | 87 | |
---|
| 88 | +// Dump stacks even for idle CPUs. |
---|
| 89 | +static bool backtrace_idle; |
---|
| 90 | +module_param(backtrace_idle, bool, 0644); |
---|
| 91 | + |
---|
88 | 92 | bool nmi_cpu_backtrace(struct pt_regs *regs) |
---|
89 | 93 | { |
---|
90 | 94 | int cpu = smp_processor_id(); |
---|
91 | 95 | |
---|
92 | 96 | 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))) { |
---|
94 | 98 | pr_warn("NMI backtrace for cpu %d skipped: idling at %pS\n", |
---|
95 | 99 | cpu, (void *)instruction_pointer(regs)); |
---|
96 | 100 | } else { |
---|