Whamcloud - gitweb
Branch HEAD
[fs/lustre-release.git] / lustre / kernel_patches / patches / configurable-x86_64-2.4.21.patch
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
5 @@ -751,7 +751,7 @@
6                         Dprintk("CPU has booted.\n");
7                 } else {
8                         boot_status = 1;
9 -                       if (*((volatile unsigned char *)phys_to_virt(8192))
10 +                       if (*((volatile unsigned char *)phys_to_virt(THREAD_SIZE))
11                                         == 0xA5)
12                                 /* trampoline started but...? */
13                                 printk("Stuck ??\n");
14 @@ -770,7 +770,7 @@
15         }
16  
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;
20         
21         return cpu; 
22  }
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
27 @@ -239,7 +239,7 @@
28         unsigned long rsp = tsk->thread.rsp;
29  
30         /* User space on another CPU? */
31 -       if ((rsp ^ (unsigned long)tsk) & (PAGE_MASK<<1))
32 +       if ((rsp ^ (unsigned long)tsk) & ~(THREAD_SIZE - 1))
33                 return;
34         show_trace((unsigned long *)rsp);
35  }
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
40 @@ -91,6 +91,28 @@
41     define_bool CONFIG_NUMA y
42  fi
43  
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
49 +
50 +if [ "$CONFIG_NOBIGSTACK" = "y" ]; then
51 +   define_int CONFIG_STACK_SIZE_SHIFT 1
52 +else
53 +  if [ "$CONFIG_STACK_SIZE_16KB" = "y" ]; then
54 +     define_int CONFIG_STACK_SIZE_SHIFT 2
55 +  else
56 +    if [ "$CONFIG_STACK_SIZE_32KB" = "y" ]; then
57 +      define_int CONFIG_STACK_SIZE_SHIFT 3
58 +   else
59 +      if [ "$CONFIG_STACK_SIZE_64KB" = "y" ]; then
60 +        define_int CONFIG_STACK_SIZE_SHIFT 4
61 +      fi
62 +    fi
63 +  fi
64 +fi
65
66  endmenu
67  
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
73 @@ -72,7 +72,8 @@
74    .vsyscall_1 ADDR(.vsyscall_0) + 1024: AT (LOADADDR(.vsyscall_0) + 1024) { *(.vsyscall_1) }
75    . = LOADADDR(.vsyscall_0) + 4096;
76  
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) }
81  
82    . = ALIGN(4096); 
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
87 @@ -5,6 +5,7 @@
88  struct task_struct;
89  
90  #include <asm/pda.h>
91 +#include <asm/page.h>
92  
93  static inline struct task_struct *get_current(void) 
94  { 
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
99 @@ -27,8 +27,8 @@
100  /* We still hope 8K is enough, but ... */
101  /* Currently it is actually ~6k. This would change when task_struct moves into
102     an own slab. */
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)
107  
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
114 @@ -385,7 +385,7 @@
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)
121  
122  #define init_task      (init_task_union.task)