aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2017-06-28 19:47:56 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2017-06-29 17:25:15 -0400
commitfab24dcc395637557a7988a867e7b3a5823917a9 (patch)
tree60ee8ea39209e33ca5c0b99b343b6de5623ace81
parent82b4e03e01bc8def546b52707962809f04ae5c7a (diff)
cpufreq: intel_pstate: Clean up after performance governor changes
After commit 82b4e03e01bc (intel_pstate: skip scheduler hook when in "performance" mode) get_target_pstate_use_performance() and get_target_pstate_use_cpu_load() are never called if scaling_governor is "performance", so drop the CPUFREQ_POLICY_PERFORMANCE checks from them as they will never trigger anyway. Moreover, the documentation needs to be updated to reflect the change made by the above commit, so do that too. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
-rw-r--r--Documentation/admin-guide/pm/intel_pstate.rst6
-rw-r--r--drivers/cpufreq/intel_pstate.c6
2 files changed, 2 insertions, 10 deletions
diff --git a/Documentation/admin-guide/pm/intel_pstate.rst b/Documentation/admin-guide/pm/intel_pstate.rst
index 33d703989ea8..1d6249825efc 100644
--- a/Documentation/admin-guide/pm/intel_pstate.rst
+++ b/Documentation/admin-guide/pm/intel_pstate.rst
@@ -157,10 +157,8 @@ Without HWP, this P-state selection algorithm is always the same regardless of
157the processor model and platform configuration. 157the processor model and platform configuration.
158 158
159It selects the maximum P-state it is allowed to use, subject to limits set via 159It selects the maximum P-state it is allowed to use, subject to limits set via
160``sysfs``, every time the P-state selection computations are carried out by the 160``sysfs``, every time the driver configuration for the given CPU is updated
161driver's utilization update callback for the given CPU (that does not happen 161(e.g. via ``sysfs``).
162more often than every 10 ms), but the hardware configuration will not be changed
163if the new P-state is the same as the current one.
164 162
165This is the default P-state selection algorithm if the 163This is the default P-state selection algorithm if the
166:c:macro:`CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE` kernel configuration option 164:c:macro:`CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE` kernel configuration option
diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
index 1772d309bea9..756483251832 100644
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -1620,9 +1620,6 @@ static inline int32_t get_target_pstate_use_cpu_load(struct cpudata *cpu)
1620 int32_t busy_frac, boost; 1620 int32_t busy_frac, boost;
1621 int target, avg_pstate; 1621 int target, avg_pstate;
1622 1622
1623 if (cpu->policy == CPUFREQ_POLICY_PERFORMANCE)
1624 return cpu->pstate.turbo_pstate;
1625
1626 busy_frac = div_fp(sample->mperf, sample->tsc); 1623 busy_frac = div_fp(sample->mperf, sample->tsc);
1627 1624
1628 boost = cpu->iowait_boost; 1625 boost = cpu->iowait_boost;
@@ -1659,9 +1656,6 @@ static inline int32_t get_target_pstate_use_performance(struct cpudata *cpu)
1659 int32_t perf_scaled, max_pstate, current_pstate, sample_ratio; 1656 int32_t perf_scaled, max_pstate, current_pstate, sample_ratio;
1660 u64 duration_ns; 1657 u64 duration_ns;
1661 1658
1662 if (cpu->policy == CPUFREQ_POLICY_PERFORMANCE)
1663 return cpu->pstate.turbo_pstate;
1664
1665 /* 1659 /*
1666 * perf_scaled is the ratio of the average P-state during the last 1660 * perf_scaled is the ratio of the average P-state during the last
1667 * sampling period to the P-state requested last time (in percent). 1661 * sampling period to the P-state requested last time (in percent).