[PATCH] PPC64 (3/3) Allocate irqstacks only for possible cpus

From: Paul Mackerras
Date: Mon Aug 30 2004 - 00:12:05 EST


With earlier setup of cpu_possible_map the number of irqstacks shrinks
from NR_CPUS to the number of possible cpus.

Signed-off-by: Nathan Lynch <nathanl@xxxxxxxxxxxxxx>
Signed-off-by: Paul Mackerras <paulus@xxxxxxxxx>

diff -urN akpm-29aug/arch/ppc64/kernel/irq.c akpm/arch/ppc64/kernel/irq.c
--- akpm-29aug/arch/ppc64/kernel/irq.c 2004-08-30 10:55:36.000000000 +1000
+++ akpm/arch/ppc64/kernel/irq.c 2004-08-30 15:02:33.104245224 +1000
@@ -929,7 +929,7 @@
struct thread_info *tp;
int i;

- for (i = 0; i < NR_CPUS; i++) {
+ for_each_cpu(i) {
memset((void *)softirq_ctx[i], 0, THREAD_SIZE);
tp = softirq_ctx[i];
tp->cpu = i;
diff -urN akpm-29aug/arch/ppc64/kernel/setup.c akpm/arch/ppc64/kernel/setup.c
--- akpm-29aug/arch/ppc64/kernel/setup.c 2004-08-30 15:02:42.393296512 +1000
+++ akpm/arch/ppc64/kernel/setup.c 2004-08-30 15:02:33.069250544 +1000
@@ -701,7 +701,7 @@
int i;

/* interrupt stacks must be under 256MB, we cannot afford to take SLB misses on them */
- for (i = 0; i < NR_CPUS; i++) {
+ for_each_cpu(i) {
softirq_ctx[i] = (struct thread_info *)__va(lmb_alloc_base(THREAD_SIZE,
THREAD_SIZE, 0x10000000));
hardirq_ctx[i] = (struct thread_info *)__va(lmb_alloc_base(THREAD_SIZE,
-
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/