--- arch/x86/Kconfig | 12 ++++++++++++ arch/x86/Kconfig.debug | 11 ----------- arch/x86/kernel/irq_32.c | 8 ++++---- include/asm-x86/irq_32.h | 2 +- include/asm-x86/module.h | 2 +- include/asm-x86/page_64.h | 3 +-- include/asm-x86/thread_info_32.h | 6 +----- include/asm-x86/thread_info_64.h | 3 ++- 8 files changed, 22 insertions(+), 25 deletions(-) Index: linux-2.6.25-mm1/arch/x86/Kconfig =================================================================== --- linux-2.6.25-mm1.orig/arch/x86/Kconfig 2008-04-26 19:00:22.559890684 -0700 +++ linux-2.6.25-mm1/arch/x86/Kconfig 2008-04-26 19:12:11.003375204 -0700 @@ -977,6 +977,18 @@ config ARCH_MEMORY_PROBE def_bool X86_64 depends on MEMORY_HOTPLUG +config THREAD_ORDER + int "Kernel stack order" + default 1 + help + The kernel stack order determines the stack size. 8k (order 1) is + a setting that has been used for years. Stack allocations can use + virtual linear memory if the page allocator is not able to satisfy + request for linear physical memory for the stacks. + The use of kernel stack order of 0 on 32 bit enables IRQ stacks + that are used to compensate for reduced stack space. Order 0 stacks + will never require virtual mappings for the stack. + source "mm/Kconfig" config HIGHPTE Index: linux-2.6.25-mm1/arch/x86/Kconfig.debug =================================================================== --- linux-2.6.25-mm1.orig/arch/x86/Kconfig.debug 2008-04-26 19:00:22.569890420 -0700 +++ linux-2.6.25-mm1/arch/x86/Kconfig.debug 2008-04-26 19:03:14.429890683 -0700 @@ -117,17 +117,6 @@ config DEBUG_NX_TEST and the software setup of this feature. If in doubt, say "N" -config 4KSTACKS - bool "Use 4Kb for kernel stacks instead of 8Kb" - depends on X86_32 - default y - 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 X86_FIND_SMP_CONFIG def_bool y depends on X86_LOCAL_APIC || X86_VOYAGER Index: linux-2.6.25-mm1/arch/x86/kernel/irq_32.c =================================================================== --- linux-2.6.25-mm1.orig/arch/x86/kernel/irq_32.c 2008-04-26 19:00:22.579890946 -0700 +++ linux-2.6.25-mm1/arch/x86/kernel/irq_32.c 2008-04-26 19:03:14.459898972 -0700 @@ -48,7 +48,7 @@ void ack_bad_irq(unsigned int irq) #endif } -#ifdef CONFIG_4KSTACKS +#if CONFIG_STACK_ORDER == 0 /* * per-CPU IRQ handling contexts (thread information and stack) */ @@ -72,7 +72,7 @@ unsigned int do_IRQ(struct pt_regs *regs /* high bit used in ret_from_ code */ int irq = ~regs->orig_ax; struct irq_desc *desc = irq_desc + irq; -#ifdef CONFIG_4KSTACKS +#if CONFIG_STACK_ORDER == 0 union irq_ctx *curctx, *irqctx; u32 *isp; #endif @@ -100,7 +100,7 @@ unsigned int do_IRQ(struct pt_regs *regs } #endif -#ifdef CONFIG_4KSTACKS +#if CONFIG_STACK_ORDER == 0 curctx = (union irq_ctx *) current_thread_info(); irqctx = hardirq_ctx[smp_processor_id()]; @@ -145,7 +145,7 @@ unsigned int do_IRQ(struct pt_regs *regs return 1; } -#ifdef CONFIG_4KSTACKS +#if CONFIG_STACK_ORDER == 0 static char softirq_stack[NR_CPUS * THREAD_SIZE] __attribute__((__section__(".bss.page_aligned"))); Index: linux-2.6.25-mm1/include/asm-x86/irq_32.h =================================================================== --- linux-2.6.25-mm1.orig/include/asm-x86/irq_32.h 2008-04-26 19:00:22.529890780 -0700 +++ linux-2.6.25-mm1/include/asm-x86/irq_32.h 2008-04-26 19:03:14.469899238 -0700 @@ -24,7 +24,7 @@ static inline int irq_canonicalize(int i # define ARCH_HAS_NMI_WATCHDOG /* See include/linux/nmi.h */ #endif -#ifdef CONFIG_4KSTACKS +#if CONFIG_STACK_ORDER == 0 extern void irq_ctx_init(int cpu); extern void irq_ctx_exit(int cpu); # define __ARCH_HAS_DO_SOFTIRQ Index: linux-2.6.25-mm1/include/asm-x86/module.h =================================================================== --- linux-2.6.25-mm1.orig/include/asm-x86/module.h 2008-04-26 19:00:22.539890564 -0700 +++ linux-2.6.25-mm1/include/asm-x86/module.h 2008-04-26 19:03:14.489899331 -0700 @@ -71,7 +71,7 @@ struct mod_arch_specific {}; #endif #ifdef CONFIG_X86_32 -# ifdef CONFIG_4KSTACKS +# if CONFIG_STACK_ORDER == 0 # define MODULE_STACKSIZE "4KSTACKS " # else # define MODULE_STACKSIZE "" Index: linux-2.6.25-mm1/include/asm-x86/page_64.h =================================================================== --- linux-2.6.25-mm1.orig/include/asm-x86/page_64.h 2008-04-26 19:00:22.549890821 -0700 +++ linux-2.6.25-mm1/include/asm-x86/page_64.h 2008-04-26 19:03:14.511149950 -0700 @@ -3,8 +3,7 @@ #define PAGETABLE_LEVELS 4 -#define THREAD_ORDER 1 -#define THREAD_SIZE (PAGE_SIZE << THREAD_ORDER) +#define THREAD_SIZE (PAGE_SIZE << CONFIG_THREAD_ORDER) #define CURRENT_MASK (~(THREAD_SIZE - 1)) #define EXCEPTION_STACK_ORDER 0 Index: linux-2.6.25-mm1/include/asm-x86/thread_info_32.h =================================================================== --- linux-2.6.25-mm1.orig/include/asm-x86/thread_info_32.h 2008-04-26 19:05:41.623639964 -0700 +++ linux-2.6.25-mm1/include/asm-x86/thread_info_32.h 2008-04-26 19:06:47.009913727 -0700 @@ -52,11 +52,7 @@ struct thread_info { #endif #define PREEMPT_ACTIVE 0x10000000 -#ifdef CONFIG_4KSTACKS -#define THREAD_SIZE (4096) -#else -#define THREAD_SIZE (8192) -#endif +#define THREAD_SIZE (PAGE_SIZE << CONFIG_STACK_ORDER2) #define STACK_WARN (THREAD_SIZE/8) /* Index: linux-2.6.25-mm1/include/asm-x86/thread_info_64.h =================================================================== --- linux-2.6.25-mm1.orig/include/asm-x86/thread_info_64.h 2008-04-26 19:06:51.029889683 -0700 +++ linux-2.6.25-mm1/include/asm-x86/thread_info_64.h 2008-04-26 19:07:35.336295716 -0700 @@ -83,7 +83,8 @@ static inline struct thread_info *stack_ #endif #define alloc_thread_info(tsk) \ - ((struct thread_info *)__alloc_vcompound(THREAD_FLAGS, THREAD_ORDER)) + ((struct thread_info *)__alloc_vcompound(THREAD_FLAGS, \ + CONFIG_THREAD_ORDER)) #define free_thread_info(ti) __free_vcompound(ti)