Commit f9b8404c authored by Ingo Molnar's avatar Ingo Molnar Committed by Linus Torvalds

[PATCH] pi-futex: 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: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarArjan van de Ven <arjan@linux.intel.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 6abdce76
...@@ -229,7 +229,7 @@ void kernel_map_pages(struct page *page, int numpages, int enable) ...@@ -229,7 +229,7 @@ void kernel_map_pages(struct page *page, int numpages, int enable)
if (PageHighMem(page)) if (PageHighMem(page))
return; return;
if (!enable) if (!enable)
mutex_debug_check_no_locks_freed(page_address(page), debug_check_no_locks_freed(page_address(page),
numpages * PAGE_SIZE); numpages * PAGE_SIZE);
/* the return value is ignored - the calls cannot fail, /* the return value is ignored - the calls cannot fail,
......
...@@ -1030,12 +1030,18 @@ static inline void vm_stat_account(struct mm_struct *mm, ...@@ -1030,12 +1030,18 @@ static inline void vm_stat_account(struct mm_struct *mm,
} }
#endif /* CONFIG_PROC_FS */ #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 #ifndef CONFIG_DEBUG_PAGEALLOC
static inline void static inline void
kernel_map_pages(struct page *page, int numpages, int enable) kernel_map_pages(struct page *page, int numpages, int enable)
{ {
if (!PageHighMem(page) && !enable) if (!PageHighMem(page) && !enable)
mutex_debug_check_no_locks_freed(page_address(page), debug_check_no_locks_freed(page_address(page),
numpages * PAGE_SIZE); numpages * PAGE_SIZE);
} }
#endif #endif
......
...@@ -446,7 +446,7 @@ static void __free_pages_ok(struct page *page, unsigned int order) ...@@ -446,7 +446,7 @@ static void __free_pages_ok(struct page *page, unsigned int order)
arch_free_page(page, order); arch_free_page(page, order);
if (!PageHighMem(page)) if (!PageHighMem(page))
mutex_debug_check_no_locks_freed(page_address(page), debug_check_no_locks_freed(page_address(page),
PAGE_SIZE<<order); PAGE_SIZE<<order);
for (i = 0 ; i < (1 << order) ; ++i) for (i = 0 ; i < (1 << order) ; ++i)
......
...@@ -3397,7 +3397,7 @@ void kfree(const void *objp) ...@@ -3397,7 +3397,7 @@ void kfree(const void *objp)
local_irq_save(flags); local_irq_save(flags);
kfree_debugcheck(objp); kfree_debugcheck(objp);
c = virt_to_cache(objp); c = virt_to_cache(objp);
mutex_debug_check_no_locks_freed(objp, obj_size(c)); debug_check_no_locks_freed(objp, obj_size(c));
__cache_free(c, (void *)objp); __cache_free(c, (void *)objp);
local_irq_restore(flags); local_irq_restore(flags);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment