Commit 414fd080 authored by Yu Zhao's avatar Yu Zhao Committed by Linus Torvalds
Browse files

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.


Signed-off-by: default avatarYu Zhao <>
Reviewed-by: default avatarJan Kara <>
Cc: Dan Williams <>
Cc: Huang Ying <>
Cc: Matthew Wilcox <>
Cc: Keith Busch <>
Cc: "Michael S . Tsirkin" <>
Cc: John Hubbard <>
Cc: Wei Yang <>
Cc: Mike Rapoport <>
Cc: Andrea Arcangeli <>
Cc: "Kirill A . Shutemov" <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent a9a238e8
......@@ -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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment