[patch, -rc5-mm1] lock validator: fix NMI-disabling on x86_64

From: Ingo Molnar
Date: Tue May 30 2006 - 08:33:06 EST



and NMI disabling wasnt perfect on x86_64 either. (we did it too late,
which allowed a few NMI ticks to still occur.)

---------------
Subject: lock validator: fix NMI-disabling on x86_64
From: Ingo Molnar <mingo@xxxxxxx>

this does the NMI-watchdog disabling at the right place on x86_64.

should probably be folded into:

lock-validator-disable-nmi-watchdog-if-config_lockdep.patch

Signed-off-by: Ingo Molnar <mingo@xxxxxxx>
---
arch/x86_64/kernel/nmi.c | 23 +++++++++++------------
1 file changed, 11 insertions(+), 12 deletions(-)

Index: linux/arch/x86_64/kernel/nmi.c
===================================================================
--- linux.orig/arch/x86_64/kernel/nmi.c
+++ linux/arch/x86_64/kernel/nmi.c
@@ -215,18 +215,6 @@ int __init check_nmi_watchdog (void)
int *counts;
int cpu;

-#ifdef CONFIG_LOCKDEP
- /*
- * The NMI watchdog uses spinlocks (notifier chains, etc.),
- * so it's not lockdep-safe:
- */
- nmi_watchdog = 0;
- for_each_online_cpu(cpu)
- per_cpu(nmi_watchdog_ctlblk.enabled, cpu) = 0;
-
- printk("lockdep: disabled NMI watchdog.\n");
- return 0;
-#endif
if ((nmi_watchdog == NMI_NONE) || (nmi_watchdog == NMI_DEFAULT))
return 0;

@@ -680,6 +668,17 @@ static void stop_intel_arch_watchdog(voi

void setup_apic_nmi_watchdog(void *unused)
{
+#ifdef CONFIG_LOCKDEP
+ /*
+ * The NMI watchdog uses spinlocks (notifier chains, etc.),
+ * so it's not lockdep-safe:
+ */
+ nmi_watchdog = NMI_NONE;
+ printk("lockdep: disabled NMI watchdog.\n");
+
+ return;
+#endif
+
/* only support LOCAL and IO APICs for now */
if ((nmi_watchdog != NMI_LOCAL_APIC) &&
(nmi_watchdog != NMI_IO_APIC))
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/