Skip to contentSkip to conversation

i386: fix a hang on stuck nmi watchdog

PATCH In review Daniel Walker 3 participants 5 messages Sep 1, 2007

lore
Share & tools
lore
#0 lore raw

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

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.

---
 arch/i386/kernel/nmi.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/i386/kernel/nmi.c +1 -1
Index: 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
Signature · 1 line
-- 
#1 lore raw

Daniel,

Thanks for your help tracking down this bug. Maybe we can close the bugzilla report now.

Quoted 35 lines · Daniel Walker

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.

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

Index: linux-2.6.22/arch/i386/kernel/nmi.c
===================================================================

arch/i386/kernel/nmi.c +1 -1
@@ -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
Signature · 1 line
-- 
Signature · 1 line
-Stephane
#2 lore raw
Quoted 4 lines · Stephane Eranian

Daniel,

Thanks for your help tracking down this bug. Maybe we can close the bugzilla report now.

No problem , and thanks for taking the time to dig into it ..

I'll close the bugzilla report.

Daniel

#3 lore raw
In reply to Daniel Walker
Quoted 9 lines · On Saturday 01 September 2007 22:54:17 Daniel Walker wrote:

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.

Added thanks. I guess it's .23 material.

-Andi

#4 lore raw
Quoted 5 lines · Andi Kleen
Quoted 4 lines · On Saturday 01 September 2007 22:54:17 Daniel Walker wrote:

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.

Quoted 7 lines
Quoted 5 lines

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.

Added thanks. I guess it's .23 material.

putting it in 2.6.23 seems appropriate .. Stephane's patch might be good for 2.6.23 too ..

Daniel