Skip to content

Commit 94dbce6

Browse files
Juan Martinezvireshk
authored andcommitted
cpufreq/amd-pstate: Add comment explaining nominal_perf usage for performance policy
Add comment explaining why nominal_perf is used for MinPerf when the CPU frequency policy is set to CPUFREQ_POLICY_PERFORMANCE, rather than using highest_perf or lowest_nonlinear_perf. Signed-off-by: Juan Martinez <juan.martinez@amd.com> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
1 parent 8c376f3 commit 94dbce6

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

drivers/cpufreq/amd-pstate.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,19 @@ static void amd_pstate_update_min_max_limit(struct cpufreq_policy *policy)
636636
WRITE_ONCE(cpudata->max_limit_freq, policy->max);
637637

638638
if (cpudata->policy == CPUFREQ_POLICY_PERFORMANCE) {
639+
/*
640+
* For performance policy, set MinPerf to nominal_perf rather than
641+
* highest_perf or lowest_nonlinear_perf.
642+
*
643+
* Per commit 0c411b39e4f4c, using highest_perf was observed
644+
* to cause frequency throttling on power-limited platforms, leading to
645+
* performance regressions. Using lowest_nonlinear_perf would limit
646+
* performance too much for HPC workloads requiring high frequency
647+
* operation and minimal wakeup latency from idle states.
648+
*
649+
* nominal_perf therefore provides a balance by avoiding throttling
650+
* while still maintaining enough performance for HPC workloads.
651+
*/
639652
perf.min_limit_perf = min(perf.nominal_perf, perf.max_limit_perf);
640653
WRITE_ONCE(cpudata->min_limit_freq, min(cpudata->nominal_freq, cpudata->max_limit_freq));
641654
} else {

0 commit comments

Comments
 (0)