From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8C60343D51C for ; Thu, 26 Feb 2026 19:00:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.12 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772132442; cv=none; b=fSN3aHyqE/ZazagatnttZ5GiN+RfLlbvLDKmFHRmlMYFAhslCnQbmNlLCtOONc0lNK9ykq3OJPAuC47jNDW6MWI/GHnAClWH8PbC1dat/4Q0yogdijej/zm0jhaaM0JqZhzxsJwOBuk6hwUVWUUzcjxd1SWasfCXZAwar/TsHN4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772132442; c=relaxed/simple; bh=19SZ7ldNQ9RX2bs0nF7wp9b6NFHp8KUDmlrSbIvGeaU=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=X5oGTp56ratPk07/WTxeYMaQKYRiy/49FrDIKUR2RC+f3AU9iiKDZwYppYcDewbuUIKW45PeLl8GSHX6lf279sI8F0tPk441sPcxJGqNjlPNUMVSfD+X6YrWq/vdVvuRp9PZThdk5o+x73/OQpacKwqgDy3zFLJa/EEExA1+jKM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=hNeJa2i4; arc=none smtp.client-ip=198.175.65.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="hNeJa2i4" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1772132440; x=1803668440; h=message-id:subject:from:to:cc:date:in-reply-to: references:content-transfer-encoding:mime-version; bh=19SZ7ldNQ9RX2bs0nF7wp9b6NFHp8KUDmlrSbIvGeaU=; b=hNeJa2i41U6slfK30u8QlJholsyKsbSc+u7tc2w0BulYAwyBntL2Yzh8 eJXL7O/o5XS58H2dZlendk9/8j2OKHqXjo5j0pCss/ebZFclXN8e7UCS+ H8EpMOQjTSw+y3lLV1hOT7ufMCQiiutIgaZBMfWRri2kXbiwEusY1boip mr+UjL057w3N95h8l9vnZDf/pNDiP+8nLBifJgo8EQzwTwGQhAQq6V1hI Ig/Y4FqEFr/ZKXsRO+ts0g+pVs6KmggXy+guTa7Q+2HSXdZIHd6agYTEL Bz2E1fgHut6ZR4Jeh0MyXWT4txjRi27yVwgBqUDlyawO/M1wQ/4KAydxs A==; X-CSE-ConnectionGUID: jhMRH8LiQF+E504QES6Dag== X-CSE-MsgGUID: dwWIn+JATeeYvwS9qmosxg== X-IronPort-AV: E=McAfee;i="6800,10657,11713"; a="84667871" X-IronPort-AV: E=Sophos;i="6.21,312,1763452800"; d="scan'208";a="84667871" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Feb 2026 11:00:39 -0800 X-CSE-ConnectionGUID: w1llaIy6TVGODYNutgQlKQ== X-CSE-MsgGUID: 4A3J4hoTQFiNMsDBdICJBA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.21,312,1763452800"; d="scan'208";a="254431318" Received: from schen9-mobl4.amr.corp.intel.com (HELO [10.125.111.161]) ([10.125.111.161]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Feb 2026 11:00:38 -0800 Message-ID: Subject: Re: [RFC][PATCH 5/6] x86/topo: Fix SNC topology mess From: Tim Chen To: "Chen, Yu C" , Peter Zijlstra Cc: linux-kernel@vger.kernel.org, kyle.meyer@hpe.com, vinicius.gomes@intel.com, brgerst@gmail.com, hpa@zytor.com, kprateek.nayak@amd.com, patryk.wlazlyn@linux.intel.com, rafael.j.wysocki@intel.com, russ.anderson@hpe.com, zhao1.liu@intel.com, tony.luck@intel.com, x86@kernel.org, tglx@kernel.org Date: Thu, 26 Feb 2026 11:00:38 -0800 In-Reply-To: <334d4edb-b8f4-41fb-aa16-6cb7abeaa21d@intel.com> References: <20260226104909.675623579@infradead.org> <20260226105052.737712686@infradead.org> <334d4edb-b8f4-41fb-aa16-6cb7abeaa21d@intel.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.58.1 (3.58.1-1.fc43) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On Fri, 2026-02-27 at 01:07 +0800, Chen, Yu C wrote: > Hi Peter, >=20 > On 2/26/2026 6:49 PM, Peter Zijlstra wrote: > > + int u =3D __num_nodes_per_package; >=20 > Yes, this is much simpler, thanks for the patch! >=20 > > + long d =3D 0; > > + int x, y; > > + > > + /* > > + * Is this a unit cluster on the trace? > > + */ > > + if ((i / u) =3D=3D (j / u)) > > + return node_distance(i, j); >=20 > If the number of nodes per package is 3, we assume that > every 3 consecutive nodes are SNC siblings (on the same > trace):node0, node1, and node2 are SNC siblings, while > node3, node4, and node5 form another group of SNC siblings. >=20 > I have a curious thought: could it be possible that > node0, node2, and node4 are SNC siblings, and node1, > node3, and node5 are another set of SNC siblings instead? >=20 > Then I studied the code a little more, node ids are dynamically > allocated via the acpi_map_pxm_to_node, so the assignment of node > ids depends on the order in which each processor affinity structure > is listed in the SRAT table. For example, suppose CPU0 belongs to > package0 and CPU1 belongs to package1, but their entries are placed > consecutively in the SRAT. In this case, the Proximity Domain of > CPU0 would be mapped to node0 via acpi_map_pxm_to_node, and CPU1=E2=80=99= s > Proximity Domain would be assigned node1. The logic above would > then treat them as belonging to the same package, even though they > are physically in different packages. However, I believe such a > scenario is unlikely to occur in practice in the BIOS and if it > happens it should be a BIOS bug if I understand correctly. >=20 >=20 May be a good idea to sanity check that the nodes in the first unit cluster has the same package id and give a WARNING if that's not the case. Tim