path: root/mm/page_vma_mapped.c
diff options
authorPunit Agrawal <>2017-07-06 15:39:42 -0700
committerLinus Torvalds <>2017-07-06 16:24:34 -0700
commit7868a2087ec13ec4a5df0c5e00999863be132ba8 (patch)
treeae49686ff18e3e90cb644c22a4fb92d0f8bd0e2a /mm/page_vma_mapped.c
parentd63206ee32b6e64b0e12d46e5d6004afd9913713 (diff)
mm/hugetlb: add size parameter to huge_pte_offset()
A poisoned or migrated hugepage is stored as a swap entry in the page tables. On architectures that support hugepages consisting of contiguous page table entries (such as on arm64) this leads to ambiguity in determining the page table entry to return in huge_pte_offset() when a poisoned entry is encountered. Let's remove the ambiguity by adding a size parameter to convey additional information about the requested address. Also fixup the definition/usage of huge_pte_offset() throughout the tree. Link: Signed-off-by: Punit Agrawal <> Acked-by: Steve Capper <> Cc: Catalin Marinas <> Cc: Will Deacon <> Cc: Tony Luck <> Cc: Fenghua Yu <> Cc: James Hogan <> (odd fixer:METAG ARCHITECTURE) Cc: Ralf Baechle <> (supporter:MIPS) Cc: "James E.J. Bottomley" <> Cc: Helge Deller <> Cc: Benjamin Herrenschmidt <> Cc: Paul Mackerras <> Cc: Michael Ellerman <> Cc: Martin Schwidefsky <> Cc: Heiko Carstens <> Cc: Yoshinori Sato <> Cc: Rich Felker <> Cc: "David S. Miller" <> Cc: Chris Metcalf <> Cc: Thomas Gleixner <> Cc: Ingo Molnar <> Cc: "H. Peter Anvin" <> Cc: Alexander Viro <> Cc: Michal Hocko <> Cc: Mike Kravetz <> Cc: Naoya Horiguchi <> Cc: "Aneesh Kumar K.V" <> Cc: "Kirill A. Shutemov" <> Cc: Hillf Danton <> Cc: Mark Rutland <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
Diffstat (limited to 'mm/page_vma_mapped.c')
1 files changed, 2 insertions, 1 deletions
diff --git a/mm/page_vma_mapped.c b/mm/page_vma_mapped.c
index de9c40d7304a..8ec6ba230bb9 100644
--- a/mm/page_vma_mapped.c
+++ b/mm/page_vma_mapped.c
@@ -116,7 +116,8 @@ bool page_vma_mapped_walk(struct page_vma_mapped_walk *pvmw)
if (unlikely(PageHuge(pvmw->page))) {
/* when pud is not present, pte will be NULL */
- pvmw->pte = huge_pte_offset(mm, pvmw->address);
+ pvmw->pte = huge_pte_offset(mm, pvmw->address,
+ PAGE_SIZE << compound_order(page));
if (!pvmw->pte)
return false;