mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-15 23:25:07 +00:00
watchdog/hardlockup: avoid large stack frames in watchdog_hardlockup_check()
After commit77c12fc959
("watchdog/hardlockup: add a "cpu" param to watchdog_hardlockup_check()") we started storing a `struct cpumask` on the stack in watchdog_hardlockup_check(). On systems with CONFIG_NR_CPUS set to 8192 this takes up 1K on the stack. That triggers warnings with `CONFIG_FRAME_WARN` set to 1024. We'll use the new trigger_allbutcpu_cpu_backtrace() to avoid needing to use a CPU mask at all. Link: https://lkml.kernel.org/r/20230804065935.v4.2.I501ab68cb926ee33a7c87e063d207abf09b9943c@changeid Fixes:77c12fc959
("watchdog/hardlockup: add a "cpu" param to watchdog_hardlockup_check()") Signed-off-by: Douglas Anderson <dianders@chromium.org> Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/r/202307310955.pLZDhpnl-lkp@intel.com Acked-by: Michal Hocko <mhocko@suse.com> Reviewed-by: Petr Mladek <pmladek@suse.com> Cc: Lecopzer Chen <lecopzer.chen@mediatek.com> Cc: Pingfan Liu <kernelfans@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
parent
8d539b84f1
commit
1f38c86bb2
1 changed files with 2 additions and 7 deletions
|
@ -151,9 +151,6 @@ void watchdog_hardlockup_check(unsigned int cpu, struct pt_regs *regs)
|
||||||
*/
|
*/
|
||||||
if (is_hardlockup(cpu)) {
|
if (is_hardlockup(cpu)) {
|
||||||
unsigned int this_cpu = smp_processor_id();
|
unsigned int this_cpu = smp_processor_id();
|
||||||
struct cpumask backtrace_mask;
|
|
||||||
|
|
||||||
cpumask_copy(&backtrace_mask, cpu_online_mask);
|
|
||||||
|
|
||||||
/* Only print hardlockups once. */
|
/* Only print hardlockups once. */
|
||||||
if (per_cpu(watchdog_hardlockup_warned, cpu))
|
if (per_cpu(watchdog_hardlockup_warned, cpu))
|
||||||
|
@ -167,10 +164,8 @@ void watchdog_hardlockup_check(unsigned int cpu, struct pt_regs *regs)
|
||||||
show_regs(regs);
|
show_regs(regs);
|
||||||
else
|
else
|
||||||
dump_stack();
|
dump_stack();
|
||||||
cpumask_clear_cpu(cpu, &backtrace_mask);
|
|
||||||
} else {
|
} else {
|
||||||
if (trigger_single_cpu_backtrace(cpu))
|
trigger_single_cpu_backtrace(cpu);
|
||||||
cpumask_clear_cpu(cpu, &backtrace_mask);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -179,7 +174,7 @@ void watchdog_hardlockup_check(unsigned int cpu, struct pt_regs *regs)
|
||||||
*/
|
*/
|
||||||
if (sysctl_hardlockup_all_cpu_backtrace &&
|
if (sysctl_hardlockup_all_cpu_backtrace &&
|
||||||
!test_and_set_bit(0, &watchdog_hardlockup_all_cpu_dumped))
|
!test_and_set_bit(0, &watchdog_hardlockup_all_cpu_dumped))
|
||||||
trigger_cpumask_backtrace(&backtrace_mask);
|
trigger_allbutcpu_cpu_backtrace(cpu);
|
||||||
|
|
||||||
if (hardlockup_panic)
|
if (hardlockup_panic)
|
||||||
nmi_panic(regs, "Hard LOCKUP");
|
nmi_panic(regs, "Hard LOCKUP");
|
||||||
|
|
Loading…
Reference in a new issue