Skip to contentSkip to conversation

Patch "powerpc/watchdog: Do not trigger SMP crash from touch_nmi_watchdog" has been added to the 4.14-stable tree

PATCH [email protected] 1 participant 1 message Dec 20, 2017

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

powerpc/watchdog: Do not trigger SMP crash from touch_nmi_watchdog

to the 4.14-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
powerpc-watchdog-do-not-trigger-smp-crash-from-touch_nmi_watchdog.patch
and it can be found in the queue-4.14 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From foo@baz Wed Dec 20 18:17:52 CET 2017

From: Nicholas Piggin <[email protected]>
Date: Fri, 29 Sep 2017 13:29:39 +1000
Subject: powerpc/watchdog: Do not trigger SMP crash from touch_nmi_watchdog

From: Nicholas Piggin <[email protected]>

[ Upstream commit 80e4d70b06863e0104e5a0dc78aa3710297fbd4b ]

In xmon, touch_nmi_watchdog() is not expected to be checking that other CPUs have not touched the watchdog, so the code will just call touch_nmi_watchdog() once before re-enabling hard interrupts.

Just update our CPU's state, and ignore apparently stuck SMP threads.

Arguably touch_nmi_watchdog should check for SMP lockups, and callers should be fixed, but that's not trivial for the input code of xmon.

---
 arch/powerpc/kernel/watchdog.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
arch/powerpc/kernel/watchdog.c +5 -2
@@ -276,9 +276,12 @@ void arch_touch_nmi_watchdog(void)
 {
 	unsigned long ticks = tb_ticks_per_usec * wd_timer_period_ms * 1000;
 	int cpu = smp_processor_id();
+	u64 tb = get_tb();
 
-	if (get_tb() - per_cpu(wd_timer_tb, cpu) >= ticks)
-		watchdog_timer_interrupt(cpu);
+	if (tb - per_cpu(wd_timer_tb, cpu) >= ticks) {
+		per_cpu(wd_timer_tb, cpu) = tb;
+		wd_smp_clear_cpu_pending(cpu, tb);
+	}
 }
 EXPORT_SYMBOL(arch_touch_nmi_watchdog);
 

Patches currently in stable-queue which might be from [email protected] are

queue-4.14/cpuidle-fix-broadcast-control-when-broadcast-can-not-be-entered.patch queue-4.14/powerpc-xmon-avoid-tripping-smp-hardlockup-watchdog.patch queue-4.14/powerpc-watchdog-do-not-trigger-smp-crash-from-touch_nmi_watchdog.patch