Skip to content

Commit cabdc3a

Browse files
author
Peter Zijlstra
committed
sched,x86: Don't use cluster topology for x86 hybrid CPUs
For x86 hybrid CPUs like Alder Lake, the order of CPU selection should be based strictly on CPU priority. Don't include cluster topology for hybrid CPUs to avoid interference with such CPU selection order. On Alder Lake, the Atom CPU cluster has more capacity (4 Atom CPUs) vs Big core cluster (2 hyperthread CPUs). This could potentially bias CPU selection towards Atom over Big Core, when Big core CPU has higher priority. Fixes: 66558b7 ("sched: Add cluster scheduler level for x86") Suggested-by: Tim Chen <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Acked-by: Tim Chen <[email protected]> Tested-by: Ricardo Neri <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent 0fcfb00 commit cabdc3a

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

arch/x86/kernel/smpboot.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,17 @@ static struct sched_domain_topology_level x86_numa_in_package_topology[] = {
579579
{ NULL, },
580580
};
581581

582+
static struct sched_domain_topology_level x86_hybrid_topology[] = {
583+
#ifdef CONFIG_SCHED_SMT
584+
{ cpu_smt_mask, x86_smt_flags, SD_INIT_NAME(SMT) },
585+
#endif
586+
#ifdef CONFIG_SCHED_MC
587+
{ cpu_coregroup_mask, x86_core_flags, SD_INIT_NAME(MC) },
588+
#endif
589+
{ cpu_cpu_mask, SD_INIT_NAME(DIE) },
590+
{ NULL, },
591+
};
592+
582593
static struct sched_domain_topology_level x86_topology[] = {
583594
#ifdef CONFIG_SCHED_SMT
584595
{ cpu_smt_mask, x86_smt_flags, SD_INIT_NAME(SMT) },
@@ -1469,8 +1480,11 @@ void __init native_smp_cpus_done(unsigned int max_cpus)
14691480

14701481
calculate_max_logical_packages();
14711482

1483+
/* XXX for now assume numa-in-package and hybrid don't overlap */
14721484
if (x86_has_numa_in_package)
14731485
set_sched_topology(x86_numa_in_package_topology);
1486+
if (cpu_feature_enabled(X86_FEATURE_HYBRID_CPU))
1487+
set_sched_topology(x86_hybrid_topology);
14741488

14751489
nmi_selftest();
14761490
impress_friends();

0 commit comments

Comments
 (0)