aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKirill A. Shutemov <kirill.shutemov@linux.intel.com>2016-02-17 16:11:12 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2016-02-18 19:23:24 -0500
commit69a8ec2d8155b9121ca2990d43f8363b8e2bf550 (patch)
treec55509679db328ac8456ea5227cbbc405f0abfbe
parent65c23c65bee479faceb042a52f5a7278dfa8d972 (diff)
thp, dax: do not try to withdraw pgtable from non-anon VMA
DAX doesn't deposit pgtables when it maps huge pages: nothing to withdraw. It can lead to crash. Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Cc: Dan Williams <dan.j.williams@intel.com> Cc: Matthew Wilcox <willy@linux.intel.com> Cc: Andrea Arcangeli <aarcange@redhat.com> Cc: Ross Zwisler <ross.zwisler@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--mm/huge_memory.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index 08fc0ba2207e..722546dcfb7e 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -1700,7 +1700,8 @@ bool move_huge_pmd(struct vm_area_struct *vma, struct vm_area_struct *new_vma,
1700 pmd = pmdp_huge_get_and_clear(mm, old_addr, old_pmd); 1700 pmd = pmdp_huge_get_and_clear(mm, old_addr, old_pmd);
1701 VM_BUG_ON(!pmd_none(*new_pmd)); 1701 VM_BUG_ON(!pmd_none(*new_pmd));
1702 1702
1703 if (pmd_move_must_withdraw(new_ptl, old_ptl)) { 1703 if (pmd_move_must_withdraw(new_ptl, old_ptl) &&
1704 vma_is_anonymous(vma)) {
1704 pgtable_t pgtable; 1705 pgtable_t pgtable;
1705 pgtable = pgtable_trans_huge_withdraw(mm, old_pmd); 1706 pgtable = pgtable_trans_huge_withdraw(mm, old_pmd);
1706 pgtable_trans_huge_deposit(mm, new_pmd, pgtable); 1707 pgtable_trans_huge_deposit(mm, new_pmd, pgtable);