summaryrefslogtreecommitdiff
path: root/arch/x86_64/kernel/nmi.c
diff options
context:
space:
mode:
authorDon Zickus <dzickus@redhat.com>2006-09-26 10:52:27 +0200
committerAndi Kleen <andi@basil.nowhere.org>2006-09-26 10:52:27 +0200
commite33e89ab1a8d295de0500b697f4f31c3ceee9aa2 (patch)
tree51a7955a1a67f65169278a97d3d54305cb18e8ae /arch/x86_64/kernel/nmi.c
parent407984f1af259b31957c7c05075a454a751bb801 (diff)
[PATCH] x86: Add abilty to enable/disable nmi watchdog from procfs (update)
Adds a new /proc/sys/kernel/nmi_watchdog call that will enable/disable the nmi watchdog. By entering a non-zero value here, a user can enable the nmi watchdog to monitor the online cpus in the system. By entering a zero value here, a user can disable the nmi watchdog and free up a performance counter which could then be utilized by the oprofile subsystem, otherwise oprofile may be short a counter when in use. Signed-off-by: Don Zickus <dzickus@redhat.com> Signed-off-by: Andi Kleen <ak@suse.de> Cc: Andi Kleen <ak@muc.de> Signed-off-by: Andrew Morton <akpm@osdl.org>
Diffstat (limited to 'arch/x86_64/kernel/nmi.c')
-rw-r--r--arch/x86_64/kernel/nmi.c21
1 files changed, 4 insertions, 17 deletions
diff --git a/arch/x86_64/kernel/nmi.c b/arch/x86_64/kernel/nmi.c
index 3a17411a9a19..dd57410dad51 100644
--- a/arch/x86_64/kernel/nmi.c
+++ b/arch/x86_64/kernel/nmi.c
@@ -167,7 +167,7 @@ static __cpuinit inline int nmi_known_cpu(void)
}
/* Run after command line and cpu_init init, but before all other checks */
-void __cpuinit nmi_watchdog_default(void)
+void nmi_watchdog_default(void)
{
if (nmi_watchdog != NMI_DEFAULT)
return;
@@ -766,32 +766,19 @@ int proc_nmi_enabled(struct ctl_table *table, int write, struct file *file,
if (atomic_read(&nmi_active) < 0) {
printk( KERN_WARNING "NMI watchdog is permanently disabled\n");
- return -EINVAL;
+ return -EIO;
}
/* if nmi_watchdog is not set yet, then set it */
nmi_watchdog_default();
- if (nmi_watchdog == NMI_LOCAL_APIC)
- {
+ if (nmi_watchdog == NMI_LOCAL_APIC) {
if (nmi_watchdog_enabled)
enable_lapic_nmi_watchdog();
else
disable_lapic_nmi_watchdog();
- } else if (nmi_watchdog == NMI_IO_APIC) {
- /* FIXME
- * for some reason these functions don't work
- */
- printk("Can not enable/disable NMI on IO APIC\n");
- return -EIO;
-#if 0
- if (nmi_watchdog_enabled)
- enable_timer_nmi_watchdog();
- else
- disable_timer_nmi_watchdog();
-#endif
} else {
- printk(KERN_WARNING
+ printk( KERN_WARNING
"NMI watchdog doesn't know what hardware to touch\n");
return -EIO;
}