summaryrefslogtreecommitdiffstats
path: root/mm/mmap.c
diff options
context:
space:
mode:
authorYang Shi <yang.shi@linux.alibaba.com>2018-10-26 15:07:18 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2018-10-26 16:26:33 -0700
commitcb4922496ae40a775a1b17025eaa1060e8991253 (patch)
tree160dc4cafbeb34cc6adefa4504cd588b896fa144 /mm/mmap.c
parentb4cefb36051244bcb5651026d862c332a6cac7df (diff)
downloadlinux-cb4922496ae40a775a1b17025eaa1060e8991253.tar.bz2
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@linux.alibaba.com Signed-off-by: Yang Shi <yang.shi@linux.alibaba.com> Reviewed-by: Matthew Wilcox <willy@infradead.org> Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Acked-by: Vlastimil Babka <vbabka@suse.cz> Cc: Michal Hocko <mhocko@kernel.org> Cc: Vlastimil Babka <vbabka@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/mmap.c')
-rw-r--r--mm/mmap.c9
1 files changed, 0 insertions, 9 deletions
diff --git a/mm/mmap.c b/mm/mmap.c
index ea3188bcc9b4..58e323c92c8e 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -2771,15 +2771,6 @@ static int __do_munmap(struct mm_struct *mm, unsigned long start, size_t len,
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;
}
}