Re: [PATCH 2/2] mm/mempolicy: limit shared policy ranges per inode

From: Gregory Price (Meta)

Date: Mon Nov 16 2026 - 11:13:48 EST


On 2026-11-15 17:40 +0100, David Hildenbrand (Arm) wrote:
> On 11/14/26 21:25, Gregory Price (Meta) wrote:
> > On 2026-11-14 21:16 +0100, David Hildenbrand (Arm) wrote:
> >> On 11/14/26 18:41, Gregory Price (Meta) wrote:
> >>>
> >>> Multi-task mappers were previously unlimited, but that seems like more
> >>> of a nasty unintended corner case - not a real feature.
> >>>
> >>> A single process is already limited on the number of vmas/policies based
> >>> on `max_map_count`, so it seems natural to just use max_map_count
> >>> directly, but I took a brief look at some distros and most seem to
> >>> ship a raised `max_map_count` (>1 million) by default).
> >>>
> >>> I tested that and even 1 million can cause a soft lockup.
> >>>
> >>> Not sure there's an easy solution here, we might have to rework the shm
> >>> policy locks.
> >>
> >> Do you know a single valid use case that's not solved by patch #1 and would
> >> trigger that many policies?
> >>
> >> Ai was not able to come up with anything for me.
> >
> > Just want to make sure the bases are covered.
> >
>
> Yes, and I'd be very happy to learn about use cases.
>
> Maybe we can let this stay in -next for a while before moving forward with this?
>

Seems reasonable, although just kind of delaying the inevitable.

I suppose the mitigation for it causing issues is backporting an
increase to the default size.

Eh, if the concern here isn't a big deal, I'd just say ship it.

Reviewed-by: Gregory Price (Meta) <gourry@xxxxxxxxxx>

--
~Gregory