Re: [RFC][PATCH 2/6] x86/topo: Add TOPO_NUMA_DOMAIN
From: Peter Zijlstra
Date: Mon Mar 02 2026 - 10:10:55 EST
On Mon, Mar 02, 2026 at 09:46:57AM +0530, K Prateek Nayak wrote:
> Hello Peter,
>
> On 2/27/2026 7:36 PM, Peter Zijlstra wrote:
> >> Looking at the series, all we need is an equivalent of:
> >>
> >> domain_weight(TOPO_NUMA_DOMAIN)
> >
> > Fair enough; but then lets replace patch 1 and 2 with something like
> > that.
> >
> > But I must note that the nodemask API is crap; it has both node_set() and
> > __node_set() be the atomic version :-(
> >
> > Let me go rework the other patches to fit on this.
>
> Boots fine with a s/domain_weight(TOPO_NUMA_DOMAIN)/num_phys_nodes()/
> applied to Patch 3.
>
> Topology looks fine for NPS4 on my 3rd Generation EPYC with 2 sockets,
> and I haven't triggered any warning even with "L3 as NUMA" turned on.
> Feel free to include:
>
> Tested-by: K Prateek Nayak <kprateek.nayak@xxxxxxx>
Thanks!
I had a quick look at this NPS stuff, and that is more or less the same
as the intel SNC thing. With two notable exceptions:
- you've stuck to power-of-two numbers (good!)
- NPS0; I don't think Intel has anything like that (although I could be
mistaken).
Now, the __num_nodes_per_package is obviously not going to work for
NPS0 (it bottoms out at 1).
Should we look at adding something for NPS0, or has that not been needed
(yet) ?