4.19-stable review patch.  If anyone has any objections, please let me know.

------------------

[ Upstream commit 414fd080d125408cb15d04ff4907e1dd8145c8c7 ]

For dax pmd, pmd_trans_huge() returns false but pmd_huge() returns true
on x86.  So the function works as long as hugetlb is configured.
However, dax doesn't depend on hugetlb.

Link: http://lkml.kernel.org/r/20190111034033.601-1-yuz...@google.com
Signed-off-by: Yu Zhao <yuz...@google.com>
Reviewed-by: Jan Kara <j...@suse.cz>
Cc: Dan Williams <dan.j.willi...@intel.com>
Cc: Huang Ying <ying.hu...@intel.com>
Cc: Matthew Wilcox <wi...@infradead.org>
Cc: Keith Busch <keith.bu...@intel.com>
Cc: "Michael S . Tsirkin" <m...@redhat.com>
Cc: John Hubbard <jhubb...@nvidia.com>
Cc: Wei Yang <richard.weiy...@gmail.com>
Cc: Mike Rapoport <r...@linux.ibm.com>
Cc: Andrea Arcangeli <aarca...@redhat.com>
Cc: "Kirill A . Shutemov" <kirill.shute...@linux.intel.com>
Signed-off-by: Andrew Morton <a...@linux-foundation.org>
Signed-off-by: Linus Torvalds <torva...@linux-foundation.org>
Signed-off-by: Sasha Levin <sas...@kernel.org>
---
 mm/gup.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/mm/gup.c b/mm/gup.c
index 1abc8b4afff6..0a5374e6e82d 100644
--- a/mm/gup.c
+++ b/mm/gup.c
@@ -1649,7 +1649,8 @@ static int gup_pmd_range(pud_t pud, unsigned long addr, 
unsigned long end,
                if (!pmd_present(pmd))
                        return 0;
 
-               if (unlikely(pmd_trans_huge(pmd) || pmd_huge(pmd))) {
+               if (unlikely(pmd_trans_huge(pmd) || pmd_huge(pmd) ||
+                            pmd_devmap(pmd))) {
                        /*
                         * NUMA hinting faults need to be handled in the GUP
                         * slowpath for accounting purposes and so that they
-- 
2.19.1



Reply via email to