Subject: introduce debug_check_no_locks_freed() 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 ---- 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(-) Index: linux-pi-futex.mm.q/arch/i386/mm/pageattr.c =================================================================== --- linux-pi-futex.mm.q.orig/arch/i386/mm/pageattr.c +++ linux-pi-futex.mm.q/arch/i386/mm/pageattr.c @@ -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. Index: linux-pi-futex.mm.q/include/linux/mm.h =================================================================== --- linux-pi-futex.mm.q.orig/include/linux/mm.h +++ linux-pi-futex.mm.q/include/linux/mm.h @@ -1066,13 +1066,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 Index: linux-pi-futex.mm.q/mm/page_alloc.c =================================================================== --- linux-pi-futex.mm.q.orig/mm/page_alloc.c +++ linux-pi-futex.mm.q/mm/page_alloc.c @@ -447,8 +447,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<