Thread (24 messages) 24 messages, 7 authors, 2018-08-23
STALE2873d
Revisions (4)
  1. v3 [diff vs current]
  2. v7 [diff vs current]
  3. v8 current
  4. v9 [diff vs current]

[RFC v8 PATCH 4/5] mm: unmap VM_HUGETLB mappings with optimized path

From: Yang Shi <hidden>
Date: 2018-08-15 18:50:47
Also in: lkml
Subsystem: memory management, memory mapping, the rest · Maintainers: Andrew Morton, Liam R. Howlett, Lorenzo Stoakes, Linus Torvalds

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.

Cc: Michal Hocko <mhocko@kernel.org>
Cc: Vlastimil Babka <redacted>
Signed-off-by: Yang Shi <redacted>
---
 mm/mmap.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/mm/mmap.c b/mm/mmap.c
index e92f680..3b9f734 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -2812,7 +2812,6 @@ static int do_munmap_zap_rlock(struct mm_struct *mm, unsigned long start,
 
 	/*
 	 * Unmapping vmas, which have:
-	 *   VM_HUGETLB or
 	 *   VM_PFNMAP or
 	 *   uprobes
 	 * need get done with write mmap_sem held since they may update
@@ -2821,7 +2820,7 @@ static int do_munmap_zap_rlock(struct mm_struct *mm, unsigned long start,
 	for (vma = start_vma; vma && vma->vm_start < end; vma = vma->vm_next) {
 		if ((vma->vm_file &&
 		    has_uprobes(vma, vma->vm_start, vma->vm_end)) ||
-		    (vma->vm_flags & (VM_HUGETLB | VM_PFNMAP)))
+		    (vma->vm_flags & VM_PFNMAP))
 			goto regular_path;
 	}
 
-- 
1.8.3.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help