cpufreq: intel_pstate: Show different max frequency with turbo 3 and HWP
Subsystems (2)
Srinivas Pandruvada
maintainerPATCH 1/1 cpufreq: intel_pstate: Show different max frequency with turbo 3 and HWP
On HWP platforms with Turbo 3.0, the HWP capability max ratio shows the maximum ratio of that core, which can be different than other cores. If we show the correct maximum frequency in cpufreq sysfs via cpuinfo_max_freq and scaling_max_freq then, user can know which cores can run faster for pinning some high priority tasks.
Currently the max turbo frequency is shown as max frequency, which is the max of all cores, even if some cores can't reach that frequency even for single threaded workload.
But it is possible that max ratio in HWP capabilities is set as 0xFF or some high invalid value (E.g. One KBL NUC). Since the actual performance can never exceed 1 core turbo frequency from MSR TURBO_RATIO_LIMIT, we use this as a bound check.
--- drivers/cpufreq/intel_pstate.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/cpufreq/intel_pstate.c +9 -0
@@ -2072,6 +2072,15 @@ static int __intel_pstate_cpu_init(struct cpufreq_policy *policy) cpu->pstate.max_pstate : cpu->pstate.turbo_pstate; policy->cpuinfo.max_freq *= cpu->pstate.scaling; +if (hwp_active) { +unsigned int max_freq; + + max_freq = global.turbo_disabled ? + cpu->pstate.max_freq : cpu->pstate.turbo_freq; +if (max_freq < policy->cpuinfo.max_freq) + policy->cpuinfo.max_freq = max_freq; + } +intel_pstate_init_acpi_perf_limits (policy); policy->fast_switch_possible = true;
Signature · 1 line
2.17.0
Rafael J. Wysocki
AppliedQuoted 31 lines · CEST Srinivas Pandruvada
On HWP platforms with Turbo 3.0, the HWP capability max ratio shows the maximum ratio of that core, which can be different than other cores. If we show the correct maximum frequency in cpufreq sysfs via
cpuinfo_max_freqandscaling_max_freqthen, user can know which cores can run faster for pinning some high priority tasks.Currently the max turbo frequency is shown as max frequency, which is the max of all cores, even if some cores can't reach that frequency even for single threaded workload.
But it is possible that max ratio in HWP capabilities is set as
0xFFor some high invalid value (E.g. One KBL NUC). Since the actual performance can never exceed 1 core turbo frequency from MSRTURBO_RATIO_LIMIT, we use this as a bound check.Signed-off-by Srinivas Pandruvada <[email protected]>--- drivers/cpufreq/intel_pstate.c | 9 +++++++++ 1 file changed, 9 insertions(+)drivers/cpufreq/intel_pstate.c +2
-0@@ -2072,6 +2072,15 @@ static int __intel_pstate_cpu_init(struct cpufreq_policy *policy) cpu->pstate.max_pstate : cpu->pstate.turbo_pstate; policy->cpuinfo.max_freq *= cpu->pstate.scaling; +if (hwp_active) { +unsigned int max_freq;
drivers/cpufreq/intel_pstate.c static int __intel_pstate_cpu_init(struct cpufreq_policy *policy) · line 2086
Quoted 10 lines
drivers/cpufreq/intel_pstate.c +7
-0+ + max_freq = global.turbo_disabled ? + cpu->pstate.max_freq : cpu->pstate.turbo_freq; +if (max_freq < policy->cpuinfo.max_freq) + policy->cpuinfo.max_freq = max_freq; + } +intel_pstate_init_acpi_perf_limits (policy); policy->fast_switch_possible = true;
Applied, thanks!