* [patch 043/158] mm/rmap.c: use VM_BUG_ON_PAGE() in __page_check_anon_rmap()
@ 2019-12-01 1:51 akpm
0 siblings, 0 replies; only message in thread
From: akpm @ 2019-12-01 1:51 UTC (permalink / raw)
To: akpm, kirill.shutemov, linux-mm, mm-commits, torvalds, yang.shi
From: Yang Shi <yang.shi@linux.alibaba.com>
Subject: mm/rmap.c: use VM_BUG_ON_PAGE() in __page_check_anon_rmap()
The __page_check_anon_rmap() just calls two BUG_ON()s protected by
CONFIG_DEBUG_VM, the #ifdef could be eliminated by using VM_BUG_ON_PAGE().
Link: http://lkml.kernel.org/r/1573157346-111316-1-git-send-email-yang.shi@linux.alibaba.com
Signed-off-by: Yang Shi <yang.shi@linux.alibaba.com>
Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
mm/rmap.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
--- a/mm/rmap.c~mm-rmap-use-vm_bug_on_page-in-__page_check_anon_rmap
+++ a/mm/rmap.c
@@ -1075,7 +1075,6 @@ static void __page_set_anon_rmap(struct
static void __page_check_anon_rmap(struct page *page,
struct vm_area_struct *vma, unsigned long address)
{
-#ifdef CONFIG_DEBUG_VM
/*
* The page's anon-rmap details (mapping and index) are guaranteed to
* be set up correctly at this point.
@@ -1088,9 +1087,9 @@ static void __page_check_anon_rmap(struc
* are initially only visible via the pagetables, and the pte is locked
* over the call to page_add_new_anon_rmap.
*/
- BUG_ON(page_anon_vma(page)->root != vma->anon_vma->root);
- BUG_ON(page_to_pgoff(page) != linear_page_index(vma, address));
-#endif
+ VM_BUG_ON_PAGE(page_anon_vma(page)->root != vma->anon_vma->root, page);
+ VM_BUG_ON_PAGE(page_to_pgoff(page) != linear_page_index(vma, address),
+ page);
}
/**
_
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2019-12-01 1:51 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-01 1:51 [patch 043/158] mm/rmap.c: use VM_BUG_ON_PAGE() in __page_check_anon_rmap() akpm
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).