diff -urN RC14-rc3-git4-task_thread_info/include/linux/sched.h RC14-rc3-git4-other-helpers/include/linux/sched.h --- RC14-rc3-git4-task_thread_info/include/linux/sched.h 2005-10-04 15:13:54.000000000 -0400 +++ RC14-rc3-git4-other-helpers/include/linux/sched.h 2005-10-04 15:13:55.000000000 -0400 @@ -1183,6 +1183,16 @@ #define task_thread_info(task) (task)->thread_info +static inline void setup_thread_info(struct task_struct *p, struct thread_info *ti) +{ + *ti = *p->thread_info; +} + +static inline unsigned long *end_of_stack(struct task_struct *p) +{ + return (unsigned long *)(p->thread_info + 1); +} + /* set thread flags in other task's structures * - see asm/thread_info.h for TIF_xxxx flags available */ diff -urN RC14-rc3-git4-task_thread_info/kernel/fork.c RC14-rc3-git4-other-helpers/kernel/fork.c --- RC14-rc3-git4-task_thread_info/kernel/fork.c 2005-10-04 15:13:54.000000000 -0400 +++ RC14-rc3-git4-other-helpers/kernel/fork.c 2005-10-04 15:13:55.000000000 -0400 @@ -170,8 +170,8 @@ return NULL; } - *ti = *orig->thread_info; *tsk = *orig; + setup_thread_info(tsk, ti); tsk->thread_info = ti; ti->task = tsk; diff -urN RC14-rc3-git4-task_thread_info/kernel/sched.c RC14-rc3-git4-other-helpers/kernel/sched.c --- RC14-rc3-git4-task_thread_info/kernel/sched.c 2005-10-04 15:13:54.000000000 -0400 +++ RC14-rc3-git4-other-helpers/kernel/sched.c 2005-10-04 15:13:55.000000000 -0400 @@ -4229,10 +4229,10 @@ #endif #ifdef CONFIG_DEBUG_STACK_USAGE { - unsigned long *n = (unsigned long *) (p->thread_info+1); + unsigned long *n = end_of_stack(p); while (!*n) n++; - free = (unsigned long) n - (unsigned long)(p->thread_info+1); + free = (unsigned long) n - (unsigned long) end_of_stack(p); } #endif printk("%5lu %5d %6d ", free, p->pid, p->parent->pid);