Skip to contentSkip to conversation

x86: Fix i386 nmi_watchdog that does not trigger die_nmi

PATCH In review GOTO Masanori 2 participants 2 messages Mar 7, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86: Fix i386 nmi_watchdog that does not trigger die_nmi

It fixes i386 nmi_watchdog that does not meet watchdog timeout condition. It does not hit die_nmi when it should be triggered, because the current nmi_watchdog_tick in arch/i386/kernel/nmi.c never count up alert_counter like this:

	void nmi_watchdog_tick (struct pt_regs * regs) {
	if (last_irq_sums[cpu] == sum) {
		alert_counter[cpu]++;		<- count up alert_counter, but
		if (alert_counter[cpu] == 5*nmi_hz)
			die_nmi(regs, "NMI Watchdog detected LOCKUP");
		alert_counter[cpu] = 0;		<- reset alert_counter

This patch changes it back to the previous and working version. Tested with 2.6.15. It's also OK for 2.6.16-rc5.

This was found and originally written by Kohta NAKASHIMA.

-- gotom

---

arch/i386/kernel/nmi.c renamed from arch/i386/kernel/nmi.c.gotom +1 -1
@@ -544,7 +544,7 @@ void nmi_watchdog_tick (struct pt_regs *
 			 * die_nmi will return ONLY if NOTIFY_STOP happens..
 			 */
 			die_nmi(regs, "NMI Watchdog detected LOCKUP");
-
+	} else {
 		last_irq_sums[cpu] = sum;
 		alert_counter[cpu] = 0;
 	}
#1 lore raw
Quoted 12 lines · GOTO Masanori

It fixes i386 nmi_watchdog that does not meet watchdog timeout condition. It does not hit die_nmi when it should be triggered, because the current nmi_watchdog_tick in arch/i386/kernel/nmi.c never count up alert_counter like this:

	void nmi_watchdog_tick (struct pt_regs * regs) {
	if (last_irq_sums[cpu] == sum) {
		alert_counter[cpu]++;		<- count up alert_counter, but
		if (alert_counter[cpu] == 5*nmi_hz)
			die_nmi(regs, "NMI Watchdog detected LOCKUP");
		alert_counter[cpu] = 0;		<- reset alert_counter
Quoted 4 lines

This patch changes it back to the previous and working version. Tested with 2.6.15. It's also OK for 2.6.16-rc5.

This was found and originally written by Kohta NAKASHIMA.

Oops. Looks quite bad. Real 2.6.16 candidate I guess.

-Andi

Quoted 17 lines

-- gotom

---

arch/i386/kernel/nmi.c renamed from arch/i386/kernel/nmi.c.gotom +1 -1
@@ -544,7 +544,7 @@ void nmi_watchdog_tick (struct pt_regs *
 			 * die_nmi will return ONLY if NOTIFY_STOP happens..
 			 */
 			die_nmi(regs, "NMI Watchdog detected LOCKUP");
-
+	} else {
 		last_irq_sums[cpu] = sum;
 		alert_counter[cpu] = 0;
 	}