summaryrefslogtreecommitdiff
path: root/mm/mmap.c
diff options
context:
space:
mode:
authorYang Shi <yang.shi@linux.alibaba.com>2018-10-27 01:07:15 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2018-10-27 02:26:33 +0300
commitb4cefb36051244bcb5651026d862c332a6cac7df (patch)
treeb8fc64f082c88af99fe03cff7d030f1c91e4103c /mm/mmap.c
parentdd2283f2605e3b3e9c61bcae844b34f2afa4813f (diff)
downloadlinux-b4cefb36051244bcb5651026d862c332a6cac7df.tar.xz
mm: unmap VM_HUGETLB mappings with optimized path
When unmapping VM_HUGETLB 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-3-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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/mmap.c b/mm/mmap.c
index 330f12c17fa1..ea3188bcc9b4 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -2777,7 +2777,7 @@ static int __do_munmap(struct mm_struct *mm, unsigned long start, size_t len,
* update vm_flags.
*/
if (downgrade &&
- (tmp->vm_flags & (VM_HUGETLB | VM_PFNMAP)))
+ (tmp->vm_flags & VM_PFNMAP))
downgrade = false;
tmp = tmp->vm_next;