Skip to content

Commit 55efe4a

Browse files
diandersakpm00
authored andcommitted
watchdog: if panicking and we dumped everything, don't re-enable dumping
If, as part of handling a hardlockup or softlockup, we've already dumped all CPUs and we're just about to panic, don't reenable dumping and give some other CPU a chance to hop in there and add some confusing logs right as the panic is happening. Link: https://lkml.kernel.org/r/20231220131534.4.Id3a9c7ec2d7d83e4080da6f8662ba2226b40543f@changeid Signed-off-by: Douglas Anderson <dianders@chromium.org> Cc: John Ogness <john.ogness@linutronix.de> Cc: Lecopzer Chen <lecopzer.chen@mediatek.com> Cc: Li Zhe <lizhe.67@bytedance.com> Cc: Petr Mladek <pmladek@suse.com> Cc: Pingfan Liu <kernelfans@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
1 parent ee6bdb3 commit 55efe4a

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

kernel/watchdog.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,8 @@ void watchdog_hardlockup_check(unsigned int cpu, struct pt_regs *regs)
192192

193193
if (sysctl_hardlockup_all_cpu_backtrace) {
194194
trigger_allbutcpu_cpu_backtrace(cpu);
195-
clear_bit_unlock(0, &hard_lockup_nmi_warn);
195+
if (!hardlockup_panic)
196+
clear_bit_unlock(0, &hard_lockup_nmi_warn);
196197
}
197198

198199
if (hardlockup_panic)
@@ -548,7 +549,8 @@ static enum hrtimer_restart watchdog_timer_fn(struct hrtimer *hrtimer)
548549

549550
if (softlockup_all_cpu_backtrace) {
550551
trigger_allbutcpu_cpu_backtrace(smp_processor_id());
551-
clear_bit_unlock(0, &soft_lockup_nmi_warn);
552+
if (!softlockup_panic)
553+
clear_bit_unlock(0, &soft_lockup_nmi_warn);
552554
}
553555

554556
add_taint(TAINT_SOFTLOCKUP, LOCKDEP_STILL_OK);

0 commit comments

Comments
 (0)