[patch 3/3] allocate irqstacks only for possible cpus

Nathan Lynch nathanl at austin.ibm.com
Fri Aug 27 13:16:54 EST 2004


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 at austin.ibm.com>


---


diff -puN arch/ppc64/kernel/setup.c~ppc64-trim-irqstack-allocation arch/ppc64/kernel/setup.c
--- 2.6.9-rc1-bk2/arch/ppc64/kernel/setup.c~ppc64-trim-irqstack-allocation	2004-08-26 21:56:42.000000000 -0500
+++ 2.6.9-rc1-bk2-nathanl/arch/ppc64/kernel/setup.c	2004-08-26 21:56:42.000000000 -0500
@@ -701,7 +701,7 @@ static void __init irqstack_early_init(v
 	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,
diff -puN arch/ppc64/kernel/irq.c~ppc64-trim-irqstack-allocation arch/ppc64/kernel/irq.c
--- 2.6.9-rc1-bk2/arch/ppc64/kernel/irq.c~ppc64-trim-irqstack-allocation	2004-08-26 21:56:42.000000000 -0500
+++ 2.6.9-rc1-bk2-nathanl/arch/ppc64/kernel/irq.c	2004-08-26 21:56:42.000000000 -0500
@@ -978,7 +978,7 @@ void irq_ctx_init(void)
 	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;

_


** Sent via the linuxppc64-dev mail list. See http://lists.linuxppc.org/





More information about the Linuxppc64-dev mailing list