Re: [PATCH 00/60] Private NUMA nodes
From: Yury Norov
Date: Wed Nov 25 2026 - 12:30:06 EST
On Mon, Nov 23, 2026 at 03:06:55AM -0500, Gregory Price (Meta) wrote:
> On 2026-11-22 16:12 -0500, Yury Norov wrote:
> > On Sun, Nov 22, 2026 at 02:11:31PM -0500, Gregory Price (Meta) wrote:
> > > On 2026-11-22 11:51 -0500, Yury Norov wrote:
> > > > On Fri, Nov 20, 2026 at 01:08:51PM -0500, Gregory Price via B4 Relay wrote:
> > > > > This is v6 of the Private NUMA node series. The series falls into four
> > > > > parts, each building on the one before:
> > > > >
> > > > > 1-18 mm: introduce N_MEMORY_COMMON
> > > >
> > > > I walked through this part, mostly. It looks like you can substantially
> > > > decrease the patch count if you keep N_MEMORY meaning unchanged, and
> > > > add another type, like N_MEMORY_NOALLOC.
> > > >
> > >
> > > I don't see how this would reduce the patch count substatially, you
> > > still need to convert existing N_MEMORY users and need to differentiate
> > > between general purpose memory nodes and private memory nodes.
> >
> > Please check this quick attempt with my codex. The patch count is reduced
> > to 52:
> >
> > https://github.com/norov/linux/tree/private-nodes-v6-n-memory-folded
> >
> ... snip ...
>
> Patch count is not what we want to be optimizing for here.
>
> Your branch carries the same code (+3 lines net actually).
Line count is neither the metrics.
> The patch reduction comes from squashing the per-subsystem conversions
> into one 16-file commit.
No, and I mentioned that.
> It also broke get_mempolicy(MPOL_F_MEMS_ALLOWED) - it now returns
> memoryless nodes even if the system doesn't have a private node.
>
> > The more important thing is that N_MEMORY and the proposed N_MEMORY_NOALLOC
> > is a disjoint, contrary to N_MEMORY and N_MEMORY_COMMON.
>
> The proposal here is not novel - version 5 was also disjoint:
> https://lore.kernel.org/linux-mm/20260720193431.3841992-5-gourry@xxxxxxxxxx/
Alright, this is the important piece of information, and it's not
highlighted in the cover letter at all.
For the next iteration, please use the [PATCH v7] tag to highlight that
there's some history and background for the current design.
The cover letter is wordy enough to exceed my ability to perceive the
plain text, TBH. I followed it to, maybe, a MODEL section, and then
switched to the actual code. I don't think I'm alone here.
Can you please structure it so the really important things will be
mentioned in the first ~20 lines, and please provide links to the
previous iterations.
> N_MEMORY and N_MEMORY_PRIVATE are mutually exclusive states.
>
> I moved away from that because it changes the definition of N_MEMORY.
>
> The subset model is easy to understand
>
> N_MEMORY - a node has memory
> -> N_HIGH_MEMORY - subset of N_MEMORY
> -> N_NORMAL_MEMORY - subset of N_MEMORY
> -> N_MEMORY_COMMON - subset of N_MEMORY
> -> N_MEMORY_PRIVATE - subset of N_MEMORY
> (COMMON and PRIVATE partition N_MEMORY)
> -> N_MEMORY_<FEATURE> - subset of N_MEMORY
> all N_MEMORY_COMMON
> some N_MEMORY_PRIVATE
>
> It's additive. Users pick the set of nodes they want for their purpose
> and don't have to cobble sets together or remember special helpers.
> Users don't even need to know about private nodes most of the time
> (mempolicy being the one major exception here).
Do you support private nodes for HIGH_MEMORY?
If yes, it would look like:
N_MEMORY
-> N_HIGH_MEMORY
-> N_NORMAL_MEMORY
-> N_MEMORY_COMMON
-> N_MEMORY_PRIVATE
If no, I'd organize it like:
N_MEMORY
-> N_HIGH_MEMORY
-> N_NORMAL_MEMORY
-> N_MEMORY_COMMON
-> N_MEMORY_PRIVATE
Does it mean that COMMON and PRIVATE is a disjoint in this model(s)?
If so, the COMMON is excessive. If not, can a node be COMMON and
PRIVATE at the same time? What would it mean?
I didn't understand the N_MEMORY_<FEATURE> passage. Can you please
elaborate on the 'all this, some that' part?
> In the disjoint model, N_MEMORY no longer means "has memory". Recovering
> that set requires new helpers, and the meaning changes silently for
> every in-tree and out-of-tree user. Anything that wanted "has memory"
> quietly misses private nodes.
>
> Either way you have to audit each N_MEMORY reference and decide whether
> it wants that state or a feature variant (N_MEMORY_RECLAIM, COMPACTION).
>
> The difference is how a missed site fails. In the joint model the
> zonelist and the common-memory folio checks backstop allocation and
> access, so a missed placement site costs some additional work.
>
> In the disjoint model a missed site silently drops a node from stats
> and accounting - or worse fails to allocate per-node meta data.
>
> So no, I do not think we should go back to the disjoint model.
You already did that analysis I was looking for, but discussed it only
in reply to my question... In v7 please wrap the design decision up in
the cover letter.
I feel convinced, despite that hierarchical approach seemingly
requires to touch more subsystems. But I would like to get feedback
from those followed v5 and earlier discussions.
> > > and n_memory_noalloc is not a good name.
> >
> > sure, i'm not attached to any particular name. although,
> > n_memory_common nothing better to me. it answers the question
> > 'what for this thing' even worse.
> >
>
> happy to wordsmith the names here.
>
> N_MEMORY_GENERAL? _DEFAULT? _COMMON felt intuitive but I am happy
> to rename it whatever.
If common and private is a disjoint, you need a single flag to cover
both states. Or I miss something on it?
Also, it looks like the 'COMMON' memory is one that available to MM
allocator and other API. Maybe N_MEMORY_MM then, if you still need the
name?