1 Index: linux-2.4.21-drop2/arch/x86_64/kernel/smpboot.c
2 ===================================================================
3 --- linux-2.4.21-drop2.orig/arch/x86_64/kernel/smpboot.c 2003-10-28 10:34:20.000000000 -0800
4 +++ linux-2.4.21-drop2/arch/x86_64/kernel/smpboot.c 2004-08-06 06:18:39.000000000 -0700
6 Dprintk("CPU has booted.\n");
9 - if (*((volatile unsigned char *)phys_to_virt(8192))
10 + if (*((volatile unsigned char *)phys_to_virt(THREAD_SIZE))
12 /* trampoline started but...? */
17 /* mark "stuck" area as not stuck */
18 - *((volatile unsigned int *)phys_to_virt(8192)) = 0;
19 + *((volatile unsigned int *)phys_to_virt(THREAD_SIZE)) = 0;
23 Index: linux-2.4.21-drop2/arch/x86_64/kernel/traps.c
24 ===================================================================
25 --- linux-2.4.21-drop2.orig/arch/x86_64/kernel/traps.c 2003-11-06 15:52:41.000000000 -0800
26 +++ linux-2.4.21-drop2/arch/x86_64/kernel/traps.c 2004-08-06 06:18:39.000000000 -0700
28 unsigned long rsp = tsk->thread.rsp;
30 /* User space on another CPU? */
31 - if ((rsp ^ (unsigned long)tsk) & (PAGE_MASK<<1))
32 + if ((rsp ^ (unsigned long)tsk) & ~(THREAD_SIZE - 1))
34 show_trace((unsigned long *)rsp);
36 Index: linux-2.4.21-drop2/arch/x86_64/config.in
37 ===================================================================
38 --- linux-2.4.21-drop2.orig/arch/x86_64/config.in 2003-10-28 10:34:25.000000000 -0800
39 +++ linux-2.4.21-drop2/arch/x86_64/config.in 2004-08-06 06:20:20.000000000 -0700
41 define_bool CONFIG_NUMA y
44 +choice 'Bigger Stack Size Support' \
45 + "off CONFIG_NOBIGSTACK \
46 + 16KB CONFIG_STACK_SIZE_16KB \
47 + 32KB CONFIG_STACK_SIZE_32KB \
48 + 64KB CONFIG_STACK_SIZE_64KB" off
50 +if [ "$CONFIG_NOBIGSTACK" = "y" ]; then
51 + define_int CONFIG_STACK_SIZE_SHIFT 1
53 + if [ "$CONFIG_STACK_SIZE_16KB" = "y" ]; then
54 + define_int CONFIG_STACK_SIZE_SHIFT 2
56 + if [ "$CONFIG_STACK_SIZE_32KB" = "y" ]; then
57 + define_int CONFIG_STACK_SIZE_SHIFT 3
59 + if [ "$CONFIG_STACK_SIZE_64KB" = "y" ]; then
60 + define_int CONFIG_STACK_SIZE_SHIFT 4
68 mainmenu_option next_comment
69 Index: linux-2.4.21-drop2/arch/x86_64/vmlinux.lds
70 ===================================================================
71 --- linux-2.4.21-drop2.orig/arch/x86_64/vmlinux.lds 2003-06-13 07:51:32.000000000 -0700
72 +++ linux-2.4.21-drop2/arch/x86_64/vmlinux.lds 2004-08-06 06:18:39.000000000 -0700
74 .vsyscall_1 ADDR(.vsyscall_0) + 1024: AT (LOADADDR(.vsyscall_0) + 1024) { *(.vsyscall_1) }
75 . = LOADADDR(.vsyscall_0) + 4096;
77 - . = ALIGN(8192); /* init_task */
78 +/* chose the biggest of the possible stack sizes here? */
79 + . = ALIGN(65536); /* init_task */
80 .data.init_task : { *(.data.init_task) }
83 Index: linux-2.4.21-drop2/include/asm-x86_64/current.h
84 ===================================================================
85 --- linux-2.4.21-drop2.orig/include/asm-x86_64/current.h 2003-11-10 16:44:28.000000000 -0800
86 +++ linux-2.4.21-drop2/include/asm-x86_64/current.h 2004-08-06 06:24:33.000000000 -0700
91 +#include <asm/page.h>
93 static inline struct task_struct *get_current(void)
95 Index: linux-2.4.21-drop2/include/asm-x86_64/page.h
96 ===================================================================
97 --- linux-2.4.21-drop2.orig/include/asm-x86_64/page.h 2003-10-28 10:34:00.000000000 -0800
98 +++ linux-2.4.21-drop2/include/asm-x86_64/page.h 2004-08-06 06:24:33.000000000 -0700
100 /* We still hope 8K is enough, but ... */
101 /* Currently it is actually ~6k. This would change when task_struct moves into
103 -#define THREAD_ORDER 1
104 -#define THREAD_SIZE (2*PAGE_SIZE)
105 +#define THREAD_ORDER CONFIG_STACK_SIZE_SHIFT
106 +#define THREAD_SIZE ((1 << CONFIG_STACK_SIZE_SHIFT) * PAGE_SIZE)
108 #define INIT_TASK_SIZE THREAD_SIZE
109 #define CURRENT_MASK (~(THREAD_SIZE-1))
110 Index: linux-2.4.21-drop2/include/asm-x86_64/processor.h
111 ===================================================================
112 --- linux-2.4.21-drop2.orig/include/asm-x86_64/processor.h 2003-11-10 16:44:28.000000000 -0800
113 +++ linux-2.4.21-drop2/include/asm-x86_64/processor.h 2004-08-06 06:24:33.000000000 -0700
115 are already there. When you run out of stack try this first. */
116 #define alloc_task_struct() \
117 ((struct task_struct *) __get_free_pages(GFP_KERNEL,THREAD_ORDER))
118 -#define free_task_struct(p) free_pages((unsigned long) (p), 1)
119 +#define free_task_struct(p) free_pages((unsigned long) (p), THREAD_ORDER)
120 #define get_task_struct(tsk) atomic_inc(&virt_to_page(tsk)->count)
122 #define init_task (init_task_union.task)