Make 4k stacks permanent --- 25-akpm/arch/i386/Kconfig | 9 -------- 25-akpm/arch/i386/kernel/irq.c | 37 +++++++-------------------------- 25-akpm/include/asm-i386/irq.h | 4 --- 25-akpm/include/asm-i386/module.h | 4 --- 25-akpm/include/asm-i386/thread_info.h | 6 ----- 5 files changed, 9 insertions(+), 51 deletions(-) diff -puN arch/i386/Kconfig~make-4k-stacks-permanent arch/i386/Kconfig --- 25/arch/i386/Kconfig~make-4k-stacks-permanent 2004-05-09 21:48:44.231627368 -0700 +++ 25-akpm/arch/i386/Kconfig 2004-05-09 21:48:44.239626152 -0700 @@ -1476,15 +1476,6 @@ config FRAME_POINTER If you don't debug the kernel, you can say N, but we may not be able to solve problems without frame pointers. -config 4KSTACKS - bool "Use 4Kb for kernel stacks instead of 8Kb" - help - If you say Y here the kernel will use a 4Kb stacksize for the - kernel stack attached to each process/thread. This facilitates - running more threads on a system and also reduces the pressure - on the VM subsystem for higher order allocations. This option - will also use IRQ stacks to compensate for the reduced stackspace. - config SCHEDSTATS bool "Collect scheduler statistics" depends on PROC_FS diff -puN arch/i386/kernel/irq.c~make-4k-stacks-permanent arch/i386/kernel/irq.c --- 25/arch/i386/kernel/irq.c~make-4k-stacks-permanent 2004-05-09 21:48:44.232627216 -0700 +++ 25-akpm/arch/i386/kernel/irq.c 2004-05-09 21:48:44.240626000 -0700 @@ -76,10 +76,8 @@ static void register_irq_proc (unsigned /* * per-CPU IRQ handling stacks */ -#ifdef CONFIG_4KSTACKS union irq_ctx *hardirq_ctx[NR_CPUS]; union irq_ctx *softirq_ctx[NR_CPUS]; -#endif /* * Special irq handlers. @@ -487,8 +485,6 @@ asmlinkage unsigned int do_IRQ(struct pt * useful for irq hardware that does not mask cleanly in an * SMP environment. */ -#ifdef CONFIG_4KSTACKS - for (;;) { irqreturn_t action_ret; u32 *isp; @@ -501,9 +497,10 @@ asmlinkage unsigned int do_IRQ(struct pt spin_unlock(&desc->lock); /* - * this is where we switch to the IRQ stack. However, if we are already using - * the IRQ stack (because we interrupted a hardirq handler) we can't do that - * and just have to keep using the current stack (which is the irq stack already + * this is where we switch to the IRQ stack. However, if we are + * already using the IRQ stack (because we interrupted a + * hardirq handler) we can't do that and just have to keep + * using the current stack (which is the irq stack already * after all) */ @@ -540,23 +537,6 @@ asmlinkage unsigned int do_IRQ(struct pt desc->status &= ~IRQ_PENDING; } -#else - - for (;;) { - irqreturn_t action_ret; - - spin_unlock(&desc->lock); - - action_ret = handle_IRQ_event(irq, ®s, action); - - spin_lock(&desc->lock); - if (!noirqdebug) - note_interrupt(irq, desc, action_ret); - if (likely(!(desc->status & IRQ_PENDING))) - break; - desc->status &= ~IRQ_PENDING; - } -#endif desc->status &= ~IRQ_INPROGRESS; out: @@ -1117,9 +1097,10 @@ void init_irq_proc (void) } -#ifdef CONFIG_4KSTACKS -static char softirq_stack[NR_CPUS * THREAD_SIZE] __attribute__((__aligned__(THREAD_SIZE))); -static char hardirq_stack[NR_CPUS * THREAD_SIZE] __attribute__((__aligned__(THREAD_SIZE))); +static char softirq_stack[NR_CPUS * THREAD_SIZE] + __attribute__((__aligned__(THREAD_SIZE))); +static char hardirq_stack[NR_CPUS * THREAD_SIZE] + __attribute__((__aligned__(THREAD_SIZE))); /* * allocate per-cpu stacks for hardirq and for softirq processing @@ -1189,6 +1170,4 @@ asmlinkage void do_softirq(void) local_irq_restore(flags); } - EXPORT_SYMBOL(do_softirq); -#endif diff -puN include/asm-i386/irq.h~make-4k-stacks-permanent include/asm-i386/irq.h --- 25/include/asm-i386/irq.h~make-4k-stacks-permanent 2004-05-09 21:48:44.233627064 -0700 +++ 25-akpm/include/asm-i386/irq.h 2004-05-09 21:48:44.241625848 -0700 @@ -31,7 +31,6 @@ extern int can_request_irq(unsigned int, #define ARCH_HAS_NMI_WATCHDOG /* See include/linux/nmi.h */ #endif -#ifdef CONFIG_4KSTACKS /* * per-CPU IRQ handling contexts (thread information and stack) */ @@ -46,9 +45,6 @@ extern union irq_ctx *softirq_ctx[NR_CPU extern void irq_ctx_init(int cpu); #define __ARCH_HAS_DO_SOFTIRQ -#else -#define irq_ctx_init(cpu) do { ; } while (0) -#endif struct irqaction; struct pt_regs; diff -puN include/asm-i386/thread_info.h~make-4k-stacks-permanent include/asm-i386/thread_info.h --- 25/include/asm-i386/thread_info.h~make-4k-stacks-permanent 2004-05-09 21:48:44.235626760 -0700 +++ 25-akpm/include/asm-i386/thread_info.h 2004-05-09 21:48:44.241625848 -0700 @@ -60,13 +60,9 @@ struct thread_info { #endif #define PREEMPT_ACTIVE 0x4000000 -#ifdef CONFIG_4KSTACKS #define THREAD_SIZE (4096) -#else -#define THREAD_SIZE (8192) -#endif - #define STACK_WARN (THREAD_SIZE/8) + /* * macros/functions for gaining access to the thread information structure * diff -puN include/asm-i386/module.h~make-4k-stacks-permanent include/asm-i386/module.h --- 25/include/asm-i386/module.h~make-4k-stacks-permanent 2004-05-09 21:48:45.806387968 -0700 +++ 25-akpm/include/asm-i386/module.h 2004-05-09 21:48:45.808387664 -0700 @@ -60,11 +60,7 @@ struct mod_arch_specific #define MODULE_REGPARM "" #endif -#ifdef CONFIG_4KSTACKS #define MODULE_STACKSIZE "4KSTACKS " -#else -#define MODULE_STACKSIZE "" -#endif #define MODULE_ARCH_VERMAGIC MODULE_PROC_FAMILY MODULE_REGPARM MODULE_STACKSIZE _