Re: [PATCH 1/5] mm: Deduplicate mm_get_unmapped_area()

Lorenzo Stoakes
2025-06-13T15:57:28Z

You've not cc'd maintainers/reviewers of mm/mmap.c, please make sure to do so.

+cc Liam
+cc Vlastimiil
+cc Jann
+cc Pedro

...!

On Fri, Jun 13, 2025 at 09:41:07AM -0400, Peter Xu wrote:
> Essentially it sets vm_flags==0 for mm_get_unmapped_area_vmflags(). Use
> the helper instead to dedup the lines.
>
> Signed-off-by: Peter Xu <peterx@redhat.com>

This looks fine though, so:

Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>

> ---
> mm/mmap.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/mm/mmap.c b/mm/mmap.c
> index 09c563c95112..422f5b9d9660 100644
> --- a/mm/mmap.c
> +++ b/mm/mmap.c
> @@ -871,9 +871,8 @@ mm_get_unmapped_area(struct mm_struct *mm, struct file *file,
> unsigned long addr, unsigned long len,
> unsigned long pgoff, unsigned long flags)
> {
> - if (test_bit(MMF_TOPDOWN, &mm->flags))
> - return arch_get_unmapped_area_topdown(file, addr, len, pgoff, flags, 0);
> - return arch_get_unmapped_area(file, addr, len, pgoff, flags, 0);
> + return mm_get_unmapped_area_vmflags(mm, file, addr, len,
> + pgoff, flags, 0);
> }
> EXPORT_SYMBOL(mm_get_unmapped_area);
>
> --
> 2.49.0
>