aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYang Shi <[email protected]>2018-10-26 15:07:15 -0700
committerLinus Torvalds <[email protected]>2018-10-26 16:26:33 -0700
commitb4cefb36051244bcb5651026d862c332a6cac7df (patch)
treeb8fc64f082c88af99fe03cff7d030f1c91e4103c
parentdd2283f2605e3b3e9c61bcae844b34f2afa4813f (diff)
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/[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.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;