Skip to contentSkip to conversation

powerpc/watchdog: remove arch_trigger_cpumask_backtrace

PATCH Applied Nicholas Piggin 2 participants 2 messages Jan 17, 2018 – Jan 22, 2018 PowerPC

lore
Share & tools
lore

Nicholas Piggin

author reviewer
#0 lore raw

PATCH 1/1 powerpc/watchdog: remove arch_trigger_cpumask_backtrace

The powerpc NMI IPIs may not be recoverable if they are taken in some sections of code, and also there have been and still are issues with taking NMIs (in KVM guest code, in firmware, etc) which makes them a bit dangerous to use.

Generic code like softlockup detector and rcu stall detectors really hammer on trigger_*_backtrace, which has lead to further problems because we've implemented it with the NMI.

So stop providing NMI backtraces for now. Importantly, the powerpc code uses NMI IPIs in crash/debug, and the SMP hardlockup watchdog. So if the softlockup and rcu hang detection traces are not being printed because the CPU is stuck with interrupts off, then the hard lockup watchdog should get it with the NMI IPI.

Fixes 2104180a5369 ("powerpc/64s: implement arch-specific hardlockup watchdog")
---
 arch/powerpc/include/asm/nmi.h |  4 ----
 arch/powerpc/kernel/watchdog.c | 21 ---------------------
 2 files changed, 25 deletions(-)
arch/powerpc/include/asm/nmi.h +0 -4
index e97f58689ca7..9c80939b4d14 100644
@@ -4,10 +4,6 @@
 
 #ifdef CONFIG_PPC_WATCHDOG
 extern void arch_touch_nmi_watchdog(void);
-extern void arch_trigger_cpumask_backtrace(const cpumask_t *mask,
-					   bool exclude_self);
-#define arch_trigger_cpumask_backtrace arch_trigger_cpumask_backtrace
-
 #else
 static inline void arch_touch_nmi_watchdog(void) {}
 #endif
arch/powerpc/kernel/watchdog.c +0 -21
index 87da80ccced1..a49dd9e7e58a 100644
@@ -394,24 +394,3 @@ int __init watchdog_nmi_probe(void)
 	return 0;
 }
 
-static void handle_backtrace_ipi(struct pt_regs *regs)
-{
-	nmi_cpu_backtrace(regs);
-}
-
-static void raise_backtrace_ipi(cpumask_t *mask)
-{
-	unsigned int cpu;
-
-	for_each_cpu(cpu, mask) {
-		if (cpu == smp_processor_id())
-			handle_backtrace_ipi(NULL);
-		else
-			smp_send_nmi_ipi(cpu, handle_backtrace_ipi, 1000000);
-	}
-}
-
-void arch_trigger_cpumask_backtrace(const cpumask_t *mask, bool exclude_self)
-{
-	nmi_trigger_cpumask_backtrace(mask, exclude_self, raise_backtrace_ipi);
-}
Signature · 1 line
2.15.1
#1 lore raw
Quoted 9 lines · Nicholas Piggin

The powerpc NMI IPIs may not be recoverable if they are taken in some sections of code, and also there have been and still are issues with taking NMIs (in KVM guest code, in firmware, etc) which makes them a bit dangerous to use.

Generic code like softlockup detector and rcu stall detectors really hammer on trigger_*_backtrace, which has lead to further problems because we've implemented it with the NMI.

Quoted 8 lines

So stop providing NMI backtraces for now. Importantly, the powerpc code uses NMI IPIs in crash/debug, and the SMP hardlockup watchdog. So if the softlockup and rcu hang detection traces are not being printed because the CPU is stuck with interrupts off, then the hard lockup watchdog should get it with the NMI IPI.

Fixes 2104180a5369 ("powerpc/64s: implement arch-specific hardlockup watchdog")

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/47712a921bb781caf69fca9eae43be

cheers