mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Chen, Yu C" <yu.c.chen@intel.com>
To: Kyle Meyer <kyle.meyer@hpe.com>
Cc: <tim.c.chen@linux.intel.com>, <bp@alien8.de>,
	<dave.hansen@linux.intel.com>, <mingo@redhat.com>,
	<tglx@kernel.org>, <vinicius.gomes@intel.com>,
	<brgerst@gmail.com>, <hpa@zytor.com>, <kprateek.nayak@amd.com>,
	<linux-kernel@vger.kernel.org>, <patryk.wlazlyn@linux.intel.com>,
	<rafael.j.wysocki@intel.com>, <russ.anderson@hpe.com>,
	<x86@kernel.org>, <zhao1.liu@intel.com>,
	"Peter Zijlstra" <peterz@infradead.org>,
	Aubrey Li <aubrey.li@intel.com>
Subject: Re: [PATCH v2] sched/topology: Check average distances to remote packages
Date: Wed, 25 Feb 2026 17:05:01 +0800	[thread overview]
Message-ID: <30c6c21b-6f03-4930-a40a-fcfa045ac362@intel.com> (raw)
In-Reply-To: <aZ5Trhfzl4EnebXy@hpe.com>

Hi Kyle,

On 2/25/2026 9:43 AM, Kyle Meyer wrote:
> On Mon, Feb 23, 2026 at 06:03:14PM +0100, Peter Zijlstra wrote:
>> On Wed, Feb 04, 2026 at 06:24:26PM -0600, Kyle Meyer wrote:
>>> Granite Rapids (GNR) and Clearwater Forest (CWF) average distances to
>>> remote packages to fix scheduler domains, see [1] for more information.
>>>
>>> A warning and backtrace are printed when sub-NUMA clustering (SNC) is
>>> enabled and there are more than 2 packages because the average distances
>>> to remote packages could be different, skewing the single average remote
>>> distance.
>>
>> But earlier Tim said these systems will not have more than 2 packages.
>> So what's what?
> 
> We have Intel customer reference boards with 2, 4, and 8 sockets.
>   

Thanks for the info. We were not previously aware that the stock GNR 
platform
will scale up to 8 sockets.

>> So what do these new systems look like?
> 
> Here's an 8 socket (2 chassis) HPE system with SNC enabled:
> 
> node   0   1   2   3   4   5   6   7   8   9  10  11  12  13  14  15
>    0:  10  12  16  16  16  16  18  18  40  40  40  40  40  40  40  40
>    1:  12  10  16  16  16  16  18  18  40  40  40  40  40  40  40  40
>    2:  16  16  10  12  18  18  16  16  40  40  40  40  40  40  40  40
>    3:  16  16  12  10  18  18  16  16  40  40  40  40  40  40  40  40
>    4:  16  16  18  18  10  12  16  16  40  40  40  40  40  40  40  40
>    5:  16  16  18  18  12  10  16  16  40  40  40  40  40  40  40  40
>    6:  18  18  16  16  16  16  10  12  40  40  40  40  40  40  40  40
>    7:  18  18  16  16  16  16  12  10  40  40  40  40  40  40  40  40
>    8:  40  40  40  40  40  40  40  40  10  12  16  16  16  16  18  18
>    9:  40  40  40  40  40  40  40  40  12  10  16  16  16  16  18  18
>   10:  40  40  40  40  40  40  40  40  16  16  10  12  18  18  16  16
>   11:  40  40  40  40  40  40  40  40  16  16  12  10  18  18  16  16
>   12:  40  40  40  40  40  40  40  40  16  16  18  18  10  12  16  16
>   13:  40  40  40  40  40  40  40  40  16  16  18  18  12  10  16  16
>   14:  40  40  40  40  40  40  40  40  18  18  16  16  16  16  10  12
>   15:  40  40  40  40  40  40  40  40  18  18  16  16  16  16  12  10
> 
> 10 = Same chassis and socket
> 12 = Same chassis and socket (SNC)
> 16 = Same chassis and adjacent socket
> 18 = Same chassis and non-adjacent socket

Previously, I thought that REMOTE_DISTANCE represents the
distance between two nodes on different sockets, but that does
not appear to be the case here. I could not find any definition
of “20 or double” in the SLIT section of the ACPI specification.
Thus, I assume this value of 20 is an artificial threshold. In my
view, checking whether all distances above 20 are identical really
depends on the specific platform. For example, if we have a distance
value such as:
22 = Same chassis and non-adjacent socket then applying the current
patch would trigger a warning regardless.

That said, since 20 is an artificial threshold, I have a tentative
idea:we could normalize the SLIT distances by sorting the slit_dist
values, finding the 75th percentile value, keeping all slit_dist values
below the 75th percentile unchanged, and treating all slit_dist values
above the 75th percentile as remote - assigning them the average remote
distance. This way, we could eliminate the arbitrary value of 20. But
that might require rewrite.. and for now it is ok to keep 20.

> 40 = Different chassis
> 
> Each processor connects to an ASIC (XNC) that acts as a multiplexer, extending
> the UPI interconnect across the entire system.
> 
> We don't experience the scheduler domain issue reported by Tim because our SLIT
> provides symmetric distances to remote NUMA nodes, but we trigger the WARN_ONCE
> because we exceed 2 packages.
> 
>>> This is unnecessary when the average distances to remote packages are
>>> the same.
>>>
>>> Support single average remote distance on systems with more than 2
>>> packages, preventing unnecessary warnings and backtraces, by checking if
>>> average distances to remote packages are the same.
>>
>>
>>

[ ... ]

>>> +			pkg = topology_physical_package_id(cpu);
>>> +			pkg_total_distance[pkg] += distance;
>>> +			pkg_nr_remote[pkg]++;
>>
>> This is broken, physical_package_id is not guaranteed to be dense.
> 
> Thank you, I'll fix this.
> 

It seems that topology_logical_package_id() can work here.

thanks,
Chenyu

  reply	other threads:[~2026-02-25  9:05 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-05  0:24 Kyle Meyer
2026-02-23 16:42 ` Kyle Meyer
2026-02-23 17:03 ` Peter Zijlstra
2026-02-25  1:43   ` Kyle Meyer
2026-02-25  9:05     ` Chen, Yu C [this message]
2026-02-25 12:30     ` Peter Zijlstra
2026-02-25 13:36       ` Peter Zijlstra
2026-02-25 15:39       ` Chen, Yu C
2026-02-25 15:44         ` Peter Zijlstra
2026-02-25 16:32           ` Peter Zijlstra
2026-02-25 16:40             ` Peter Zijlstra
2026-02-25 21:37             ` Tim Chen
2026-02-25 22:30               ` Peter Zijlstra
2026-02-25 22:54                 ` Peter Zijlstra
2026-02-25 22:55                 ` Tim Chen
2026-02-25 23:29                   ` Kyle Meyer
2026-02-26 18:14                     ` Tim Chen
2026-02-25 16:41       ` Kyle Meyer
2026-02-25 16:49         ` Peter Zijlstra

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=30c6c21b-6f03-4930-a40a-fcfa045ac362@intel.com \
    --to=yu.c.chen@intel.com \
    --cc=aubrey.li@intel.com \
    --cc=bp@alien8.de \
    --cc=brgerst@gmail.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=kprateek.nayak@amd.com \
    --cc=kyle.meyer@hpe.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --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=vinicius.gomes@intel.com \
    --cc=x86@kernel.org \
    --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®