Index: linux-2.4.21-drop2/arch/x86_64/kernel/smpboot.c =================================================================== --- linux-2.4.21-drop2.orig/arch/x86_64/kernel/smpboot.c 2003-10-28 10:34:20.000000000 -0800 +++ linux-2.4.21-drop2/arch/x86_64/kernel/smpboot.c 2004-08-06 06:18:39.000000000 -0700 @@ -751,7 +751,7 @@ Dprintk("CPU has booted.\n"); } else { boot_status = 1; - if (*((volatile unsigned char *)phys_to_virt(8192)) + if (*((volatile unsigned char *)phys_to_virt(THREAD_SIZE)) == 0xA5) /* trampoline started but...? */ printk("Stuck ??\n"); @@ -770,7 +770,7 @@ } /* mark "stuck" area as not stuck */ - *((volatile unsigned int *)phys_to_virt(8192)) = 0; + *((volatile unsigned int *)phys_to_virt(THREAD_SIZE)) = 0; return cpu; } Index: linux-2.4.21-drop2/arch/x86_64/kernel/traps.c =================================================================== --- linux-2.4.21-drop2.orig/arch/x86_64/kernel/traps.c 2003-11-06 15:52:41.000000000 -0800 +++ linux-2.4.21-drop2/arch/x86_64/kernel/traps.c 2004-08-06 06:18:39.000000000 -0700 @@ -239,7 +239,7 @@ unsigned long rsp = tsk->thread.rsp; /* User space on another CPU? */ - if ((rsp ^ (unsigned long)tsk) & (PAGE_MASK<<1)) + if ((rsp ^ (unsigned long)tsk) & ~(THREAD_SIZE - 1)) return; show_trace((unsigned long *)rsp); } Index: linux-2.4.21-drop2/arch/x86_64/config.in =================================================================== --- linux-2.4.21-drop2.orig/arch/x86_64/config.in 2003-10-28 10:34:25.000000000 -0800 +++ linux-2.4.21-drop2/arch/x86_64/config.in 2004-08-06 06:20:20.000000000 -0700 @@ -91,6 +91,28 @@ define_bool CONFIG_NUMA y fi +choice 'Bigger Stack Size Support' \ + "off CONFIG_NOBIGSTACK \ + 16KB CONFIG_STACK_SIZE_16KB \ + 32KB CONFIG_STACK_SIZE_32KB \ + 64KB CONFIG_STACK_SIZE_64KB" off + +if [ "$CONFIG_NOBIGSTACK" = "y" ]; then + define_int CONFIG_STACK_SIZE_SHIFT 1 +else + if [ "$CONFIG_STACK_SIZE_16KB" = "y" ]; then + define_int CONFIG_STACK_SIZE_SHIFT 2 + else + if [ "$CONFIG_STACK_SIZE_32KB" = "y" ]; then + define_int CONFIG_STACK_SIZE_SHIFT 3 + else + if [ "$CONFIG_STACK_SIZE_64KB" = "y" ]; then + define_int CONFIG_STACK_SIZE_SHIFT 4 + fi + fi + fi +fi + endmenu mainmenu_option next_comment Index: linux-2.4.21-drop2/arch/x86_64/vmlinux.lds =================================================================== --- linux-2.4.21-drop2.orig/arch/x86_64/vmlinux.lds 2003-06-13 07:51:32.000000000 -0700 +++ linux-2.4.21-drop2/arch/x86_64/vmlinux.lds 2004-08-06 06:18:39.000000000 -0700 @@ -72,7 +72,8 @@ .vsyscall_1 ADDR(.vsyscall_0) + 1024: AT (LOADADDR(.vsyscall_0) + 1024) { *(.vsyscall_1) } . = LOADADDR(.vsyscall_0) + 4096; - . = ALIGN(8192); /* init_task */ +/* chose the biggest of the possible stack sizes here? */ + . = ALIGN(65536); /* init_task */ .data.init_task : { *(.data.init_task) } . = ALIGN(4096); Index: linux-2.4.21-drop2/include/asm-x86_64/current.h =================================================================== --- linux-2.4.21-drop2.orig/include/asm-x86_64/current.h 2003-11-10 16:44:28.000000000 -0800 +++ linux-2.4.21-drop2/include/asm-x86_64/current.h 2004-08-06 06:24:33.000000000 -0700 @@ -5,6 +5,7 @@ struct task_struct; #include +#include static inline struct task_struct *get_current(void) { Index: linux-2.4.21-drop2/include/asm-x86_64/page.h =================================================================== --- linux-2.4.21-drop2.orig/include/asm-x86_64/page.h 2003-10-28 10:34:00.000000000 -0800 +++ linux-2.4.21-drop2/include/asm-x86_64/page.h 2004-08-06 06:24:33.000000000 -0700 @@ -27,8 +27,8 @@ /* We still hope 8K is enough, but ... */ /* Currently it is actually ~6k. This would change when task_struct moves into an own slab. */ -#define THREAD_ORDER 1 -#define THREAD_SIZE (2*PAGE_SIZE) +#define THREAD_ORDER CONFIG_STACK_SIZE_SHIFT +#define THREAD_SIZE ((1 << CONFIG_STACK_SIZE_SHIFT) * PAGE_SIZE) #define INIT_TASK_SIZE THREAD_SIZE #define CURRENT_MASK (~(THREAD_SIZE-1)) Index: linux-2.4.21-drop2/include/asm-x86_64/processor.h =================================================================== --- linux-2.4.21-drop2.orig/include/asm-x86_64/processor.h 2003-11-10 16:44:28.000000000 -0800 +++ linux-2.4.21-drop2/include/asm-x86_64/processor.h 2004-08-06 06:24:33.000000000 -0700 @@ -385,7 +385,7 @@ are already there. When you run out of stack try this first. */ #define alloc_task_struct() \ ((struct task_struct *) __get_free_pages(GFP_KERNEL,THREAD_ORDER)) -#define free_task_struct(p) free_pages((unsigned long) (p), 1) +#define free_task_struct(p) free_pages((unsigned long) (p), THREAD_ORDER) #define get_task_struct(tsk) atomic_inc(&virt_to_page(tsk)->count) #define init_task (init_task_union.task)