mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
[PATCH] mm: VM_BUG_ON
Introduce a VM_BUG_ON, which is turned on with CONFIG_DEBUG_VM. Use this in the lightweight, inline refcounting functions; PageLRU and PageActive checks in vmscan, because they're pretty well confined to vmscan. And in page allocate/free fastpaths which can be the hottest parts of the kernel for kbuilds. Unlike BUG_ON, VM_BUG_ON must not be used to execute statements with side-effects, and should not be used outside core mm code. Signed-off-by: Nick Piggin <[email protected]> Cc: Hugh Dickins <[email protected]> Cc: Christoph Lameter <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
a6ca1b99ed
commit
725d704eca
5 changed files with 36 additions and 29 deletions
|
|
@ -24,8 +24,8 @@ static inline void set_page_count(struct page *page, int v)
|
|||
*/
|
||||
static inline void set_page_refcounted(struct page *page)
|
||||
{
|
||||
BUG_ON(PageCompound(page) && page_private(page) != (unsigned long)page);
|
||||
BUG_ON(atomic_read(&page->_count));
|
||||
VM_BUG_ON(PageCompound(page) && page_private(page) != (unsigned long)page);
|
||||
VM_BUG_ON(atomic_read(&page->_count));
|
||||
set_page_count(page, 1);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue