path: root/mm/pgtable-generic.c
diff options
authorDan Williams <>2016-01-15 16:56:52 -0800
committerLinus Torvalds <>2016-01-15 17:56:32 -0800
commit5c7fb56e5e3f7035dd798a8e1adee639f87043e5 (patch)
treee3419de32c4b42c918267a50120549cbec2ed63f /mm/pgtable-generic.c
parent5c2c2587b13235bf8b5c9027589f22eff68bdf49 (diff)
mm, dax: dax-pmd vs thp-pmd vs hugetlbfs-pmd
A dax-huge-page mapping while it uses some thp helpers is ultimately not a transparent huge page. The distinction is especially important in the get_user_pages() path. pmd_devmap() is used to distinguish dax-pmds from pmd_huge() and pmd_trans_huge() which have slightly different semantics. Explicitly mark the pmd_trans_huge() helpers that dax needs by adding pmd_devmap() checks. [ fix regression in handling mlocked pages in __split_huge_pmd()] Signed-off-by: Dan Williams <> Cc: Dave Hansen <> Cc: Mel Gorman <> Cc: Peter Zijlstra <> Cc: Andrea Arcangeli <> Cc: Matthew Wilcox <> Signed-off-by: Kirill A. Shutemov <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
Diffstat (limited to 'mm/pgtable-generic.c')
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/pgtable-generic.c b/mm/pgtable-generic.c
index c311a2ec6fea..9d4767698a1c 100644
--- a/mm/pgtable-generic.c
+++ b/mm/pgtable-generic.c
@@ -132,7 +132,7 @@ pmd_t pmdp_huge_clear_flush(struct vm_area_struct *vma, unsigned long address,
pmd_t pmd;
- VM_BUG_ON(!pmd_trans_huge(*pmdp));
+ VM_BUG_ON(!pmd_trans_huge(*pmdp) && !pmd_devmap(*pmdp));
pmd = pmdp_huge_get_and_clear(vma->vm_mm, address, pmdp);
flush_pmd_tlb_range(vma, address, address + HPAGE_PMD_SIZE);
return pmd;