[<prev] [next>] [day] [month] [year] [list]
Message-ID: <a781481a0706070407x59c78190n65d9303857feee9c@mail.gmail.com>
Date: Thu, 7 Jun 2007 16:37:32 +0530
From: "Satyam Sharma" <satyam.sharma@...il.com>
To: "Linux Kernel Mailing List" <linux-kernel@...r.kernel.org>
Cc: "Ingo Molnar" <mingo@...hat.com>,
"Andi Kleen" <andi@...stfloor.org>, "Alan Cox" <alan@...hat.com>
Subject: [PATCH] i386/x86_64: NMI watchdog: Protect smp_call_function() within CONFIG_SMP and some trivialities
a. arch/i386/kernel/nmi.c:check_nmi_watchdog() calls
smp_call_function() unconditionally. Protect it inside
a #ifdef CONFIG_SMP, as it is meaningless for UP, also
making i386's version similar to x86_64's.
b. Also update the filename in the comment on top of
arch/{i386, x86_64}/kernel/nmi.c, while we're editing
these files.
BTW: smp_call_function() simply returns 0 and
smp_call_function_single() simply returns -EBUSY when !SMP.
These appear to be just some ad hoc values. IMHO, we should
be going BUG() in both these cases because "other" CPUs for
!SMP are undefined / meaningless. [ Copying Alan Cox. ]
Signed-off-by: Satyam Sharma <ssatyam@....iitk.ac.in>
Cc: Ingo Molnar <mingo@...hat.com>
Cc: Andi Kleen <ak@...e.de>
Cc: Alan Cox <alan@...hat.com>
---
arch/i386/kernel/nmi.c | 4 +++-
arch/x86_64/kernel/nmi.c | 2 +-
2 files changed, 4 insertions(+), 2 deletions(-)
---
diff -ruNp a/arch/i386/kernel/nmi.c b/arch/i386/kernel/nmi.c
--- a/arch/i386/kernel/nmi.c 2007-06-07 12:46:34.000000000 +0530
+++ b/arch/i386/kernel/nmi.c 2007-06-07 15:43:52.000000000 +0530
@@ -1,5 +1,5 @@
/*
- * linux/arch/i386/nmi.c
+ * linux/arch/i386/kernel/nmi.c
*
* NMI watchdog support on APIC systems
*
@@ -89,8 +89,10 @@ static int __init check_nmi_watchdog(voi
printk(KERN_INFO "Testing NMI watchdog ... ");
+#ifdef CONFIG_SMP
if (nmi_watchdog == NMI_LOCAL_APIC)
smp_call_function(nmi_cpu_busy, (void *)&endflag, 0, 0);
+#endif
for_each_possible_cpu(cpu)
prev_nmi_count[cpu] = per_cpu(irq_stat, cpu).__nmi_count;
diff -ruNp a/arch/x86_64/kernel/nmi.c b/arch/x86_64/kernel/nmi.c
--- a/arch/x86_64/kernel/nmi.c 2007-06-07 12:46:39.000000000 +0530
+++ b/arch/x86_64/kernel/nmi.c 2007-06-07 15:43:13.000000000 +0530
@@ -1,5 +1,5 @@
/*
- * linux/arch/x86_64/nmi.c
+ * linux/arch/x86_64/kernel/nmi.c
*
* NMI watchdog support on APIC systems
*
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists