linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] rmap: fix pgoff calculation to handle hugepage correctly
@ 2014-07-01 14:46 Naoya Horiguchi
  2014-07-01 17:42 ` Rik van Riel
  2014-07-01 18:07 ` Kirill A. Shutemov
  0 siblings, 2 replies; 13+ messages in thread
From: Naoya Horiguchi @ 2014-07-01 14:46 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Joonsoo Kim, Hugh Dickins, Rik van Riel, Hillf Danton,
	linux-kernel, linux-mm, Naoya Horiguchi

I triggered VM_BUG_ON() in vma_address() when I try to migrate an anonymous
hugepage with mbind() in the kernel v3.16-rc3. This is because pgoff's
calculation in rmap_walk_anon() fails to consider compound_order() only to
have an incorrect value. So this patch fixes it.

Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
---
 mm/rmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git v3.16-rc3.orig/mm/rmap.c v3.16-rc3/mm/rmap.c
index b7e94ebbd09e..8cc964c6bd8d 100644
--- v3.16-rc3.orig/mm/rmap.c
+++ v3.16-rc3/mm/rmap.c
@@ -1639,7 +1639,7 @@ static struct anon_vma *rmap_walk_anon_lock(struct page *page,
 static int rmap_walk_anon(struct page *page, struct rmap_walk_control *rwc)
 {
 	struct anon_vma *anon_vma;
-	pgoff_t pgoff = page->index << (PAGE_CACHE_SHIFT - PAGE_SHIFT);
+	pgoff_t pgoff = page->index << compound_order(page);
 	struct anon_vma_chain *avc;
 	int ret = SWAP_AGAIN;
 
-- 
1.9.3

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2014-07-29  1:04 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-01 14:46 [PATCH] rmap: fix pgoff calculation to handle hugepage correctly Naoya Horiguchi
2014-07-01 17:42 ` Rik van Riel
2014-07-01 18:07 ` Kirill A. Shutemov
2014-07-01 18:50   ` Naoya Horiguchi
2014-07-01 20:15     ` Kirill A. Shutemov
2014-07-02  4:30       ` Naoya Horiguchi
2014-07-03 11:41         ` Kirill A. Shutemov
2014-07-07 19:39         ` Andrew Morton
2014-07-15 16:41           ` [PATCH -mm] mm: refactor page index/offset getters Naoya Horiguchi
2014-07-23 21:39             ` Andrew Morton
2014-07-23 21:45               ` Naoya Horiguchi
2014-07-28 20:29             ` Johannes Weiner
2014-07-29  0:42               ` Naoya Horiguchi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox