From: Andrea Righi <arighi@nvidia.com>
To: "Gregory Price (Meta)" <gourry@gourry.net>
Cc: Jan Kara <jack@suse.cz>, Alexander Viro <viro@zeniv.linux.org.uk>,
Christian Brauner <brauner@kernel.org>,
Quan Liu <qualiu@nvidia.com>, Lee Trager <ltrager@nvidia.com>,
Seth Forshee <sforshee@nvidia.com>,
Vlastimil Babka <vbabka@kernel.org>,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-mm@kvack.org
Subject: Re: [PATCH] pipe: Prefer mempolicy node for metadata allocations
Date: Thu, 19 Nov 2026 17:11:18 +0100 [thread overview]
Message-ID: <av8fpvUJlUL3BlQI@gpd4> (raw)
In-Reply-To: <179510365141.412063.5548407366346393690.b4-reply@b4>
Hi Gregory,
On Thu, Nov 19, 2026 at 10:54:11AM -0500, Gregory Price (Meta) wrote:
> 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@gourry.net/
Thanks for looking at this, and sorry, I just noticed your email right
after sending a v2
(https://lore.kernel.org/r/20261119160430.1113397-1-arighi@nvidia.com/).
This new version doesn't change where new slabs are allocated: it only
stops the remote partial scan from returning objects outside the
MPOL_BIND nodemask, in the cases where new slabs would be allocated
within it anyway.
I think it should be compatible with your series: the nodemask is used
only when the page allocator would also apply the policy to new slabs,
so the same filter for unaccounted allocations can be added there.
>
> 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.
Agreed, in v2 all the mempolicy logic is in a new helper in mempolicy.c
(mempolicy_slab_nodemask()), SLUB only gets a nodemask from it.
>
> 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.
No problem! Take your time.
Thanks,
-Andrea
prev parent reply other threads:[~2026-11-19 16:11 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-10 6:52 [PATCH] pipe: Prefer mempolicy node for metadata allocations Andrea Righi
2026-11-10 12:27 ` Jan Kara
2026-11-11 6:48 ` Andrea Righi
2026-11-11 8:12 ` Vlastimil Babka (SUSE)
2026-11-18 13:44 ` Andrea Righi
2026-11-18 14:24 ` Vlastimil Babka (SUSE)
2026-11-19 13:44 ` sashiko-bot
2026-11-19 15:54 ` Gregory Price (Meta)
2026-11-19 16:11 ` Andrea Righi [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=av8fpvUJlUL3BlQI@gpd4 \
--to=arighi@nvidia.com \
--cc=brauner@kernel.org \
--cc=gourry@gourry.net \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=ltrager@nvidia.com \
--cc=qualiu@nvidia.com \
--cc=sforshee@nvidia.com \
--cc=vbabka@kernel.org \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.