Skip to content
  • Kirill A. Shutemov's avatar
    mm, dax: check for pmd_none() after split_huge_pmd() · 6b9116a6
    Kirill A. Shutemov authored
    
    
    DAX implements split_huge_pmd() by clearing pmd.  This simple approach
    reduces memory overhead, as we don't need to deposit page table on huge
    page mapping to make split_huge_pmd() never-fail.  PTE table can be
    allocated and populated later on page fault from backing store.
    
    But one side effect is that have to check if pmd is pmd_none() after
    split_huge_pmd().  In most places we do this already to deal with
    parallel MADV_DONTNEED.
    
    But I found two call sites which is not affected by MADV_DONTNEED (due
    down_write(mmap_sem)), but need to have the check to work with DAX
    properly.
    
    Signed-off-by: default avatarKirill 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: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    6b9116a6