Re: [PATCH 08/12] arch, mm/util: add const to arch_pick_mmap_layout() parameter

From: Max Kellermann
Date: Sun Aug 31 2025 - 05:07:52 EST


On Sat, Aug 30, 2025 at 1:36 AM Vishal Moola (Oracle)
<vishal.moola@xxxxxxxxx> wrote:
> > -static inline int mmap_is_legacy(struct rlimit *rlim_stack)
> > +static inline int mmap_is_legacy(const struct rlimit *rlim_stack)
>
> Thanks for splitting the patch into all these smaller snippets, it makes
> review a lot easier. But this function should be part of the 6th patch
> since we'd want function signatures to change together :).

Will do.

There are 3 copies of this function which are slightly different:
- arch/s390/mm/mmap.c (checks rlim_stack)
- arch/x86/mm/mmap.c (does not check rlim_stack)
- mm/util.c (checks rlim_stack if CONFIG_STACK_GROWSUP)

I wonder if it would be best to merge all 3 into one? The one in
mm/util.c seems to be generic enough. Export it and have its prototype
in linux/mm.h?