Skip to content

Commit 717b64d

Browse files
author
Peter Zijlstra
committed
x86/topo: Replace x86_has_numa_in_package
.. with the brand spanking new topology_num_nodes_per_package(). Having the topology setup determine this value during MADT/SRAT parsing before SMP bringup avoids having to detect this situation when building the SMP topology masks. Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Reviewed-by: Ingo Molnar <mingo@kernel.org> Tested-by: Tony Luck <tony.luck@intel.com> Tested-by: K Prateek Nayak <kprateek.nayak@amd.com> Tested-by: Zhang Rui <rui.zhang@intel.com> Tested-by: Chen Yu <yu.c.chen@intel.com> Tested-by: Kyle Meyer <kyle.meyer@hpe.com> Link: https://patch.msgid.link/20260303110100.123701837@infradead.org
1 parent ae6730f commit 717b64d

1 file changed

Lines changed: 3 additions & 10 deletions

File tree

arch/x86/kernel/smpboot.c

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -468,13 +468,6 @@ static int x86_cluster_flags(void)
468468
}
469469
#endif
470470

471-
/*
472-
* Set if a package/die has multiple NUMA nodes inside.
473-
* AMD Magny-Cours, Intel Cluster-on-Die, and Intel
474-
* Sub-NUMA Clustering have this.
475-
*/
476-
static bool x86_has_numa_in_package;
477-
478471
static struct sched_domain_topology_level x86_topology[] = {
479472
SDTL_INIT(tl_smt_mask, cpu_smt_flags, SMT),
480473
#ifdef CONFIG_SCHED_CLUSTER
@@ -496,7 +489,7 @@ static void __init build_sched_topology(void)
496489
* PKG domain since the NUMA domains will auto-magically create the
497490
* right spanning domains based on the SLIT.
498491
*/
499-
if (x86_has_numa_in_package) {
492+
if (topology_num_nodes_per_package() > 1) {
500493
unsigned int pkgdom = ARRAY_SIZE(x86_topology) - 2;
501494

502495
memset(&x86_topology[pkgdom], 0, sizeof(x86_topology[pkgdom]));
@@ -550,7 +543,7 @@ int arch_sched_node_distance(int from, int to)
550543
case INTEL_GRANITERAPIDS_X:
551544
case INTEL_ATOM_DARKMONT_X:
552545

553-
if (!x86_has_numa_in_package || topology_max_packages() == 1 ||
546+
if (topology_max_packages() == 1 || topology_num_nodes_per_package() == 1 ||
554547
d < REMOTE_DISTANCE)
555548
return d;
556549

@@ -606,7 +599,7 @@ void set_cpu_sibling_map(int cpu)
606599
o = &cpu_data(i);
607600

608601
if (match_pkg(c, o) && !topology_same_node(c, o))
609-
x86_has_numa_in_package = true;
602+
WARN_ON_ONCE(topology_num_nodes_per_package() == 1);
610603

611604
if ((i == cpu) || (has_smt && match_smt(c, o)))
612605
link_mask(topology_sibling_cpumask, cpu, i);

0 commit comments

Comments
 (0)