From: Ingo Molnar Add debug_check_no_locks_freed(), as a central inline to add bad-lock-free-debugging functionality to. Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner Signed-off-by: Arjan van de Ven Signed-off-by: Andrew Morton --- arch/i386/mm/pageattr.c | 4 ++-- include/linux/mm.h | 10 ++++++++-- mm/page_alloc.c | 4 ++-- mm/slab.c | 2 +- 4 files changed, 13 insertions(+), 7 deletions(-) diff -puN arch/i386/mm/pageattr.c~pi-futex-introduce-debug_check_no_locks_freed arch/i386/mm/pageattr.c --- devel/arch/i386/mm/pageattr.c~pi-futex-introduce-debug_check_no_locks_freed 2006-05-19 16:01:32.000000000 -0700 +++ devel-akpm/arch/i386/mm/pageattr.c 2006-05-19 16:01:32.000000000 -0700 @@ -229,8 +229,8 @@ void kernel_map_pages(struct page *page, if (PageHighMem(page)) return; if (!enable) - mutex_debug_check_no_locks_freed(page_address(page), - numpages * PAGE_SIZE); + debug_check_no_locks_freed(page_address(page), + numpages * PAGE_SIZE); /* the return value is ignored - the calls cannot fail, * large pages are disabled at boot time. diff -puN include/linux/mm.h~pi-futex-introduce-debug_check_no_locks_freed include/linux/mm.h --- devel/include/linux/mm.h~pi-futex-introduce-debug_check_no_locks_freed 2006-05-19 16:01:32.000000000 -0700 +++ devel-akpm/include/linux/mm.h 2006-05-19 16:01:32.000000000 -0700 @@ -1072,13 +1072,19 @@ static inline void vm_stat_account(struc } #endif /* CONFIG_PROC_FS */ +static inline void +debug_check_no_locks_freed(const void *from, unsigned long len) +{ + mutex_debug_check_no_locks_freed(from, len); +} + #ifndef CONFIG_DEBUG_PAGEALLOC static inline void kernel_map_pages(struct page *page, int numpages, int enable) { if (!PageHighMem(page) && !enable) - mutex_debug_check_no_locks_freed(page_address(page), - numpages * PAGE_SIZE); + debug_check_no_locks_freed(page_address(page), + numpages * PAGE_SIZE); } #endif diff -puN mm/page_alloc.c~pi-futex-introduce-debug_check_no_locks_freed mm/page_alloc.c --- devel/mm/page_alloc.c~pi-futex-introduce-debug_check_no_locks_freed 2006-05-19 16:01:32.000000000 -0700 +++ devel-akpm/mm/page_alloc.c 2006-05-19 16:01:32.000000000 -0700 @@ -460,8 +460,8 @@ static void __free_pages_ok(struct page arch_free_page(page, order); if (!PageHighMem(page)) - mutex_debug_check_no_locks_freed(page_address(page), - PAGE_SIZE<