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


Groups > linux.kernel > #1562070

[PATCH 2/4] cpufreq: intel_pstate: Lower frequency than expected under no_turbo

From Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Newsgroups linux.kernel
Subject [PATCH 2/4] cpufreq: intel_pstate: Lower frequency than expected under no_turbo
Date 2017-01-18 20:00 +0100
Message-ID <t13CG-7H3-43@gated-at.bofh.it> (permalink)
References <t13CF-7H3-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


When turbo is not disabled by BIOS, but user disabled from intel P-State
sysfs and changes max/min using cpufreq sysfs, the resultant frequency
is lower than what user requested.

The reason for this, when the perf limits are calculated in set_policy()
callback, they are with reference to max cpu frequency (turbo frequency
), but when enforced in the intel_pstate_get_min_max() they are with
reference to max available performance as documented in the intel_pstate
documentation (in this case max non turbo P-State).

This needs similar change as done in intel_cpufreq_verify_policy() for
passive mode. Set policy->cpuinfo.max_freq based on the turbo status.

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

diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
index a54d65a..a5f1a04 100644
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -2042,6 +2042,20 @@ static int intel_pstate_set_policy(struct cpufreq_policy *policy)
 
 static int intel_pstate_verify_policy(struct cpufreq_policy *policy)
 {
+	struct cpudata *cpu = all_cpu_data[policy->cpu];
+	struct perf_limits *perf_limits;
+
+	if (policy->policy == CPUFREQ_POLICY_PERFORMANCE)
+		perf_limits = &performance_limits;
+	else
+		perf_limits = &powersave_limits;
+
+	update_turbo_state();
+	policy->cpuinfo.max_freq = perf_limits->turbo_disabled ||
+					perf_limits->no_turbo ?
+					cpu->pstate.max_freq :
+					cpu->pstate.turbo_freq;
+
 	cpufreq_verify_within_cpu_limits(policy);
 
 	if (policy->policy != CPUFREQ_POLICY_POWERSAVE &&
-- 
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