Re: [PATCH] pipe: Prefer mempolicy node for metadata allocations

From: Gregory Price (Meta)

Date: Thu Nov 19 2026 - 10:55:41 EST


On 2026-11-11 07:48 +0100, Andrea Righi wrote:
>
> Vlastimil, Gregory, do you think this SLUB locality and mempolicy
> aspects makes sense here? In particular, does preferring the policy node
> for slab-sized pipe metadata, while retaining the policy-aware path for
> larger arrays, look reasonable?
>

Funny enough I was leaning toward task mempolicy being ignored for
non-__GFP_ACCOUNT allocations but SLAB_ACCOUNT makes this a bit
complicated. This would be another scenario I have to consider.

(related but not directly problematic with the change here)
https://lore.kernel.org/all/20260701222112.2820098-1-gourry@xxxxxxxxxx/

As a rule I generally think depending on userland mempolicy
to direct kernel memory placement is fragile and unreliable,
but your results are interesting.

General notes - I dislike direct current->mempolicy access in
random places in MM, and dislike any MPOL mode checking outside
mempolicy.c - but sometimes it's necessary.

I'm not against slab having better numa awareness, it makes sense
you'd want to prefer the metadata to live close as well.

Give me a bit more time to wrap my head around this, sorry for the
delayed reply, things have been a bit chaotic this past month.

--
~Gregory