lkml.org 
[lkml]   [2022]   [Jul]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] mmap: Remove unroll from vma_expand()
Date
Undoing the anon vma work is no necessary since it will be handled by
the caller in the freeing of the VMA, or in the OOM that is happening.

Fixes: d8bb385648a5 (mm/mmap: use advanced maple tree API for mmap_region())
Suggested-by:Hugh Dickins <hughd@google.com>
Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
---
mm/mmap.c | 4 ----
1 file changed, 4 deletions(-)

diff --git a/mm/mmap.c b/mm/mmap.c
index 139862557cc1..7440f250581d 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -670,7 +670,6 @@ inline int vma_expand(struct ma_state *mas, struct vm_area_struct *vma,
struct anon_vma *anon_vma = vma->anon_vma;
struct file *file = vma->vm_file;
bool remove_next = false;
- bool anon_cloned = false;

if (next && (vma != next) && (end == next->vm_end)) {
remove_next = true;
@@ -682,7 +681,6 @@ inline int vma_expand(struct ma_state *mas, struct vm_area_struct *vma,
error = anon_vma_clone(vma, next);
if (error)
return error;
- anon_cloned = true;
}
}

@@ -765,8 +763,6 @@ inline int vma_expand(struct ma_state *mas, struct vm_area_struct *vma,
return 0;

nomem:
- if (anon_cloned)
- unlink_anon_vmas(vma);
return -ENOMEM;
}

--
2.35.1
\
 
 \ /
  Last update: 2022-07-19 20:51    [W:0.028 / U:0.480 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site