missing bit for thread_info-next-to-task_struct patch
The attached patch is needed to really allow the thread_info to live in the same chunk of memory as task structure. I missed it in my last patch because the fix was originally keyed on INIT_THREAD_SIZE, which was wrong but resulted in a one-liner patch which was easy to miss. The patch below is cleaner. I suppose it would be nice if we could get rid of INIT_THREAD_SIZE entirely, but it looks like user-mode Linux still relies on it.
--david
include/linux/sched.h +7 -3
@@ -504,9 +509,10 @@*/ extern struct exec_domain default_exec_domain; -#ifndef INIT_THREAD_SIZE -# define INIT_THREAD_SIZE 2048*sizeof(long) -#endif +#ifndef __HAVE_ARCH_TASK_STRUCT_ALLOCATOR +# ifndef INIT_THREAD_SIZE +# define INIT_THREAD_SIZE 2048*sizeof(long) +# endif union thread_union { struct thread_info thread_info;
@@ -514,6 +520,9 @@ };extern union thread_union init_thread_union; + +#endif /* !__HAVE_ARCH_TASK_STRUCT_ALLOCATOR */ +extern struct task_struct init_task;extern struct mm_struct init_mm;
include/linux/sched.h line 515
Quoted 12 lines · David Mosberger
+++
b/include/linux/sched.hWed Jun 18 18:01:04 2003include/linux/sched.h +4
-3@@ -504,9 +509,10 @@*/ extern struct exec_domain default_exec_domain; -#ifndef INIT_THREAD_SIZE -# define INIT_THREAD_SIZE 2048*sizeof(long) -#endif +#ifndef __HAVE_ARCH_TASK_STRUCT_ALLOCATOR +# ifndef INIT_THREAD_SIZE +# define INIT_THREAD_SIZE 2048*sizeof(long) +# endif
This looks strange. Either you move the ifndef INIT_THREAD_SIZE outside the other ifdef or maybe remove it comepltly it it's not needed otherwise..
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Christoph Hellwig
Quoted 5 lines · David Mosberger
Quoted 5 lines
+++
b/include/linux/sched.hWed Jun 18 18:01:04 2003include/linux/sched.h +0
-0@@ -504,9 +509,10 @@*/ extern struct exec_domain default_exec_domain;
Quoted 7 lines
include/linux/sched.h line 515
Quoted 7 lines
include/linux/sched.h +4
-3-#ifndef INIT_THREAD_SIZE -# define INIT_THREAD_SIZE 2048*sizeof(long) -#endif +#ifndef __HAVE_ARCH_TASK_STRUCT_ALLOCATOR +# ifndef INIT_THREAD_SIZE +# define INIT_THREAD_SIZE 2048*sizeof(long) +# endif
Christoph> This looks strange. Either you move the ifndef INIT_THREAD_SIZE Christoph> outside the other ifdef or maybe remove it comepltly it it's Christoph> not needed otherwise..
The INIT_THREAD_SIZE cleanup can be done as a separate patch. I don't want to hack (and probably break) UM for no good reason.
--david