From a3d2a98d6efb9807d04314aafeae8fb44caf9d37 Mon Sep 17 00:00:00 2001 From: Andrea Righi Date: Thu, 19 Nov 2026 08:22:02 +0100 Subject: [PATCH] Revert "NVIDIA: VR: SAUCE: arm64: topology: Prefer PE0 on NVIDIA Olympus SMT cores" BugLink: https://bugs.launchpad.net/bugs/2174992 This reverts commit b81846eab0daf40e90db28e3b01bb31dd732cf7f. The upstream SMT packing override and idle sibling selection backports replace the Olympus-specific topology quirk. The override is enabled by default on arm64, preserving SMT sibling preference without CPU model detection. The retained quirk unconditionally sets SD_ASYM_PACKING on Olympus, so sched_smt_asym_packing=off cannot disable the preference. Remove the custom topology and its initialization hook so the boot option controls the override. Also remove the arm64 CPU priority override to restore the upstream default preference for lower-numbered logical CPUs. Signed-off-by: Andrea Righi --- arch/arm64/include/asm/topology.h | 1 - arch/arm64/kernel/smp.c | 1 - arch/arm64/kernel/topology.c | 51 ------------------------------- 3 files changed, 53 deletions(-) diff --git a/arch/arm64/include/asm/topology.h b/arch/arm64/include/asm/topology.h index edc1c59b3448d..b9eaf4ad70850 100644 --- a/arch/arm64/include/asm/topology.h +++ b/arch/arm64/include/asm/topology.h @@ -18,7 +18,6 @@ int pcibus_to_node(struct pci_bus *bus); #include void update_freq_counters_refs(void); -void arm64_init_sched_topology(void); /* Replace task scheduler's default frequency-invariant accounting */ #define arch_scale_freq_tick topology_scale_freq_tick diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c index 9ed54b4adcc21..17f9de67d34c3 100644 --- a/arch/arm64/kernel/smp.c +++ b/arch/arm64/kernel/smp.c @@ -441,7 +441,6 @@ void __init smp_cpus_done(unsigned int max_cpus) hyp_mode_check(); setup_system_features(); setup_user_features(); - arm64_init_sched_topology(); mark_linear_text_alias_ro(); } diff --git a/arch/arm64/kernel/topology.c b/arch/arm64/kernel/topology.c index 5d5019229c6b0..b4f6eb213aa89 100644 --- a/arch/arm64/kernel/topology.c +++ b/arch/arm64/kernel/topology.c @@ -19,8 +19,6 @@ #include #include #include -#include -#include #include #include @@ -46,55 +44,6 @@ static DEFINE_PER_CPU_READ_MOSTLY(unsigned long, arch_max_freq_scale) = 1UL << (2 * SCHED_CAPACITY_SHIFT); static cpumask_var_t amu_fie_cpus; -/* - * Switching the active PE on an NVIDIA Olympus SMT core can keep the core in - * two-thread active mode, with resources partitioned between the PEs. - * - * Prefer PE0 so PE1 can remain idle and the core can stay in full-resource - * mode. Firmware does not currently describe this preference, so detect - * Olympus by MIDR until a firmware interface is available. - */ -#ifdef CONFIG_SCHED_SMT -static int arm64_smt_flags(void) -{ - return cpu_smt_flags() | SD_ASYM_PACKING; -} -#endif - -static struct sched_domain_topology_level arm64_asym_smt_topology[] = { -#ifdef CONFIG_SCHED_SMT - SDTL_INIT(tl_smt_mask, arm64_smt_flags, SMT), -#endif -#ifdef CONFIG_SCHED_CLUSTER - SDTL_INIT(tl_cls_mask, cpu_cluster_flags, CLS), -#endif -#ifdef CONFIG_SCHED_MC - SDTL_INIT(tl_mc_mask, cpu_core_flags, MC), -#endif - SDTL_INIT(tl_pkg_mask, NULL, PKG), - { NULL, }, -}; - -void __init arm64_init_sched_topology(void) -{ - if (!IS_ENABLED(CONFIG_SCHED_SMT)) - return; - - if ((read_cpuid_id() & MIDR_CPU_MODEL_MASK) != MIDR_NVIDIA_OLYMPUS) - return; - - if (!topology_core_has_smt(smp_processor_id())) - return; - - set_sched_topology(arm64_asym_smt_topology); - pr_info("Enabling PE0 SMT preference for NVIDIA Olympus\n"); -} - -int arch_asym_cpu_priority(int cpu) -{ - return MPIDR_AFFINITY_LEVEL(cpu_logical_map(cpu), 0) == 0; -} - struct amu_cntr_sample { u64 arch_const_cycles_prev; u64 arch_core_cycles_prev;