From: clameter@sgi.com Make the stack size configurable necessary. SGI NUMA configurations may need more stack because cpumasks and nodemasks are at times kept on the stack. This patch allows to run with 16k or 32k kernel stacks. Signed-off-by: Christoph Lameter Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Andi Kleen Cc: Mike Travis Signed-off-by: Andrew Morton --- arch/x86/Kconfig.x86_64 | 6 ++++++ include/asm-x86/page_64.h | 3 +-- include/asm-x86/thread_info_64.h | 4 ++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff -puN arch/x86/Kconfig.x86_64~x86_64-configure-stack-size arch/x86/Kconfig.x86_64 --- a/arch/x86/Kconfig.x86_64~x86_64-configure-stack-size +++ a/arch/x86/Kconfig.x86_64 @@ -370,6 +370,12 @@ config NODES_SHIFT default "6" depends on NEED_MULTIPLE_NODES +config THREAD_ORDER + int "Kernel stack size (in page order)" + default "1" + help + Page order for the thread stack. + # Dummy CONFIG option to select ACPI_NUMA from drivers/acpi/Kconfig. config X86_64_ACPI_NUMA diff -puN include/asm-x86/page_64.h~x86_64-configure-stack-size include/asm-x86/page_64.h --- a/include/asm-x86/page_64.h~x86_64-configure-stack-size +++ a/include/asm-x86/page_64.h @@ -9,8 +9,7 @@ #define PAGE_MASK (~(PAGE_SIZE-1)) #define PHYSICAL_PAGE_MASK (~(PAGE_SIZE-1) & __PHYSICAL_MASK) -#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 diff -puN include/asm-x86/thread_info_64.h~x86_64-configure-stack-size include/asm-x86/thread_info_64.h --- a/include/asm-x86/thread_info_64.h~x86_64-configure-stack-size +++ a/include/asm-x86/thread_info_64.h @@ -80,9 +80,9 @@ static inline struct thread_info *stack_ #endif #define alloc_thread_info(tsk) \ - ((struct thread_info *) __get_free_pages(THREAD_FLAGS, THREAD_ORDER)) + ((struct thread_info *) __get_free_pages(THREAD_FLAGS, CONFIG_THREAD_ORDER)) -#define free_thread_info(ti) free_pages((unsigned long) (ti), THREAD_ORDER) +#define free_thread_info(ti) free_pages((unsigned long) (ti), CONFIG_THREAD_ORDER) #else /* !__ASSEMBLY__ */ _