These are debugging patches on-top of -mm that makes it possible for those arches that want to be able to to save caller traces of who allocates pages and slab objects. Any arch that wants to use this could make a next_stack_func function that goes through the stack starting at *prev_addr and finds the next function return address. 'count' is for when we can use the frame pointer (CONFIG_FRAME_POINTER) to get accurate backtraces. For x86 it goes like: unsigned long *next_stack_func(unsigned long *prev_addr, int count) { struct thread_info *tinfo = current_thread_info(); if (!prev_addr) return NULL; #ifdef CONFIG_FRAME_POINTER /* In this case 'prev_addr' is a pointer to the last return * function found on the stack */ if (count == 0) { unsigned long ebp; unsigned long *func_ptr; asm ("movl %%ebp, %0" : "=r" (ebp) : ); /* We don't want the obvious caller to show up */ ebp = *(unsigned long *) ebp; func_ptr = (unsigned long *)(ebp + 4); if (valid_stack_ptr(tinfo, func_ptr)) return func_ptr; } else { unsigned long *func_ptr; unsigned long ebp = (unsigned long) prev_addr; ebp -= 4; ebp = *(unsigned long *) ebp; func_ptr = (unsigned long *) ((unsigned long)ebp + 4); if (valid_stack_ptr(tinfo, func_ptr)) return func_ptr; } #else while (prev_addr++) { if (!valid_stack_ptr(tinfo, prev_addr)) break; if (__kernel_text_address(*prev_addr)) return prev_addr; } #endif return NULL; } 1) A "generic" next_stack_func() for arches that want to have these debugging facilities 2) Saving more slab object call traces via DBG_DEBUGWORDS. Now uses next_stack_func(). This still prints to the console, oh well... (I have not made SLAB_DEBUG conditional on x86 so it won't compile on non-x86 arches with these patches currently...) 3) Simplification of the page-owner-leak-detector to use next_stack_func() so that any arch that wants it can use it.