aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86_64/kernel/nmi.c
diff options
context:
space:
mode:
authorAndi Kleen <ak@suse.de>2005-05-17 00:53:19 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-05-17 10:59:12 -0400
commitac6b931c44fd9988eaa821c339d54ba06b212412 (patch)
tree3f3c1abe2e53ced6c73c226767faf6fd8d78b2e6 /arch/x86_64/kernel/nmi.c
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/kernel/nmi.c')
-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)
114 114
115static int __init check_nmi_watchdog (void) 115static int __init check_nmi_watchdog (void)
116{ 116{
117 int counts[NR_CPUS]; 117 int *counts;
118 int cpu; 118 int cpu;
119 119
120 if (nmi_watchdog == NMI_NONE) 120 if (nmi_watchdog == NMI_NONE)
@@ -125,6 +125,12 @@ static int __init check_nmi_watchdog (void)
125 return -1; 125 return -1;
126 } 126 }
127 127
128 counts = kmalloc(NR_CPUS * sizeof(int),GFP_KERNEL);
129 if (!counts) {
130 nmi_watchdog = NMI_NONE;
131 return 0;
132 }
133
128 printk(KERN_INFO "Testing NMI watchdog ... "); 134 printk(KERN_INFO "Testing NMI watchdog ... ");
129 135
130 for (cpu = 0; cpu < NR_CPUS; cpu++) 136 for (cpu = 0; cpu < NR_CPUS; cpu++)
@@ -139,6 +145,7 @@ static int __init check_nmi_watchdog (void)
139 cpu_pda[cpu].__nmi_count); 145 cpu_pda[cpu].__nmi_count);
140 nmi_active = 0; 146 nmi_active = 0;
141 lapic_nmi_owner &= ~LAPIC_NMI_WATCHDOG; 147 lapic_nmi_owner &= ~LAPIC_NMI_WATCHDOG;
148 kfree(counts);
142 return -1; 149 return -1;
143 } 150 }
144 } 151 }
@@ -149,6 +156,7 @@ static int __init check_nmi_watchdog (void)
149 if (nmi_watchdog == NMI_LOCAL_APIC) 156 if (nmi_watchdog == NMI_LOCAL_APIC)
150 nmi_hz = 1; 157 nmi_hz = 1;
151 158
159 kfree(counts);
152 return 0; 160 return 0;
153} 161}
154/* Have this called later during boot so counters are updating */ 162/* Have this called later during boot so counters are updating */