summaryrefslogtreecommitdiffstats
path: root/mm/hugetlb.c
diff options
context:
space:
mode:
authorAnshuman Khandual <khandual@linux.vnet.ibm.com>2017-07-06 15:38:50 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2017-07-06 16:24:33 -0700
commitfaaa5b62d3f7907e217b179556038f9f8e157ee0 (patch)
treecfbe5a1a2bac22c215bbb2599330017cfdac1916 /mm/hugetlb.c
parentd5ed7444dafb94b6877410d1b66a846eb7184a09 (diff)
downloadlinux-faaa5b62d3f7907e217b179556038f9f8e157ee0.tar.gz
linux-faaa5b62d3f7907e217b179556038f9f8e157ee0.tar.bz2
linux-faaa5b62d3f7907e217b179556038f9f8e157ee0.zip
mm/follow_page_mask: add support for hugetlb pgd entries
ppc64 supports pgd hugetlb entries. Add code to handle hugetlb pgd entries to follow_page_mask so that ppc64 can switch to it to handle hugetlbe entries. Link: http://lkml.kernel.org/r/1494926612-23928-5-git-send-email-aneesh.kumar@linux.vnet.ibm.com Signed-off-by: Anshuman Khandual <khandual@linux.vnet.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Mike Kravetz <kravetz@us.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/hugetlb.c')
-rw-r--r--mm/hugetlb.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 65c84414a6b7..a446869aa7f1 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -4715,6 +4715,15 @@ follow_huge_pud(struct mm_struct *mm, unsigned long address,
return pte_page(*(pte_t *)pud) + ((address & ~PUD_MASK) >> PAGE_SHIFT);
}
+struct page * __weak
+follow_huge_pgd(struct mm_struct *mm, unsigned long address, pgd_t *pgd, int flags)
+{
+ if (flags & FOLL_GET)
+ return NULL;
+
+ return pte_page(*(pte_t *)pgd) + ((address & ~PGDIR_MASK) >> PAGE_SHIFT);
+}
+
#ifdef CONFIG_MEMORY_FAILURE
/*