[PATCH -rt 3/4] x86: nmi_watchdog NMI needed for irq_show_regs_callback()

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Hiroshi Shimamoto
Date: Monday, April 28, 2008 - 11:17 am

From: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>

The -rt kernel doesn't panic immediately when NMI lockup detected.
Because the kernel waits show_regs on all cpus, but NMI is not come so
frequently.

Signed-off-by: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
---
 arch/x86/kernel/nmi_32.c |    7 +++++++
 arch/x86/kernel/nmi_64.c |    8 +++++++-
 2 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kernel/nmi_32.c b/arch/x86/kernel/nmi_32.c
index f55f05b..da9deb3 100644
--- a/arch/x86/kernel/nmi_32.c
+++ b/arch/x86/kernel/nmi_32.c
@@ -428,6 +428,13 @@ nmi_watchdog_tick(struct pt_regs *regs, unsigned reason)
 				if (i == cpu)
 					continue;
 				nmi_show_regs[i] = 1;
+			}
+
+			smp_send_nmi_allbutself();
+
+			for_each_online_cpu(i) {
+				if (i == cpu)
+					continue;
 				while (nmi_show_regs[i] == 1)
 					cpu_relax();
 			}
diff --git a/arch/x86/kernel/nmi_64.c b/arch/x86/kernel/nmi_64.c
index 69cc737..5d3073c 100644
--- a/arch/x86/kernel/nmi_64.c
+++ b/arch/x86/kernel/nmi_64.c
@@ -412,10 +412,16 @@ nmi_watchdog_tick(struct pt_regs * regs, unsigned reason)
 				if (i == cpu)
 					continue;
 				nmi_show_regs[i] = 1;
+			}
+
+			smp_send_nmi_allbutself();
+
+			for_each_online_cpu(i) {
+				if (i == cpu)
+					continue;
 				while (nmi_show_regs[i] == 1)
 					cpu_relax();
 			}
-
 			die_nmi("NMI Watchdog detected LOCKUP on CPU %d\n", regs,
 				panic_on_timeout);
 		}
-- 
1.5.4.1

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

Messages in current thread:
[PATCH -rt 0/4] nmi_watchdog fixes for -rt, Hiroshi Shimamoto, (Mon Apr 28, 11:10 am)
[PATCH -rt 1/4] x86_64: send NMI after nmi_show_regs on, Hiroshi Shimamoto, (Mon Apr 28, 11:14 am)
[PATCH -rt 2/4] x86: return true for NMI handled, Hiroshi Shimamoto, (Mon Apr 28, 11:16 am)
[PATCH -rt 3/4] x86: nmi_watchdog NMI needed for irq_show_ ..., Hiroshi Shimamoto, (Mon Apr 28, 11:17 am)
[PATCH -rt 4/4] wait for finish show_regs() before panic, Hiroshi Shimamoto, (Mon Apr 28, 11:19 am)
Re: [PATCH -rt 1/4] x86_64: send NMI after nmi_show_regs on, Steven Rostedt, (Mon Apr 28, 12:00 pm)
Re: [PATCH -rt 0/4] nmi_watchdog fixes for -rt, Steven Rostedt, (Mon Apr 28, 12:03 pm)
Re: [PATCH -rt 1/4] x86_64: send NMI after nmi_show_regs on, Hiroshi Shimamoto, (Mon Apr 28, 2:34 pm)