Skip to contentSkip to conversation

mm/gup: fix gup_pmd_range() for dax

PATCH New Yu Zhao 1 participant 1 message Jan 11, 2019

Subsystems (2)
lore
Share & tools
lore

Yu Zhao

author
#0 lore raw

PATCH 1/1 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.

---
 mm/gup.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
mm/gup.c +2 -1
index 05acd7e2eb22..75029649baca 100644
@@ -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
Signature · 1 line
2.20.1.97.g81188d93c3-goog