* [PATCH] cpufreq / CPPC: Initialize policy->min to lowest nonlinear performance
@ 2017-05-11 22:39 Prashanth Prakash
2017-05-12 5:25 ` Viresh Kumar
2017-05-12 13:43 ` Alexey Klimov
0 siblings, 2 replies; 3+ messages in thread
From: Prashanth Prakash @ 2017-05-11 22:39 UTC (permalink / raw)
To: linux-pm
Cc: rjw, viresh.kumar, ahs3, hotran, alexey.klimov, Prashanth Prakash
Description of Lowest Perfomance in ACPI 6.1 specification states:
"Lowest Performance is the absolute lowest performance level of
the platform. Selecting a performance level lower than the lowest
nonlinear performance level may actually cause an efficiency penalty,
but should reduce the instantaneous power consumption of the processor.
In traditional terms, this represents the T-state range of performance
levels."
Set the default value of policy->min to Lowest Nonlinear Performance
to avoid any potential efficiency penalty.
Signed-off-by: Prashanth Prakash <pprakash@codeaurora.org>
---
drivers/cpufreq/cppc_cpufreq.c | 19 ++++++++++++++++---
1 file changed, 16 insertions(+), 3 deletions(-)
diff --git a/drivers/cpufreq/cppc_cpufreq.c b/drivers/cpufreq/cppc_cpufreq.c
index e82bb3c..10be285 100644
--- a/drivers/cpufreq/cppc_cpufreq.c
+++ b/drivers/cpufreq/cppc_cpufreq.c
@@ -144,10 +144,23 @@ static int cppc_cpufreq_cpu_init(struct cpufreq_policy *policy)
cppc_dmi_max_khz = cppc_get_dmi_max_khz();
- policy->min = cpu->perf_caps.lowest_perf * cppc_dmi_max_khz / cpu->perf_caps.highest_perf;
+ /*
+ * Set min to lowest nonlinear perf to avoid any efficiency penalty (see
+ * Section 8.4.7.1.1.5 of ACPI 6.1 spec)
+ */
+ policy->min = cpu->perf_caps.lowest_nonlinear_perf * cppc_dmi_max_khz /
+ cpu->perf_caps.highest_perf;
policy->max = cppc_dmi_max_khz;
- policy->cpuinfo.min_freq = policy->min;
- policy->cpuinfo.max_freq = policy->max;
+
+ /*
+ * Set cpuinfo.min_freq to Lowest to make the full range of performance
+ * available if userspace wants to use any perf between lowest & lowest
+ * nonlinear perf
+ */
+ policy->cpuinfo.min_freq = cpu->perf_caps.lowest_perf * cppc_dmi_max_khz /
+ cpu->perf_caps.highest_perf;
+ policy->cpuinfo.max_freq = cppc_dmi_max_khz;
+
policy->cpuinfo.transition_latency = cppc_get_transition_latency(cpu_num);
policy->shared_type = cpu->shared_type;
--
Qualcomm Datacenter Technologies on behalf of Qualcomm Technologies, Inc.
Qualcomm Technologies, Inc. is a member of the
Code Aurora Forum, a Linux Foundation Collaborative Project.
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] cpufreq / CPPC: Initialize policy->min to lowest nonlinear performance
2017-05-11 22:39 [PATCH] cpufreq / CPPC: Initialize policy->min to lowest nonlinear performance Prashanth Prakash
@ 2017-05-12 5:25 ` Viresh Kumar
2017-05-12 13:43 ` Alexey Klimov
1 sibling, 0 replies; 3+ messages in thread
From: Viresh Kumar @ 2017-05-12 5:25 UTC (permalink / raw)
To: Prashanth Prakash; +Cc: linux-pm, rjw, ahs3, hotran, alexey.klimov
On 11-05-17, 16:39, Prashanth Prakash wrote:
> Description of Lowest Perfomance in ACPI 6.1 specification states:
> "Lowest Performance is the absolute lowest performance level of
> the platform. Selecting a performance level lower than the lowest
> nonlinear performance level may actually cause an efficiency penalty,
> but should reduce the instantaneous power consumption of the processor.
> In traditional terms, this represents the T-state range of performance
> levels."
>
> Set the default value of policy->min to Lowest Nonlinear Performance
> to avoid any potential efficiency penalty.
>
> Signed-off-by: Prashanth Prakash <pprakash@codeaurora.org>
> ---
> drivers/cpufreq/cppc_cpufreq.c | 19 ++++++++++++++++---
> 1 file changed, 16 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/cpufreq/cppc_cpufreq.c b/drivers/cpufreq/cppc_cpufreq.c
> index e82bb3c..10be285 100644
> --- a/drivers/cpufreq/cppc_cpufreq.c
> +++ b/drivers/cpufreq/cppc_cpufreq.c
> @@ -144,10 +144,23 @@ static int cppc_cpufreq_cpu_init(struct cpufreq_policy *policy)
>
> cppc_dmi_max_khz = cppc_get_dmi_max_khz();
>
> - policy->min = cpu->perf_caps.lowest_perf * cppc_dmi_max_khz / cpu->perf_caps.highest_perf;
> + /*
> + * Set min to lowest nonlinear perf to avoid any efficiency penalty (see
> + * Section 8.4.7.1.1.5 of ACPI 6.1 spec)
> + */
> + policy->min = cpu->perf_caps.lowest_nonlinear_perf * cppc_dmi_max_khz /
> + cpu->perf_caps.highest_perf;
> policy->max = cppc_dmi_max_khz;
> - policy->cpuinfo.min_freq = policy->min;
> - policy->cpuinfo.max_freq = policy->max;
> +
> + /*
> + * Set cpuinfo.min_freq to Lowest to make the full range of performance
> + * available if userspace wants to use any perf between lowest & lowest
> + * nonlinear perf
> + */
> + policy->cpuinfo.min_freq = cpu->perf_caps.lowest_perf * cppc_dmi_max_khz /
> + cpu->perf_caps.highest_perf;
> + policy->cpuinfo.max_freq = cppc_dmi_max_khz;
> +
> policy->cpuinfo.transition_latency = cppc_get_transition_latency(cpu_num);
> policy->shared_type = cpu->shared_type;
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
--
viresh
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] cpufreq / CPPC: Initialize policy->min to lowest nonlinear performance
2017-05-11 22:39 [PATCH] cpufreq / CPPC: Initialize policy->min to lowest nonlinear performance Prashanth Prakash
2017-05-12 5:25 ` Viresh Kumar
@ 2017-05-12 13:43 ` Alexey Klimov
1 sibling, 0 replies; 3+ messages in thread
From: Alexey Klimov @ 2017-05-12 13:43 UTC (permalink / raw)
To: Prashanth Prakash; +Cc: linux-pm, rjw, viresh.kumar, ahs3, hotran
On Thu, May 11, 2017 at 04:39:44PM -0600, Prashanth Prakash wrote:
> Description of Lowest Perfomance in ACPI 6.1 specification states:
> "Lowest Performance is the absolute lowest performance level of
> the platform. Selecting a performance level lower than the lowest
> nonlinear performance level may actually cause an efficiency penalty,
> but should reduce the instantaneous power consumption of the processor.
> In traditional terms, this represents the T-state range of performance
> levels."
>
> Set the default value of policy->min to Lowest Nonlinear Performance
> to avoid any potential efficiency penalty.
>
> Signed-off-by: Prashanth Prakash <pprakash@codeaurora.org>
Acked-by: Alexey Klimov <alexey.klimov@arm.com>
Thanks,
Alexey
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-05-12 13:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-11 22:39 [PATCH] cpufreq / CPPC: Initialize policy->min to lowest nonlinear performance Prashanth Prakash
2017-05-12 5:25 ` Viresh Kumar
2017-05-12 13:43 ` Alexey Klimov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).