Skip to content

Commit 4774156

Browse files
author
Fox Snowpatch
committed
1 parent 7170d5d commit 4774156

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

arch/powerpc/kernel/watchdog.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include <linux/delay.h>
2727
#include <linux/processor.h>
2828
#include <linux/smp.h>
29+
#include <linux/sys_info.h>
2930

3031
#include <asm/interrupt.h>
3132
#include <asm/paca.h>
@@ -235,7 +236,11 @@ static void watchdog_smp_panic(int cpu)
235236
pr_emerg("CPU %d TB:%lld, last SMP heartbeat TB:%lld (%lldms ago)\n",
236237
cpu, tb, last_reset, tb_to_ns(tb - last_reset) / 1000000);
237238

238-
if (!sysctl_hardlockup_all_cpu_backtrace) {
239+
if (sysctl_hardlockup_all_cpu_backtrace ||
240+
(hardlockup_si_mask & SYS_INFO_ALL_BT)) {
241+
trigger_allbutcpu_cpu_backtrace(cpu);
242+
cpumask_clear(&wd_smp_cpus_ipi);
243+
} else {
239244
/*
240245
* Try to trigger the stuck CPUs, unless we are going to
241246
* get a backtrace on all of them anyway.
@@ -244,11 +249,9 @@ static void watchdog_smp_panic(int cpu)
244249
smp_send_nmi_ipi(c, wd_lockup_ipi, 1000000);
245250
__cpumask_clear_cpu(c, &wd_smp_cpus_ipi);
246251
}
247-
} else {
248-
trigger_allbutcpu_cpu_backtrace(cpu);
249-
cpumask_clear(&wd_smp_cpus_ipi);
250252
}
251253

254+
sys_info(hardlockup_si_mask & ~SYS_INFO_ALL_BT);
252255
if (hardlockup_panic)
253256
nmi_panic(NULL, "Hard LOCKUP");
254257

@@ -415,9 +418,11 @@ DEFINE_INTERRUPT_HANDLER_NMI(soft_nmi_interrupt)
415418

416419
xchg(&__wd_nmi_output, 1); // see wd_lockup_ipi
417420

418-
if (sysctl_hardlockup_all_cpu_backtrace)
421+
if (sysctl_hardlockup_all_cpu_backtrace ||
422+
(hardlockup_si_mask & SYS_INFO_ALL_BT))
419423
trigger_allbutcpu_cpu_backtrace(cpu);
420424

425+
sys_info(hardlockup_si_mask & ~SYS_INFO_ALL_BT);
421426
if (hardlockup_panic)
422427
nmi_panic(regs, "Hard LOCKUP");
423428

include/linux/nmi.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ static inline void reset_hung_task_detector(void) { }
8383
#if defined(CONFIG_HARDLOCKUP_DETECTOR)
8484
extern void hardlockup_detector_disable(void);
8585
extern unsigned int hardlockup_panic;
86+
extern unsigned long hardlockup_si_mask;
8687
#else
8788
static inline void hardlockup_detector_disable(void) {}
8889
#endif

kernel/watchdog.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ unsigned int __read_mostly hardlockup_panic =
7171
* hard lockup is detected, it could be task, memory, lock etc.
7272
* Refer include/linux/sys_info.h for detailed bit definition.
7373
*/
74-
static unsigned long hardlockup_si_mask;
74+
unsigned long hardlockup_si_mask;
7575

7676
#ifdef CONFIG_SYSFS
7777

0 commit comments

Comments
 (0)