mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-11-06 09:33:20 +01:00
mm: thp: avoid false positive VM_BUG_ON_PAGE in page_move_anon_rmap()
If page_move_anon_rmap() is refiling a pmd-splitted THP mapped in a tail
page from a pte, the "address" must be THP aligned in order for the
page->index bugcheck to pass in the CONFIG_DEBUG_VM=y builds.
Link: http://lkml.kernel.org/r/1464253620-106404-1-git-send-email-kirill.shutemov@linux.intel.com
Fixes: 6d0a07edd1 ("mm: thp: calculate the mapcount correctly for THP pages during WP faults")
Signed-off-by: Kirill A. Shutemov <[email protected]>
Reported-by: Mika Westerberg <[email protected]>
Tested-by: Mika Westerberg <[email protected]>
Reviewed-by: Andrea Arcangeli <[email protected]>
Cc: <[email protected]> [4.5]
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
1 parent
e2fe14564d
commit
0798d3c022
1 file changed
+2
@@ -1098,6 +1098,8 @@ void page_move_anon_rmap(struct page *page,
|
||||
|
||||
VM_BUG_ON_PAGE(!PageLocked(page), page);
|
||||
VM_BUG_ON_VMA(!anon_vma, vma);
|
||||
if (IS_ENABLED(CONFIG_DEBUG_VM) && PageTransHuge(page))
|
||||
address &= HPAGE_PMD_MASK;
|
||||
VM_BUG_ON_PAGE(page->index != linear_page_index(vma, address), page);
|
||||
|
||||
anon_vma = (void *) anon_vma + PAGE_MAPPING_ANON;
|
||||
|
||||
Reference in new issue
Block a user