[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220426150616.3937571-31-Liam.Howlett@oracle.com>
Date: Tue, 26 Apr 2022 15:06:38 +0000
From: Liam Howlett <liam.howlett@...cle.com>
To: "maple-tree@...ts.infradead.org" <maple-tree@...ts.infradead.org>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Yu Zhao <yuzhao@...gle.com>
Subject: [PATCH v8 30/70] mm/mmap: change do_brk_munmap() to use
do_mas_align_munmap()
From: "Liam R. Howlett" <Liam.Howlett@...cle.com>
do_brk_munmap() has already aligned the address and has a maple tree state
to be used. Use the new do_mas_align_munmap() to avoid unnecessary
alignment and error checks.
Signed-off-by: Liam R. Howlett <Liam.Howlett@...cle.com>
---
mm/mmap.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/mm/mmap.c b/mm/mmap.c
index 9f3a2192748b..a98f7c765628 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -3009,14 +3009,15 @@ static int do_brk_munmap(struct ma_state *mas, struct vm_area_struct *vma,
struct mm_struct *mm = vma->vm_mm;
struct vm_area_struct unmap;
unsigned long unmap_pages;
- int ret = 1;
+ int ret;
arch_unmap(mm, newbrk, oldbrk);
if (likely((vma->vm_end < oldbrk) ||
((vma->vm_start == newbrk) && (vma->vm_end == oldbrk)))) {
/* remove entire mapping(s) */
- ret = do_mas_munmap(mas, mm, newbrk, oldbrk-newbrk, uf, true);
+ ret = do_mas_align_munmap(mas, vma, mm, newbrk, oldbrk, uf,
+ true);
goto munmap_full_vma;
}
--
2.35.1
Powered by blists - more mailing lists