From: Oliver O'Halloran Date: Wed, 6 Sep 2017 23:20:58 +0000 (-0700) Subject: mm/gup: make __gup_device_* require THP X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=09180ca4b3bc7b1ffdbae62a75f716dfc0685861;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git mm/gup: make __gup_device_* require THP These functions are the only bits of generic code that use {pud,pmd}_pfn() without checking for CONFIG_TRANSPARENT_HUGEPAGE. This works fine on x86, the only arch with devmap support, since the *_pfn() functions are always defined there, but this isn't true for every architecture. Link: http://lkml.kernel.org/r/20170626063833.11094-1-oohall@gmail.com Signed-off-by: Oliver O'Halloran Cc: Kirill A. Shutemov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/gup.c b/mm/gup.c index 23f01c40c88f..33d651deeae2 100644 --- a/mm/gup.c +++ b/mm/gup.c @@ -1352,7 +1352,7 @@ static int gup_pte_range(pmd_t pmd, unsigned long addr, unsigned long end, } #endif /* __HAVE_ARCH_PTE_SPECIAL */ -#ifdef __HAVE_ARCH_PTE_DEVMAP +#if defined(__HAVE_ARCH_PTE_DEVMAP) && defined(CONFIG_TRANSPARENT_HUGEPAGE) static int __gup_device_huge(unsigned long pfn, unsigned long addr, unsigned long end, struct page **pages, int *nr) {