Messages in this thread Patch in this message | | | Date | Sun, 12 Oct 2003 18:36:36 -0400 (EDT) | From | Thomas Molina <> | Subject | Re: 2.6.0-test7 DEBUG_PAGEALLOC oops |
| |
On Sun, 12 Oct 2003, Manfred Spraul wrote:
> Could you try the attached patch? > It updates the end of stack detection to handle unaligned stacks.
I've attached a rediff of your patch against test7 bitkeeper. It has the kstack_end function moved up above ASSEMBLY as suggested by Mike. I've tested this version and it works for me (tm). Thanks a bunch. diff -ur linux-2.5-tma/arch/i386/kernel/traps.c linux-2.5-tm/arch/i386/kernel/traps.c --- linux-2.5-tma/arch/i386/kernel/traps.c 2003-10-12 16:16:56.000000000 -0400 +++ linux-2.5-tm/arch/i386/kernel/traps.c 2003-10-12 15:05:48.000000000 -0400 @@ -104,7 +104,7 @@ #ifdef CONFIG_KALLSYMS printk("\n"); #endif - while (((long) stack & (THREAD_SIZE-1)) != 0) { + while (!kstack_end(stack)) { addr = *stack++; if (kernel_text_address(addr)) { printk(" [<%08lx>] ", addr); @@ -138,7 +138,7 @@ stack = esp; for(i = 0; i < kstack_depth_to_print; i++) { - if (((long) stack & (THREAD_SIZE-1)) == 0) + if (kstack_end(stack)) break; if (i && ((i % 8) == 0)) printk("\n "); diff -ur linux-2.5-tma/include/asm-i386/thread_info.h linux-2.5-tm/include/asm-i386/thread_info.h --- linux-2.5-tma/include/asm-i386/thread_info.h 2003-10-12 16:16:28.000000000 -0400 +++ linux-2.5-tm/include/asm-i386/thread_info.h 2003-10-12 15:19:09.000000000 -0400 @@ -92,6 +92,16 @@ #define get_thread_info(ti) get_task_struct((ti)->task) #define put_thread_info(ti) put_task_struct((ti)->task) +static inline int kstack_end(void *addr) +{ + unsigned long offset = (unsigned long)addr & (THREAD_SIZE-1); + + /* Some APM bios versions misalign the stack */ + if (offset == 0 || offset > (THREAD_SIZE-sizeof(void*))) + return 1; + return 0; +} + #else /* !__ASSEMBLY__ */ /* how to get the thread information struct from ASM */ diff -ur linux-2.5-tma/mm/slab.c linux-2.5-tm/mm/slab.c --- linux-2.5-tma/mm/slab.c 2003-10-12 16:24:14.000000000 -0400 +++ linux-2.5-tm/mm/slab.c 2003-10-12 15:05:48.000000000 -0400 @@ -862,7 +862,7 @@ unsigned long *sptr = &caller; unsigned long svalue; - while (((long) sptr & (THREAD_SIZE-1)) != 0) { + while (!kstack_end(sptr)) { svalue = *sptr++; if (kernel_text_address(svalue)) { *addr++=svalue; Only in linux-2.5-tm: stack.patch | |