mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: K Prateek Nayak <kprateek.nayak@amd.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: <x86@kernel.org>, <tglx@kernel.org>,
	<linux-kernel@vger.kernel.org>, <tim.c.chen@linux.intel.com>,
	<yu.c.chen@intel.com>, <kyle.meyer@hpe.com>,
	<vinicius.gomes@intel.com>, <brgerst@gmail.com>, <hpa@zytor.com>,
	<patryk.wlazlyn@linux.intel.com>, <rafael.j.wysocki@intel.com>,
	<russ.anderson@hpe.com>, <zhao1.liu@intel.com>,
	<tony.luck@intel.com>
Subject: Re: [RFC][PATCH 2/6] x86/topo: Add TOPO_NUMA_DOMAIN
Date: Mon, 2 Mar 2026 21:05:03 +0530	[thread overview]
Message-ID: <f9cfe741-4032-4a9a-8e75-ca6187dcca3a@amd.com> (raw)
In-Reply-To: <20260302151034.GO1282955@noisy.programming.kicks-ass.net>

Hello Peter,

On 3/2/2026 8:40 PM, Peter Zijlstra wrote:
> 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@amd.com>
> 
> 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!)

Yeah but "L3 as NUMA" on a 6CCX machines doesn't follow that :-(
Is there any implicit dependency there?

P.S. All these configs are symmetric so those divisions should give the
correct results.

> 
>  - 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) ?

Let me go boot into NPS0 to see what my machine thinks. But it shouldn't
do any harm right because of the DIV_ROUND_UP() right?

__num_nodes_per_package will be 1 (which is technically correct since
the whole package is indeed one node) and then we retain the PKG domain
so as far as those bits are concerned, it should be fine.

This is from my dual socket Zen3 booted into NPS0:

    CPU topo: Max. logical packages:   2
    CPU topo: Max. logical nodes:      1
    CPU topo: Num. nodes per package:  1
    CPU topo: Max. logical dies:       2
    CPU topo: Max. dies per package:   1
    CPU topo: Max. threads per core:   2
    CPU topo: Num. cores per package:    64
    CPU topo: Num. threads per package: 128
    CPU topo: Allowing 256 present CPUs plus 0 hotplug CPUs


CPU0's scheduler topology looks like:

    CPU0 attaching sched-domain(s):
     domain-0: span=0,128 level=SMT
      groups: 0:{ span=0 },
            128:{ span=128 }
      domain-1: span=0-7,128-135 level=MC
       groups: 0:{ span=0,128 cap=2048 },
               1:{ span=1,129 cap=2048 },
               2:{ span=2,130 cap=2048 },
               3:{ span=3,131 cap=2048 },
               4:{ span=4,132 cap=2048 },
               5:{ span=5,133 cap=2048 },
               6:{ span=6,134 cap=2048 },
               7:{ span=7,135 cap=2048 }
       domain-2: span=0-255 level=PKG
        groups:  0:{ span=0-7,128-135 cap=16384 },
                 8:{ span=8-15,136-143 cap=16384 },
                16:{ span=16-23,144-151 cap=16384 },
                24:{ span=24-31,152-159 cap=16384 },
                32:{ span=32-39,160-167 cap=16384 },
                40:{ span=40-47,168-175 cap=16384 },
                48:{ span=48-55,176-183 cap=16384 },
                56:{ span=56-63,184-191 cap=16384 },
                64:{ span=64-71,192-199 cap=16384 },
                72:{ span=72-79,200-207 cap=16384 },
                80:{ span=80-87,208-215 cap=16384 },
                88:{ span=88-95,216-223 cap=16384 },
                96:{ span=96-103,224-231 cap=16384 },
               104:{ span=104-111,232-239 cap=16384 },
               112:{ span=112-119,240-247 cap=16384 },
               120:{ span=120-127,248-255 cap=16384 }
    ...
    root domain span: 0-255


The PKG domain covers both the sockets since it uses the node mask which
covers the entire system.

-- 
Thanks and Regards,
Prateek


  reply	other threads:[~2026-03-02 15:35 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-26 10:49 [RFC][PATCH 0/6] x86/topo: SNC Divination Peter Zijlstra
2026-02-26 10:49 ` [RFC][PATCH 1/6] x86/topo: Store extra copy of SRAT table Peter Zijlstra
2026-02-26 10:49 ` [RFC][PATCH 2/6] x86/topo: Add TOPO_NUMA_DOMAIN Peter Zijlstra
2026-02-27 13:19   ` K Prateek Nayak
2026-02-27 14:06     ` Peter Zijlstra
2026-03-02  4:16       ` K Prateek Nayak
2026-03-02 15:10         ` Peter Zijlstra
2026-03-02 15:35           ` K Prateek Nayak [this message]
2026-03-02 16:28             ` Peter Zijlstra
2026-02-26 10:49 ` [RFC][PATCH 3/6] x86/topo: Add __num_nodes_per_package Peter Zijlstra
2026-02-26 17:46   ` Kyle Meyer
2026-02-27 11:57     ` Peter Zijlstra
2026-02-26 10:49 ` [RFC][PATCH 4/6] x86/topo: Replace x86_has_numa_in_package Peter Zijlstra
2026-02-26 10:49 ` [RFC][PATCH 5/6] x86/topo: Fix SNC topology mess Peter Zijlstra
2026-02-26 17:07   ` Chen, Yu C
2026-02-26 19:00     ` Tim Chen
2026-02-26 22:11       ` Tim Chen
2026-02-26 22:25         ` Tim Chen
2026-02-27 13:01       ` Peter Zijlstra
2026-02-27 19:23         ` Tim Chen
2026-02-28  7:35           ` Chen, Yu C
2026-03-02 16:43             ` Peter Zijlstra
2026-03-03  6:31               ` Zhang Rui
2026-03-03  6:39                 ` Chen, Yu C
2026-03-03  8:44                 ` Peter Zijlstra
2026-02-27 11:56     ` Peter Zijlstra
2026-02-26 10:49 ` [RFC][PATCH 6/6] x86/resctrl: Fix SNC detection Peter Zijlstra
2026-02-26 19:42   ` Luck, Tony
2026-02-26 20:47     ` Luck, Tony
2026-02-27  9:26       ` Peter Zijlstra
2026-02-26 19:16 ` [RFC][PATCH 0/6] x86/topo: SNC Divination Luck, Tony
2026-03-02 18:21 ` Kyle Meyer

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=f9cfe741-4032-4a9a-8e75-ca6187dcca3a@amd.com \
    --to=kprateek.nayak@amd.com \
    --cc=brgerst@gmail.com \
    --cc=hpa@zytor.com \
    --cc=kyle.meyer@hpe.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=patryk.wlazlyn@linux.intel.com \
    --cc=peterz@infradead.org \
    --cc=rafael.j.wysocki@intel.com \
    --cc=russ.anderson@hpe.com \
    --cc=tglx@kernel.org \
    --cc=tim.c.chen@linux.intel.com \
    --cc=tony.luck@intel.com \
    --cc=vinicius.gomes@intel.com \
    --cc=x86@kernel.org \
    --cc=yu.c.chen@intel.com \
    --cc=zhao1.liu@intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®