[PATCH 1/1] i386: fix a hang on stuck nmi watchdog

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <akpm@...>
Cc: Andi Kleen <ak@...>, <eranian@...>, <B.Steinbrink@...>, <linux-kernel@...>
Date: Saturday, September 1, 2007 - 4:54 pm

In the case when an nmi gets stucks the endflag stays equal to zero. This
causes the busy looping on other cpus to continue, even tho the nmi test
is done.

On my machine with out the change below the system would hang right after
check_nmi_watchdog(). The change below just sets endflag prior to checking
if the test was successful or not.

Signed-off-by: Daniel Walker <dwalker@mvista.com>

---
 arch/i386/kernel/nmi.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6.22/arch/i386/kernel/nmi.c
===================================================================
--- linux-2.6.22.orig/arch/i386/kernel/nmi.c
+++ linux-2.6.22/arch/i386/kernel/nmi.c
@@ -115,12 +115,12 @@ static int __init check_nmi_watchdog(voi
 			atomic_dec(&nmi_active);
 		}
 	}
+	endflag = 1;
 	if (!atomic_read(&nmi_active)) {
 		kfree(prev_nmi_count);
 		atomic_set(&nmi_active, -1);
 		return -1;
 	}
-	endflag = 1;
 	printk("OK.\n");
 
 	/* now that we know it works we can reduce NMI frequency to
-- 

-- 
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 1/1] i386: fix a hang on stuck nmi watchdog, Daniel Walker, (Sat Sep 1, 4:54 pm)
Re: [PATCH 1/1] i386: fix a hang on stuck nmi watchdog, Daniel Walker, (Sat Sep 1, 6:27 pm)
Re: [PATCH 1/1] i386: fix a hang on stuck nmi watchdog, Stephane Eranian, (Sat Sep 1, 5:33 pm)
Re: [PATCH 1/1] i386: fix a hang on stuck nmi watchdog, Daniel Walker, (Sat Sep 1, 5:26 pm)