aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYu Zhao <[email protected]>2019-02-12 15:35:58 -0800
committerLinus Torvalds <[email protected]>2019-02-12 16:33:18 -0800
commit414fd080d125408cb15d04ff4907e1dd8145c8c7 (patch)
treeaf0d71838b5392eb11d670745ee1624c1e166af5
parenta9a238e83fbb0df31c3b9b67003f8f9d1d1b6c96 (diff)
mm/gup: fix gup_pmd_range() for dax
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/[email protected] Signed-off-by: Yu Zhao <[email protected]> Reviewed-by: Jan Kara <[email protected]> Cc: Dan Williams <[email protected]> Cc: Huang Ying <[email protected]> Cc: Matthew Wilcox <[email protected]> Cc: Keith Busch <[email protected]> Cc: "Michael S . Tsirkin" <[email protected]> Cc: John Hubbard <[email protected]> Cc: Wei Yang <[email protected]> Cc: Mike Rapoport <[email protected]> Cc: Andrea Arcangeli <[email protected]> Cc: "Kirill A . Shutemov" <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r--mm/gup.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/mm/gup.c b/mm/gup.c
index 05acd7e2eb22..75029649baca 100644
--- a/mm/gup.c
+++ b/mm/gup.c
@@ -1674,7 +1674,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