aboutsummaryrefslogtreecommitdiff
path: root/arch/x86_64
diff options
context:
space:
mode:
authorAndi Kleen <ak@suse.de>2005-05-16 21:53:19 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-05-17 07:59:12 -0700
commitac6b931c44fd9988eaa821c339d54ba06b212412 (patch)
tree3f3c1abe2e53ced6c73c226767faf6fd8d78b2e6 /arch/x86_64
parent7179906293ebdc333f14a03d3e58b03604848f3c (diff)
[PATCH] x86_64: Reduce NMI watchdog stack usage
NR_CPUs can be quite big these days. kmalloc the per CPU array instead of putting it onto the stack Signed-off-by: Andi Kleen <ak@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/x86_64')
-rw-r--r--arch/x86_64/kernel/nmi.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/arch/x86_64/kernel/nmi.c b/arch/x86_64/kernel/nmi.c
index 61de0b34a01..ec13eb97e8e 100644
--- a/arch/x86_64/kernel/nmi.c
+++ b/arch/x86_64/kernel/nmi.c
@@ -114,7 +114,7 @@ static __init int cpu_has_lapic(void)
static int __init check_nmi_watchdog (void)
{
- int counts[NR_CPUS];
+ int *counts;
int cpu;
if (nmi_watchdog == NMI_NONE)
@@ -125,6 +125,12 @@ static int __init check_nmi_watchdog (void)
return -1;
}
+ counts = kmalloc(NR_CPUS * sizeof(int),GFP_KERNEL);
+ if (!counts) {
+ nmi_watchdog = NMI_NONE;
+ return 0;
+ }
+
printk(KERN_INFO "Testing NMI watchdog ... ");
for (cpu = 0; cpu < NR_CPUS; cpu++)
@@ -139,6 +145,7 @@ static int __init check_nmi_watchdog (void)
cpu_pda[cpu].__nmi_count);
nmi_active = 0;
lapic_nmi_owner &= ~LAPIC_NMI_WATCHDOG;
+ kfree(counts);
return -1;
}
}
@@ -149,6 +156,7 @@ static int __init check_nmi_watchdog (void)
if (nmi_watchdog == NMI_LOCAL_APIC)
nmi_hz = 1;
+ kfree(counts);
return 0;
}
/* Have this called later during boot so counters are updating */