From d668459cfdb598f97cda043359ca2fa94100bcad Mon Sep 17 00:00:00 2001 From: Suren Baghdasaryan Date: Wed, 1 Mar 2023 11:04:57 -0800 Subject: [PATCH] mm/nommu: remove unnecessary VMA locking Since CONFIG_PER_VMA_LOCK depends on CONFIG_MMU, the changes in nommu are not needed. Remove them. Link: https://lkml.kernel.org/r/20230301190457.1498985-1-surenb@google.com Fixes: bad94decd6a4 ("mm: write-lock VMAs before removing them from VMA tree") Signed-off-by: Suren Baghdasaryan Reported-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Link: https://lore.kernel.org/all/Y%2F8CJQGNuMUTdLwP@localhost/ Reviewed-by: David Hildenbrand Signed-off-by: Andrew Morton --- mm/nommu.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/mm/nommu.c b/mm/nommu.c index 2ab162d773e2..57ba243c6a37 100644 --- a/mm/nommu.c +++ b/mm/nommu.c @@ -588,7 +588,6 @@ static int delete_vma_from_mm(struct vm_area_struct *vma) current->pid); return -ENOMEM; } - vma_start_write(vma); cleanup_vma_from_mm(vma); /* remove from the MM's tree and list */ @@ -1520,10 +1519,6 @@ void exit_mmap(struct mm_struct *mm) */ mmap_write_lock(mm); for_each_vma(vmi, vma) { - /* - * No need to lock VMA because this is the only mm user and no - * page fault handled can race with it. - */ cleanup_vma_from_mm(vma); delete_vma(mm, vma); cond_resched(); -- 2.50.1