* [PATCH] mmap: Remove unroll from vma_expand()
@ 2022-07-19 18:50 Liam Howlett
0 siblings, 0 replies; only message in thread
From: Liam Howlett @ 2022-07-19 18:50 UTC (permalink / raw)
To: maple-tree, linux-mm, linux-kernel, Andrew Morton, Hugh Dickins; +Cc: Yu Zhao
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-07-19 18:50 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-19 18:50 [PATCH] mmap: Remove unroll from vma_expand() Liam Howlett
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox