From: Liam R. Howlett Date: Wed, 20 Jul 2022 02:17:53 +0000 (+0000) Subject: mm/mmap: change do_brk_munmap() to use do_mas_align_munmap() X-Git-Tag: howlett/maple/20220816~40 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=d28824070d69c27770e6d81b2bc59e111eaa6be9;p=users%2Fjedix%2Flinux-maple.git mm/mmap: change do_brk_munmap() to use do_mas_align_munmap() 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. Link: https://lkml.kernel.org/r/20220504011345.662299-14-Liam.Howlett@oracle.com Link: https://lkml.kernel.org/r/20220519150509.1290067-1-Liam.Howlett@oracle.com Link: https://lkml.kernel.org/r/20220621204632.3370049-30-Liam.Howlett@oracle.com Link: https://lkml.kernel.org/r/20220720021727.17018-30-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Cc: Catalin Marinas Cc: David Howells Cc: "Matthew Wilcox (Oracle)" Cc: SeongJae Park Cc: Vlastimil Babka Cc: Will Deacon Cc: Davidlohr Bueso Cc: David Hildenbrand Cc: Hulk Robot Cc: Lukas Bulwahn Cc: Sven Schnelle Cc: Yang Yingliang Signed-off-by: Andrew Morton --- diff --git a/mm/mmap.c b/mm/mmap.c index 905a85171d23..8b5b4f3e16d8 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -3036,7 +3036,7 @@ static int do_brk_munmap(struct ma_state *mas, struct vm_area_struct *vma, int ret; arch_unmap(mm, newbrk, oldbrk); - ret = do_mas_munmap(mas, mm, newbrk, oldbrk-newbrk, uf, true); + ret = do_mas_align_munmap(mas, vma, mm, newbrk, oldbrk, uf, true); validate_mm_mt(mm); return ret; }