Messages in this thread Patch in this message | | | From | Yang Shi <> | Subject | [RFC v9 PATCH 3/4] mm: unmap VM_HUGETLB mappings with optimized path | Date | Wed, 12 Sep 2018 04:58:12 +0800 |
| |
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 <vbabka@suse.cz> Signed-off-by: Yang Shi <yang.shi@linux.alibaba.com> --- mm/mmap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/mm/mmap.c b/mm/mmap.c index 937d2f2..086f8b5 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -2812,12 +2812,12 @@ static int do_munmap_zap_rlock(struct mm_struct *mm, unsigned long start, } /* - * Unmapping vmas, which have VM_HUGETLB or VM_PFNMAP + * Unmapping vmas, which have VM_PFNMAP * need get done with write mmap_sem held since they may update * vm_flags. Deal with such mappings with regular do_munmap() call. */ for (vma = start_vma; vma && vma->vm_start < end; vma = vma->vm_next) { - if (vma->vm_flags & (VM_HUGETLB | VM_PFNMAP)) + if (vma->vm_flags & VM_PFNMAP) goto regular_path; } -- 1.8.3.1
| |