Re: [PATCH 00/60] Private NUMA nodes
From: Gregory Price (Meta)
Date: Mon Nov 30 2026 - 13:41:44 EST
On 2026-11-25 12:29 -0500, Yury Norov wrote:
> >
> > 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.
>
Right, i'm pointing out it doesn't appreciably reduce complexity.
It's the same code just shuffled around.
> > 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.
>
I recently shifted my workflow to use b4 prep branches and didn't
realize it didn't pick up the versioning, this will get fixed.
> > 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?
>
no in-tree architecture supports NUMA=Y and HIGHMEM=y
>
> Does it mean that COMMON and PRIVATE is disjoint in this model(s)?
Yes
> If so, the COMMON is excessive.
No. COMMON is the set of nodes that don't include private.
i.e. the set of nodes services / walkers / etc should use by default
unless that service explicitely has been made to support private memory.
Without common, anywhere you touch N_MEMORY needs to explicitly exclude
N_MEMORY_PRIVATE. Rather than make everyone know that, you have them
walk N_MEMORY_COMMON instead.
>
> I didn't understand the N_MEMORY_<FEATURE> passage. Can you please
> elaborate on the 'all this, some that' part?
>
consider COMPACTION
compaction.c walks N_MEMORY_COMMON by default after the first set of
conversions. This means private memory is never touched by compaction.
Later we introduce N_MEMORY_COMPACTION and compaction.c walks
N_MEMORY_COMPACTION.
A private-memory node-owner then registers the node with compaction
support and compaction.c is allowed to walk / touch that node's memory
because the feature gets turned on.
COMMON nodes are automatically opted into every feature (because they're
common memory - the kernel manages the memory by default).
> 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?
N_MEMORY_(MEMORY_MANAGEMENT) lol
N_MEMORY_MANAGED but that's equally confusing. this can be adjusted
whenever in the series, since it's a big find/replace. I'm not attached
to any specific name.
--
~Gregory