[PATCH] x86: fix setup NMI_LOCAL_APIC watchdog

From: Hillf Danton
Date: Thu Feb 03 2011 - 10:07:18 EST


when testing NMI watchdog, at leat for NMI_LOCAL_APIC, the default
value of nmi_active could prevent the dog from being tested. Even
could not, lapic_adjust_nmi_hz() could misplay its role since the
underlying hardware is still not initialized by lapic_watchdog_init().

And for same reason the check for wd_ops could be removed in
enable_lapic_nmi_watchdog(), in which nmi_active is also checked.

If NMI_LOCAL_APIC is enabled thru sysctl on cmdline after bootup, how
to test stuckup?

Signed-off-by: Hillf Danton <dhillf@xxxxxxxxx>
---

--- a/arch/x86/kernel/apic/nmi.c 2011-01-05 08:50:20.000000000 +0800
+++ b/arch/x86/kernel/apic/nmi.c 2011-02-03 22:51:42.000000000 +0800
@@ -171,7 +171,7 @@ int __init check_nmi_watchdog(void)
* something more reasonable; makes a difference in some configs
*/
if (nmi_watchdog == NMI_LOCAL_APIC)
- nmi_hz = lapic_adjust_nmi_hz(1);
+ nmi_hz = 1;

kfree(prev_nmi_count);
return 0;
--- a/arch/x86/kernel/cpu/perfctr-watchdog.c 2011-01-05 08:50:20.000000000 +0800
+++ b/arch/x86/kernel/cpu/perfctr-watchdog.c 2011-02-03 22:48:44.000000000 +0800
@@ -196,14 +196,6 @@ void enable_lapic_nmi_watchdog(void)
if (atomic_read(&nmi_active) != 0)
return;

- /* are we lapic aware */
- if (!wd_ops)
- return;
- if (!wd_ops->reserve()) {
- printk(KERN_ERR "NMI watchdog: cannot reserve perfctrs\n");
- return;
- }
-
on_each_cpu(setup_apic_nmi_watchdog, NULL, 1);
touch_nmi_watchdog();
}
--
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/