The patch titled Subject: mm: unmap VM_PFNMAP mappings with optimized path has been added to the -mm tree. Its filename is mm-unmap-vm_pfnmap-mappings-with-optimized-path.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/mm-unmap-vm_pfnmap-mappings-with-optimized-path.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/mm-unmap-vm_pfnmap-mappings-with-optimized-path.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Yang Shi <yang.shi@xxxxxxxxxxxxxxxxx> Subject: mm: unmap VM_PFNMAP mappings with optimized path When unmapping VM_PFNMAP mappings, vm flags need to be updated. Since the vmas have been detached, so it sounds safe to update vm flags with read mmap_sem. Link: http://lkml.kernel.org/r/1537376621-51150-4-git-send-email-yang.shi@xxxxxxxxxxxxxxxxx Signed-off-by: Yang Shi <yang.shi@xxxxxxxxxxxxxxxxx> Reviewed-by: Matthew Wilcox <willy@xxxxxxxxxxxxx> Cc: Michal Hocko <mhocko@xxxxxxxxxx> Cc: Vlastimil Babka <vbabka@xxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/mmap.c | 9 --------- 1 file changed, 9 deletions(-) --- a/mm/mmap.c~mm-unmap-vm_pfnmap-mappings-with-optimized-path +++ a/mm/mmap.c @@ -2771,15 +2771,6 @@ static int __do_munmap(struct mm_struct munlock_vma_pages_all(tmp); } - /* - * Unmapping vmas, which have VM_HUGETLB or VM_PFNMAP, - * need get done with write mmap_sem held since they may - * update vm_flags. - */ - if (downgrade && - (tmp->vm_flags & VM_PFNMAP)) - downgrade = false; - tmp = tmp->vm_next; } } _ Patches currently in -mm which might be from yang.shi@xxxxxxxxxxxxxxxxx are mm-mmap-zap-pages-with-read-mmap_sem-in-munmap.patch mm-unmap-vm_hugetlb-mappings-with-optimized-path.patch mm-unmap-vm_pfnmap-mappings-with-optimized-path.patch