diff options
author | Yang Shi <[email protected]> | 2018-10-26 15:07:18 -0700 |
---|---|---|
committer | Linus Torvalds <[email protected]> | 2018-10-26 16:26:33 -0700 |
commit | cb4922496ae40a775a1b17025eaa1060e8991253 (patch) | |
tree | 160dc4cafbeb34cc6adefa4504cd588b896fa144 | |
parent | b4cefb36051244bcb5651026d862c332a6cac7df (diff) |
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/[email protected]
Signed-off-by: Yang Shi <[email protected]>
Reviewed-by: Matthew Wilcox <[email protected]>
Acked-by: Kirill A. Shutemov <[email protected]>
Acked-by: Vlastimil Babka <[email protected]>
Cc: Michal Hocko <[email protected]>
Cc: Vlastimil Babka <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r-- | mm/mmap.c | 9 |
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; } } |