Re: [PATCH 25/32] mm/mempolicy: don't wait for mems_allowed_seq in kmalloc_nolock()

From: Gregory Price (Meta)

Date: Tue Dec 01 2026 - 09:00:22 EST


On 2026-12-01 12:58 +0100, David Hildenbrand (Arm) wrote:
> On 12/1/26 12:44, Vlastimil Babka (SUSE) wrote:
> > On 12/1/26 10:39 AM, David Hildenbrand (Arm) wrote:> On 11/30/26 19:12,
> > Gregory Price (Meta) wrote:
> >>>
> >>> Should we just blanket ignore mempolicy when spinning is not allowed?
> >>> If another mempolicy gets added later we have moles to whack.
> >>
> >> Yes, that's what we get for merging half-baked things like kmalloc_nolock().
> >>>
> >>> I think then this just becomes a slub.c-only change where we ignore
> >>> mempolicy is spinning isn't allowed and always prefer local.
> >>>
> >>> That also makes the behavior consistent - no-spin = no policy.
> >>
> >> I'm not sure if that's preferable. @Vlastimil, @Harry what are your thoughts on
> >> this?
> >
> > I think it's fine. kmalloc_nolock() are usually bpf allocations from
> > tracepoints/probes that do their own thing not related to the main code
> > and its policies. Preferring local makes more sense for them anyway? And
> > if they get remote allocations, the bpf programs will just be a bit slower?
>
> Cool, could one of you take care of handling this in slab code then? Would be
> appreciated :)
>

still recombobulating from the holiday, but yeah I can. Vlastimil let
me know if you've already poked at it.

--
~Gregory