]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
cpufreq/amd-pstate: Update asym_prefer_cpu when core rankings change
authorK Prateek Nayak <kprateek.nayak@amd.com>
Wed, 9 Apr 2025 05:34:45 +0000 (05:34 +0000)
committerPeter Zijlstra <peterz@infradead.org>
Wed, 16 Apr 2025 19:09:11 +0000 (21:09 +0200)
A subset of AMD systems supporting Preferred Core rankings can have
their rankings changed dynamically at runtime. Update the
"sg->asym_prefer_cpu" across the local hierarchy of CPU when the
preferred core ranking changes.

Signed-off-by: K Prateek Nayak <kprateek.nayak@amd.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Mario Limonciello <mario.limonciello@amd.com>
Link: https://lore.kernel.org/r/20250409053446.23367-4-kprateek.nayak@amd.com
drivers/cpufreq/amd-pstate.c

index 6789eed1bb5ba00a6519a2c4c6d110c8f7abe27f..8796217ccc60ddec087b5b67e16527b6579372ba 100644 (file)
@@ -844,8 +844,10 @@ static void amd_pstate_update_limits(unsigned int cpu)
        if (highest_perf_changed) {
                WRITE_ONCE(cpudata->prefcore_ranking, cur_high);
 
-               if (cur_high < CPPC_MAX_PERF)
+               if (cur_high < CPPC_MAX_PERF) {
                        sched_set_itmt_core_prio((int)cur_high, cpu);
+                       sched_update_asym_prefer_cpu(cpu, prev_high, cur_high);
+               }
        }
 }