From nobody Tue Apr 7 17:13:54 2026 Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 993D531AF3D for ; Thu, 26 Feb 2026 10:53:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.92.199 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772103209; cv=none; b=XLgM6zcA00OuT9R+/8mJ46IwafiHwqn9KETdY35T4IqukHXO1WCvCVqPqs3rskWCxPMfk1amMEseyS5qmkMjA3PHWjy8iqnKmCHLilOOuzFvz/mGVPTUoYb8Cbt2aY/IKz1Ech6SLdWq6sLXyl49Plqr9b+7r1zI83Isc/4xoW0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772103209; c=relaxed/simple; bh=pt+q/s6e7FsfcomWIi5HdKRWHa1K9dIII7W5M8ySEmA=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=bpFMW79JxoYL2eLFniHZ6yOXJZ5frV7UTChfmdQ/XbSUnH0EMPv+6zM4ZjI5I25lmJkJdJuyrrihPNAXNoH0lgalFmdLadbKkhK3ln/D3189mPCAuQa9s2gYLoYM3UUtRMf745Gfr0s5dCRVPm+fea5R/AmlqbMBjpbap85HyeQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=aZKnGvzf; arc=none smtp.client-ip=90.155.92.199 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="aZKnGvzf" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Type:MIME-Version:References: Subject:Cc:To:From:Date:Message-ID:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:In-Reply-To; bh=E8ApyyyRAjhMWtQJ2hxbGXpk9TauzSOAVV8+M36mXTk=; b=aZKnGvzfyWKa/uGaBbLKoAfcw0 zcieSwZPs/jS6c9X8qQeR2ZJi+UslR96BNqYZAr80XlWJFB0hdpVRpmM8dO7P2dhEKlb5pg1SxGP9 vX0+renaT3Fx0uUSDGH4aKGRAmthXV8rq0FjzP6Ktk89/b68+pWH1nPIm4D95DpzFQG84FpWDUe/w RNxPOxeftv+Gqs8mH5KV+FzVA2c8vYNq92mIYRbH0qLBYQ6a7TcYq9h2pc0X+LpEMr4KrWX/qWiRr 27eLt1Oe8hXyM/TYrslzFhKkUN9fdUWgo32wITXEwAAEyWoeTAM6qhALdO6PP0JYD7pepA8Baw4vh g5dzqg9g==; Received: from 2001-1c00-8d85-5700-266e-96ff-fe07-7dcc.cable.dynamic.v6.ziggo.nl ([2001:1c00:8d85:5700:266e:96ff:fe07:7dcc] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.98.2 #2 (Red Hat Linux)) id 1vvYzg-0000000AmI9-3EIr; Thu, 26 Feb 2026 10:53:21 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 0) id 1C64430336E; Thu, 26 Feb 2026 11:53:19 +0100 (CET) Message-ID: <20260226105052.624360500@infradead.org> User-Agent: quilt/0.68 Date: Thu, 26 Feb 2026 11:49:13 +0100 From: Peter Zijlstra To: x86@kernel.org, tglx@kernel.org Cc: linux-kernel@vger.kernel.org, peterz@infradead.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, 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 Subject: [RFC][PATCH 4/6] x86/topo: Replace x86_has_numa_in_package References: <20260226104909.675623579@infradead.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" .. with the brand spanking new __num_nodes_per_package. Signed-off-by: Peter Zijlstra (Intel) --- arch/x86/kernel/smpboot.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c @@ -468,13 +468,6 @@ static int x86_cluster_flags(void) } #endif =20 -/* - * Set if a package/die has multiple NUMA nodes inside. - * AMD Magny-Cours, Intel Cluster-on-Die, and Intel - * Sub-NUMA Clustering have this. - */ -static bool x86_has_numa_in_package; - static struct sched_domain_topology_level x86_topology[] =3D { SDTL_INIT(tl_smt_mask, cpu_smt_flags, SMT), #ifdef CONFIG_SCHED_CLUSTER @@ -496,7 +489,7 @@ static void __init build_sched_topology( * PKG domain since the NUMA domains will auto-magically create the * right spanning domains based on the SLIT. */ - if (x86_has_numa_in_package) { + if (__num_nodes_per_package > 1) { unsigned int pkgdom =3D ARRAY_SIZE(x86_topology) - 2; =20 memset(&x86_topology[pkgdom], 0, sizeof(x86_topology[pkgdom])); @@ -550,7 +543,7 @@ int arch_sched_node_distance(int from, i case INTEL_GRANITERAPIDS_X: case INTEL_ATOM_DARKMONT_X: =20 - if (!x86_has_numa_in_package || topology_max_packages() =3D=3D 1 || + if (topology_max_packages() =3D=3D 1 || __num_nodes_per_package =3D=3D 1= || d < REMOTE_DISTANCE) return d; =20 @@ -606,7 +599,7 @@ void set_cpu_sibling_map(int cpu) o =3D &cpu_data(i); =20 if (match_pkg(c, o) && !topology_same_node(c, o)) - x86_has_numa_in_package =3D true; + WARN_ON_ONCE(__num_nodes_per_package =3D=3D 1); =20 if ((i =3D=3D cpu) || (has_smt && match_smt(c, o))) link_mask(topology_sibling_cpumask, cpu, i);