cpufreq: intel_pstate: set stale CPU frequency to minimum
Subsystems (3)
PATCH 1/1 cpufreq: intel_pstate: set stale CPU frequency to minimum
From: Doug Smythies <[email protected]>
commit d51847acb018d83186e4af67bc93f9a00a8644f7 upstream.
This fix applies to all stable kernel versions 5.18+.
The intel_pstate CPU frequency scaling driver does not use policy->cur and it is 0.
When the CPU frequency is outdated arch_freq_get_on_cpu() will default to the nominal clock frequency when its call to cpufreq_quick_getpolicy_cur returns the never updated 0. Thus, the listed frequency might be outside of currently set limits. Some users are complaining about the high reported frequency, albeit stale, when their system is idle and/or it is above the reduced maximum they have set.
This patch will maintain policy_cur for the intel_pstate driver at the current minimum CPU frequency.
--- drivers/cpufreq/intel_pstate.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/cpufreq/intel_pstate.c +5 -0
@@ -2574,6 +2574,11 @@ static int intel_pstate_set_policy(struct cpufreq_policy *policy)intel_pstate_clear_update_util_hook (policy->cpu);intel_pstate_hwp_set (policy->cpu); } +/* +* policy->cur is never updated with the intel_pstate driver, but it +* is used as a stale frequency value. So, keep it within limits. +*/ + policy->cur = policy->min;mutex_unlock (&intel_pstate_limits_lock);
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerQuoted 25 lines · Keyon Jie
From: Doug Smythies <[email protected]>
commit
d51847acb018d83186e4af67bc93f9a00a8644f7upstream.This fix applies to all stable kernel versions 5.18+.
The
intel_pstateCPU frequency scaling driver does not usepolicy->curand it is 0.
When the CPU frequency is outdatedarch_freq_get_on_cpu()will default to the nominal clock frequency when its call tocpufreq_quick_getpolicy_curreturns the never updated 0. Thus, the listed frequency might be outside of currently set limits. Some users are complaining about the high reported frequency, albeit stale, when their system is idle and/or it is above the reduced maximum they have set.This patch will maintain
policy_curfor theintel_pstatedriver at the current minimum CPU frequency.Reported-by Yang Jie <[email protected]>Signed-off-by Doug Smythies <[email protected]>[ rjw: White space damage fixes and comment adjustment ]Signed-off-by Rafael J. Wysocki <[email protected]>Signed-off-by Keyon Jie <[email protected]>
Quoted 3 lines
--- drivers/cpufreq/intel_pstate.c | 5 +++++ 1 file changed, 5 insertions(+)
What stable kernel(s) is this for?
Quoted 30 lines · Greg Kroah-Hartman
Quoted 25 lines · Keyon Jie
From: Doug Smythies <[email protected]>
commit
d51847acb018d83186e4af67bc93f9a00a8644f7upstream.This fix applies to all stable kernel versions 5.18+.
The
intel_pstateCPU frequency scaling driver does not usepolicy->curand it is 0.
When the CPU frequency is outdatedarch_freq_get_on_cpu()will default to the nominal clock frequency when its call tocpufreq_quick_getpolicy_curreturns the never updated 0. Thus, the listed frequency might be outside of currently set limits. Some users are complaining about the high reported frequency, albeit stale, when their system is idle and/or it is above the reduced maximum they have set.This patch will maintain
policy_curfor theintel_pstatedriver at the current minimum CPU frequency.Reported-by Yang Jie <[email protected]>Signed-off-by Doug Smythies <[email protected]>[ rjw: White space damage fixes and comment adjustment ]Signed-off-by Rafael J. Wysocki <[email protected]>Signed-off-by Keyon Jie <[email protected]>Quoted 3 lines
--- drivers/cpufreq/intel_pstate.c | 5 +++++ 1 file changed, 5 insertions(+)
Quoted 1 line
What stable kernel(s) is this for?
Sorry missed it. We need it for all 5.18+ kernel, but I have only verified it on linux-6.1.y.
Thanks,
~Keyon
Greg Kroah-Hartman
maintainerQuoted 35 lines · Keyon Jie
From: Doug Smythies <[email protected]>
commit
d51847acb018d83186e4af67bc93f9a00a8644f7upstream.This fix applies to all stable kernel versions 5.18+.
The
intel_pstateCPU frequency scaling driver does not usepolicy->curand it is 0.
When the CPU frequency is outdatedarch_freq_get_on_cpu()will default to the nominal clock frequency when its call tocpufreq_quick_getpolicy_curreturns the never updated 0. Thus, the listed frequency might be outside of currently set limits. Some users are complaining about the high reported frequency, albeit stale, when their system is idle and/or it is above the reduced maximum they have set.This patch will maintain
policy_curfor theintel_pstatedriver at the current minimum CPU frequency.Reported-by Yang Jie <[email protected]>Signed-off-by Doug Smythies <[email protected]>[ rjw: White space damage fixes and comment adjustment ]Signed-off-by Rafael J. Wysocki <[email protected]>Signed-off-by Keyon Jie <[email protected]>--- drivers/cpufreq/intel_pstate.c | 5 +++++ 1 file changed, 5 insertions(+)drivers/cpufreq/intel_pstate.c +0
-0@@ -2574,6 +2574,11 @@ static int intel_pstate_set_policy(struct cpufreq_policy *policy)intel_pstate_clear_update_util_hook (policy->cpu);
drivers/cpufreq/intel_pstate.c static int intel_pstate_set_policy(struct cpufreq_policy *policy) · line 2584
Quoted 10 lines
drivers/cpufreq/intel_pstate.c +5
-0intel_pstate_hwp_set (policy->cpu); } +/* +* policy->cur is never updated with the intel_pstate driver, but it +* is used as a stale frequency value. So, keep it within limits. +*/ + policy->cur = policy->min;mutex_unlock (&intel_pstate_limits_lock);
Now queued up, thanks.
greg k-h