Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1562060

[PATCH 3/4] cpufreq: intel_pstate: Make HWP limits compatible with legacy

From Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Newsgroups linux.kernel
Subject [PATCH 3/4] cpufreq: intel_pstate: Make HWP limits compatible with legacy
Date 2017-01-18 20:00 +0100
Message-ID <t13CF-7H3-17@gated-at.bofh.it> (permalink)
References <t13CF-7H3-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Under HWP the performance limits are calculated using max_perf_pct
and min_perf_pct using possible performance, not available performance.
The available performance can be reduced by no_turbo setting. To make
compatible with legacy mode, use max/min performance percentage with
respect to available performance.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
---
 drivers/cpufreq/intel_pstate.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
index a5f1a04..095bcaf 100644
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -873,7 +873,10 @@ static void intel_pstate_hwp_set(struct cpufreq_policy *policy)
 
 		rdmsrl_on_cpu(cpu, MSR_HWP_CAPABILITIES, &cap);
 		hw_min = HWP_LOWEST_PERF(cap);
-		hw_max = HWP_HIGHEST_PERF(cap);
+		if (limits->no_turbo)
+			hw_max = HWP_GUARANTEED_PERF(cap);
+		else
+			hw_max = HWP_HIGHEST_PERF(cap);
 		range = hw_max - hw_min;
 
 		max_perf_pct = perf_limits->max_perf_pct;
@@ -887,11 +890,6 @@ static void intel_pstate_hwp_set(struct cpufreq_policy *policy)
 
 		adj_range = max_perf_pct * range / 100;
 		max = hw_min + adj_range;
-		if (limits->no_turbo) {
-			hw_max = HWP_GUARANTEED_PERF(cap);
-			if (hw_max < max)
-				max = hw_max;
-		}
 
 		value &= ~HWP_MAX_PERF(~0L);
 		value |= HWP_MAX_PERF(max);
-- 
2.7.4

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/4] Fixes for limits enforcement Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> - 2017-01-18 20:00 +0100
  [PATCH 3/4] cpufreq: intel_pstate: Make HWP limits compatible with legacy Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> - 2017-01-18 20:00 +0100
  [PATCH 4/4] cpufreq: intel_pstate: Calculate guaranteed performance for HWP Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> - 2017-01-18 20:00 +0100
  [PATCH 1/4] cpufreq: intel_pstate: Fix sysfs limits enforcement for performance policy Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> - 2017-01-18 20:00 +0100
  [PATCH 2/4] cpufreq: intel_pstate: Lower frequency than expected under no_turbo Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> - 2017-01-18 20:00 +0100
  Re: [PATCH 0/4] Fixes for limits enforcement "Rafael J. Wysocki" <rafael@kernel.org> - 2017-01-20 03:20 +0100

csiph-web