* [PATCH v2 0/4] cpufreq governors and Intel P state driver compatibility
@ 2015-12-08 22:31 Srinivas Pandruvada
2015-12-08 22:31 ` [PATCH v2 1/4] cpufreq: Add configurable generic policies Srinivas Pandruvada
` (5 more replies)
0 siblings, 6 replies; 12+ messages in thread
From: Srinivas Pandruvada @ 2015-12-08 22:31 UTC (permalink / raw)
To: rafael.j.wysocki, viresh.kumar
Cc: linux-pm, prarit, trenn, Srinivas Pandruvada
Intel P State driver implements two policies, performance and powersave.
The powersave policy is similar to ondemand cpufreq governor when using
acpi-cpufreq. This causes lots of confusion among users. This results
in invalid comparison of performance when acpi-cpufreq and Intel P state
performance is compared.
The reason Intel P state called powersave when it actually implemented
ondemand style P State selection, because the cpufreq core only allows
two generic policies "performance and powersave" for drivers which has
setpolicy() interface. All drivers using this interface are forced to
support these two policies.
This patchset adds feature to have configurable generic policies and
allows ondemand as one of the policy. With this approach, Intel P state
now adds support for ondemand policy and power save policy both in
addition to performance.
v2
- Suggestion by Viresh to remove callback to get policies
- Document update for cpufreq cpu-drivers
- Dropped powersave patch, so that it will still default to ondemand
as a possible option suggested by Thomas.
If it breaks any distros are user, who were using Intel P state driver with
powersave, please comment.
v1
base version
To be done:
Intel P state document update
Srinivas Pandruvada (4):
cpufreq: Add configurable generic policies
cpufreq: Add ondemand as a generic policy
Documentation: cpu-freq: update setpolicy documentation
cpufreq: intel_pstate: Change powersave to ondemand policy
Documentation/cpu-freq/cpu-drivers.txt | 9 +++++++--
drivers/cpufreq/cpufreq.c | 17 ++++++++++++++++-
drivers/cpufreq/intel_pstate.c | 14 ++++++++------
include/linux/cpufreq.h | 4 +++-
4 files changed, 34 insertions(+), 10 deletions(-)
--
2.4.3
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH v2 1/4] cpufreq: Add configurable generic policies
2015-12-08 22:31 [PATCH v2 0/4] cpufreq governors and Intel P state driver compatibility Srinivas Pandruvada
@ 2015-12-08 22:31 ` Srinivas Pandruvada
2015-12-09 2:18 ` Viresh Kumar
2015-12-08 22:31 ` [PATCH v2 2/4] cpufreq: Add ondemand as a generic policy Srinivas Pandruvada
` (4 subsequent siblings)
5 siblings, 1 reply; 12+ messages in thread
From: Srinivas Pandruvada @ 2015-12-08 22:31 UTC (permalink / raw)
To: rafael.j.wysocki, viresh.kumar
Cc: linux-pm, prarit, trenn, Srinivas Pandruvada
For drivers using cpufreq_driver->setpolicy callback, by default two
policies are available (performance and powersave). The client drivers
can't change them, even if there is no support for a policy.
This change adds a new field "available_policies" in the struct
cpufreq_policy. The client driver can optionally set this field during
init() callback. If the client driver doesn't set this field then the
default policies are "performance powersave" matching current
implementation.
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
---
drivers/cpufreq/cpufreq.c | 9 ++++++++-
include/linux/cpufreq.h | 1 +
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 8412ce5..286eaec 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -688,7 +688,10 @@ static ssize_t show_scaling_available_governors(struct cpufreq_policy *policy,
struct cpufreq_governor *t;
if (!has_target()) {
- i += sprintf(buf, "performance powersave");
+ if (policy->available_policies & CPUFREQ_POLICY_PERFORMANCE)
+ i += sprintf(buf, "performance ");
+ if (policy->available_policies & CPUFREQ_POLICY_POWERSAVE)
+ i += sprintf(&buf[i], "powersave ");
goto out;
}
@@ -966,6 +969,10 @@ static int cpufreq_init_policy(struct cpufreq_policy *policy)
memcpy(&new_policy, policy, sizeof(*policy));
+ if (!policy->available_policies)
+ policy->available_policies = CPUFREQ_POLICY_PERFORMANCE |
+ CPUFREQ_POLICY_POWERSAVE;
+
/* Update governor of new_policy to the governor used before hotplug */
gov = find_governor(policy->last_governor);
if (gov)
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index 177c768..7cc17df 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -76,6 +76,7 @@ struct cpufreq_policy {
unsigned int restore_freq; /* = policy->cur before transition */
unsigned int suspend_freq; /* freq to set during suspend */
+ u8 available_policies;
unsigned int policy; /* see above */
unsigned int last_policy; /* policy before unplug */
struct cpufreq_governor *governor; /* see below */
--
2.4.3
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v2 2/4] cpufreq: Add ondemand as a generic policy
2015-12-08 22:31 [PATCH v2 0/4] cpufreq governors and Intel P state driver compatibility Srinivas Pandruvada
2015-12-08 22:31 ` [PATCH v2 1/4] cpufreq: Add configurable generic policies Srinivas Pandruvada
@ 2015-12-08 22:31 ` Srinivas Pandruvada
2015-12-08 22:31 ` [PATCH v2 3/4] Documentation: cpu-freq: update setpolicy documentation Srinivas Pandruvada
` (3 subsequent siblings)
5 siblings, 0 replies; 12+ messages in thread
From: Srinivas Pandruvada @ 2015-12-08 22:31 UTC (permalink / raw)
To: rafael.j.wysocki, viresh.kumar
Cc: linux-pm, prarit, trenn, Srinivas Pandruvada
Allow ondemand policy as a supported generic policy. Client drivers can
enable this policy by setting struct cpufreq->available_policies during
init() callback.
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
---
drivers/cpufreq/cpufreq.c | 8 ++++++++
include/linux/cpufreq.h | 3 ++-
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 286eaec..7d45fb6 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -528,6 +528,10 @@ static int cpufreq_parse_governor(char *str_governor, unsigned int *policy,
CPUFREQ_NAME_LEN)) {
*policy = CPUFREQ_POLICY_POWERSAVE;
err = 0;
+ } else if (!strncasecmp(str_governor, "ondemand",
+ CPUFREQ_NAME_LEN)) {
+ *policy = CPUFREQ_POLICY_ONDEMAND;
+ err = 0;
}
} else {
struct cpufreq_governor *t;
@@ -640,6 +644,8 @@ static ssize_t show_scaling_governor(struct cpufreq_policy *policy, char *buf)
return sprintf(buf, "powersave\n");
else if (policy->policy == CPUFREQ_POLICY_PERFORMANCE)
return sprintf(buf, "performance\n");
+ else if (policy->policy == CPUFREQ_POLICY_ONDEMAND)
+ return sprintf(buf, "ondemand\n");
else if (policy->governor)
return scnprintf(buf, CPUFREQ_NAME_PLEN, "%s\n",
policy->governor->name);
@@ -692,6 +698,8 @@ static ssize_t show_scaling_available_governors(struct cpufreq_policy *policy,
i += sprintf(buf, "performance ");
if (policy->available_policies & CPUFREQ_POLICY_POWERSAVE)
i += sprintf(&buf[i], "powersave ");
+ if (policy->available_policies & CPUFREQ_POLICY_ONDEMAND)
+ i += sprintf(&buf[i], "ondemand ");
goto out;
}
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index 7cc17df..0b9e119 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -230,7 +230,7 @@ struct cpufreq_driver {
int (*init)(struct cpufreq_policy *policy);
int (*verify)(struct cpufreq_policy *policy);
- /* define one out of two */
+ /* define one out of three */
int (*setpolicy)(struct cpufreq_policy *policy);
/*
@@ -432,6 +432,7 @@ static inline unsigned long cpufreq_scale(unsigned long old, u_int div,
*/
#define CPUFREQ_POLICY_POWERSAVE (1)
#define CPUFREQ_POLICY_PERFORMANCE (2)
+#define CPUFREQ_POLICY_ONDEMAND (4)
/* Governor Events */
#define CPUFREQ_GOV_START 1
--
2.4.3
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v2 3/4] Documentation: cpu-freq: update setpolicy documentation
2015-12-08 22:31 [PATCH v2 0/4] cpufreq governors and Intel P state driver compatibility Srinivas Pandruvada
2015-12-08 22:31 ` [PATCH v2 1/4] cpufreq: Add configurable generic policies Srinivas Pandruvada
2015-12-08 22:31 ` [PATCH v2 2/4] cpufreq: Add ondemand as a generic policy Srinivas Pandruvada
@ 2015-12-08 22:31 ` Srinivas Pandruvada
2015-12-09 2:19 ` Viresh Kumar
2015-12-08 22:31 ` [PATCH v2 4/4] cpufreq: intel_pstate: Change powersave to ondemand policy Srinivas Pandruvada
` (2 subsequent siblings)
5 siblings, 1 reply; 12+ messages in thread
From: Srinivas Pandruvada @ 2015-12-08 22:31 UTC (permalink / raw)
To: rafael.j.wysocki, viresh.kumar
Cc: linux-pm, prarit, trenn, Srinivas Pandruvada
Updated documentation for usage of setpolicy interface.
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
---
Documentation/cpu-freq/cpu-drivers.txt | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/Documentation/cpu-freq/cpu-drivers.txt b/Documentation/cpu-freq/cpu-drivers.txt
index 14f4e63..144e0ad 100644
--- a/Documentation/cpu-freq/cpu-drivers.txt
+++ b/Documentation/cpu-freq/cpu-drivers.txt
@@ -195,8 +195,13 @@ argument. You need to set the lower limit of the in-processor or
in-chipset dynamic frequency switching to policy->min, the upper limit
to policy->max, and -if supported- select a performance-oriented
setting when policy->policy is CPUFREQ_POLICY_PERFORMANCE, and a
-powersaving-oriented setting when CPUFREQ_POLICY_POWERSAVE. Also check
-the reference implementation in drivers/cpufreq/longrun.c
+powersaving-oriented setting when CPUFREQ_POLICY_POWERSAVE, and a
+optional on demand frequency scaling setting when
+CPUFREQ_POLICY_ONDEMAND. The default supported policies are
+CPUFREQ_POLICY_PERFORMANCE and CPUFREQ_POLICY_POWERSAVE. To change or
+add supported policies set policy->available_policies with a mask of
+supported policies. Also check the reference implementation in
+drivers/cpufreq/longrun.c and intel_pstate.c.
1.7 get_intermediate and target_intermediate
--------------------------------------------
--
2.4.3
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v2 4/4] cpufreq: intel_pstate: Change powersave to ondemand policy
2015-12-08 22:31 [PATCH v2 0/4] cpufreq governors and Intel P state driver compatibility Srinivas Pandruvada
` (2 preceding siblings ...)
2015-12-08 22:31 ` [PATCH v2 3/4] Documentation: cpu-freq: update setpolicy documentation Srinivas Pandruvada
@ 2015-12-08 22:31 ` Srinivas Pandruvada
2015-12-08 23:45 ` [PATCH v2 0/4] cpufreq governors and Intel P state driver compatibility Prarit Bhargava
2015-12-16 19:33 ` Srinivas Pandruvada
5 siblings, 0 replies; 12+ messages in thread
From: Srinivas Pandruvada @ 2015-12-08 22:31 UTC (permalink / raw)
To: rafael.j.wysocki, viresh.kumar
Cc: linux-pm, prarit, trenn, Srinivas Pandruvada
Move the current Intel powersave policy processing to ondemand policy.
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
---
drivers/cpufreq/intel_pstate.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
index fb92402..76108e6 100644
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -176,7 +176,7 @@ static struct perf_limits performance_limits = {
.min_sysfs_pct = 0,
};
-static struct perf_limits powersave_limits = {
+static struct perf_limits ondemand_limits = {
.no_turbo = 0,
.turbo_disabled = 0,
.max_perf_pct = 100,
@@ -192,7 +192,7 @@ static struct perf_limits powersave_limits = {
#ifdef CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE
static struct perf_limits *limits = &performance_limits;
#else
-static struct perf_limits *limits = &powersave_limits;
+static struct perf_limits *limits = &ondemand_limits;
#endif
static inline void pid_reset(struct _pid *pid, int setpoint, int busy,
@@ -1143,8 +1143,8 @@ static int intel_pstate_set_policy(struct cpufreq_policy *policy)
return 0;
}
- pr_debug("intel_pstate: set powersave\n");
- limits = &powersave_limits;
+ pr_debug("intel_pstate: set ondemand\n");
+ limits = &ondemand_limits;
limits->min_policy_pct = (policy->min * 100) / policy->cpuinfo.max_freq;
limits->min_policy_pct = clamp_t(int, limits->min_policy_pct, 0 , 100);
limits->max_policy_pct = DIV_ROUND_UP(policy->max * 100,
@@ -1180,7 +1180,7 @@ static int intel_pstate_verify_policy(struct cpufreq_policy *policy)
{
cpufreq_verify_within_cpu_limits(policy);
- if (policy->policy != CPUFREQ_POLICY_POWERSAVE &&
+ if (policy->policy != CPUFREQ_POLICY_ONDEMAND &&
policy->policy != CPUFREQ_POLICY_PERFORMANCE)
return -EINVAL;
@@ -1215,8 +1215,10 @@ static int intel_pstate_cpu_init(struct cpufreq_policy *policy)
if (limits->min_perf_pct == 100 && limits->max_perf_pct == 100)
policy->policy = CPUFREQ_POLICY_PERFORMANCE;
else
- policy->policy = CPUFREQ_POLICY_POWERSAVE;
+ policy->policy = CPUFREQ_POLICY_ONDEMAND;
+ policy->available_policies = CPUFREQ_POLICY_PERFORMANCE |
+ CPUFREQ_POLICY_ONDEMAND;
policy->min = cpu->pstate.min_pstate * cpu->pstate.scaling;
policy->max = cpu->pstate.turbo_pstate * cpu->pstate.scaling;
--
2.4.3
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH v2 0/4] cpufreq governors and Intel P state driver compatibility
2015-12-08 22:31 [PATCH v2 0/4] cpufreq governors and Intel P state driver compatibility Srinivas Pandruvada
` (3 preceding siblings ...)
2015-12-08 22:31 ` [PATCH v2 4/4] cpufreq: intel_pstate: Change powersave to ondemand policy Srinivas Pandruvada
@ 2015-12-08 23:45 ` Prarit Bhargava
2015-12-08 23:57 ` Srinivas Pandruvada
2015-12-16 19:33 ` Srinivas Pandruvada
5 siblings, 1 reply; 12+ messages in thread
From: Prarit Bhargava @ 2015-12-08 23:45 UTC (permalink / raw)
To: Srinivas Pandruvada, rafael.j.wysocki, viresh.kumar; +Cc: linux-pm, trenn
On 12/08/2015 05:31 PM, Srinivas Pandruvada wrote:
> Intel P State driver implements two policies, performance and powersave.
> The powersave policy is similar to ondemand cpufreq governor when using
> acpi-cpufreq. This causes lots of confusion among users. This results
> in invalid comparison of performance when acpi-cpufreq and Intel P state
> performance is compared.
>
> The reason Intel P state called powersave when it actually implemented
> ondemand style P State selection, because the cpufreq core only allows
> two generic policies "performance and powersave" for drivers which has
> setpolicy() interface. All drivers using this interface are forced to
> support these two policies.
>
> This patchset adds feature to have configurable generic policies and
> allows ondemand as one of the policy. With this approach, Intel P state
> now adds support for ondemand policy and power save policy both in
> addition to performance.
Srinivas, if I read the patchset correctly then this means that ondemand ==
powersave ?
If so, is the intention to one day remove powersave altogether and switch to
only ondemand & performance?
P.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v2 0/4] cpufreq governors and Intel P state driver compatibility
2015-12-08 23:45 ` [PATCH v2 0/4] cpufreq governors and Intel P state driver compatibility Prarit Bhargava
@ 2015-12-08 23:57 ` Srinivas Pandruvada
2015-12-09 13:12 ` Prarit Bhargava
0 siblings, 1 reply; 12+ messages in thread
From: Srinivas Pandruvada @ 2015-12-08 23:57 UTC (permalink / raw)
To: Prarit Bhargava; +Cc: rafael.j.wysocki, viresh.kumar, linux-pm, trenn
On Tue, 2015-12-08 at 18:45 -0500, Prarit Bhargava wrote:
>
> On 12/08/2015 05:31 PM, Srinivas Pandruvada wrote:
> > Intel P State driver implements two policies, performance and powersave.
> > The powersave policy is similar to ondemand cpufreq governor when using
> > acpi-cpufreq. This causes lots of confusion among users. This results
> > in invalid comparison of performance when acpi-cpufreq and Intel P state
> > performance is compared.
> >
> > The reason Intel P state called powersave when it actually implemented
> > ondemand style P State selection, because the cpufreq core only allows
> > two generic policies "performance and powersave" for drivers which has
> > setpolicy() interface. All drivers using this interface are forced to
> > support these two policies.
> >
> > This patchset adds feature to have configurable generic policies and
> > allows ondemand as one of the policy. With this approach, Intel P state
> > now adds support for ondemand policy and power save policy both in
> > addition to performance.
>
Prarit,
> Srinivas, if I read the patchset correctly then this means that ondemand ==
> powersave ?
Yes. Will it cause problem to you?
>
> If so, is the intention to one day remove powersave altogether and switch to
> only ondemand & performance?
Yes. But we can add powersave, which all requests P state to max
efficiency ratio. But I want to check, if it will this cause more
confusion.
Thanks,
Srinivas
>
> P.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v2 1/4] cpufreq: Add configurable generic policies
2015-12-08 22:31 ` [PATCH v2 1/4] cpufreq: Add configurable generic policies Srinivas Pandruvada
@ 2015-12-09 2:18 ` Viresh Kumar
0 siblings, 0 replies; 12+ messages in thread
From: Viresh Kumar @ 2015-12-09 2:18 UTC (permalink / raw)
To: Srinivas Pandruvada; +Cc: rafael.j.wysocki, linux-pm, prarit, trenn
On 08-12-15, 14:31, Srinivas Pandruvada wrote:
> For drivers using cpufreq_driver->setpolicy callback, by default two
> policies are available (performance and powersave). The client drivers
> can't change them, even if there is no support for a policy.
> This change adds a new field "available_policies" in the struct
> cpufreq_policy. The client driver can optionally set this field during
> init() callback. If the client driver doesn't set this field then the
> default policies are "performance powersave" matching current
> implementation.
>
> Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
> ---
> drivers/cpufreq/cpufreq.c | 9 ++++++++-
> include/linux/cpufreq.h | 1 +
> 2 files changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
> index 8412ce5..286eaec 100644
> --- a/drivers/cpufreq/cpufreq.c
> +++ b/drivers/cpufreq/cpufreq.c
> @@ -688,7 +688,10 @@ static ssize_t show_scaling_available_governors(struct cpufreq_policy *policy,
> struct cpufreq_governor *t;
>
> if (!has_target()) {
> - i += sprintf(buf, "performance powersave");
> + if (policy->available_policies & CPUFREQ_POLICY_PERFORMANCE)
> + i += sprintf(buf, "performance ");
> + if (policy->available_policies & CPUFREQ_POLICY_POWERSAVE)
> + i += sprintf(&buf[i], "powersave ");
> goto out;
> }
>
> @@ -966,6 +969,10 @@ static int cpufreq_init_policy(struct cpufreq_policy *policy)
>
> memcpy(&new_policy, policy, sizeof(*policy));
>
> + if (!policy->available_policies)
> + policy->available_policies = CPUFREQ_POLICY_PERFORMANCE |
> + CPUFREQ_POLICY_POWERSAVE;
> +
> /* Update governor of new_policy to the governor used before hotplug */
> gov = find_governor(policy->last_governor);
> if (gov)
> diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
> index 177c768..7cc17df 100644
> --- a/include/linux/cpufreq.h
> +++ b/include/linux/cpufreq.h
> @@ -76,6 +76,7 @@ struct cpufreq_policy {
> unsigned int restore_freq; /* = policy->cur before transition */
> unsigned int suspend_freq; /* freq to set during suspend */
>
> + u8 available_policies;
> unsigned int policy; /* see above */
> unsigned int last_policy; /* policy before unplug */
> struct cpufreq_governor *governor; /* see below */
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
--
viresh
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v2 3/4] Documentation: cpu-freq: update setpolicy documentation
2015-12-08 22:31 ` [PATCH v2 3/4] Documentation: cpu-freq: update setpolicy documentation Srinivas Pandruvada
@ 2015-12-09 2:19 ` Viresh Kumar
0 siblings, 0 replies; 12+ messages in thread
From: Viresh Kumar @ 2015-12-09 2:19 UTC (permalink / raw)
To: Srinivas Pandruvada; +Cc: rafael.j.wysocki, linux-pm, prarit, trenn
On 08-12-15, 14:31, Srinivas Pandruvada wrote:
> Updated documentation for usage of setpolicy interface.
>
> Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
> ---
> Documentation/cpu-freq/cpu-drivers.txt | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/Documentation/cpu-freq/cpu-drivers.txt b/Documentation/cpu-freq/cpu-drivers.txt
> index 14f4e63..144e0ad 100644
> --- a/Documentation/cpu-freq/cpu-drivers.txt
> +++ b/Documentation/cpu-freq/cpu-drivers.txt
> @@ -195,8 +195,13 @@ argument. You need to set the lower limit of the in-processor or
> in-chipset dynamic frequency switching to policy->min, the upper limit
> to policy->max, and -if supported- select a performance-oriented
> setting when policy->policy is CPUFREQ_POLICY_PERFORMANCE, and a
> -powersaving-oriented setting when CPUFREQ_POLICY_POWERSAVE. Also check
> -the reference implementation in drivers/cpufreq/longrun.c
> +powersaving-oriented setting when CPUFREQ_POLICY_POWERSAVE, and a
> +optional on demand frequency scaling setting when
> +CPUFREQ_POLICY_ONDEMAND. The default supported policies are
> +CPUFREQ_POLICY_PERFORMANCE and CPUFREQ_POLICY_POWERSAVE. To change or
> +add supported policies set policy->available_policies with a mask of
> +supported policies. Also check the reference implementation in
> +drivers/cpufreq/longrun.c and intel_pstate.c.
>
> 1.7 get_intermediate and target_intermediate
> --------------------------------------------
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
--
viresh
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v2 0/4] cpufreq governors and Intel P state driver compatibility
2015-12-08 23:57 ` Srinivas Pandruvada
@ 2015-12-09 13:12 ` Prarit Bhargava
2015-12-09 16:18 ` Srinivas Pandruvada
0 siblings, 1 reply; 12+ messages in thread
From: Prarit Bhargava @ 2015-12-09 13:12 UTC (permalink / raw)
To: Srinivas Pandruvada; +Cc: rafael.j.wysocki, viresh.kumar, linux-pm, trenn
On 12/08/2015 06:57 PM, Srinivas Pandruvada wrote:
> On Tue, 2015-12-08 at 18:45 -0500, Prarit Bhargava wrote:
>>
>> On 12/08/2015 05:31 PM, Srinivas Pandruvada wrote:
>>> Intel P State driver implements two policies, performance and powersave.
>>> The powersave policy is similar to ondemand cpufreq governor when using
>>> acpi-cpufreq. This causes lots of confusion among users. This results
>>> in invalid comparison of performance when acpi-cpufreq and Intel P state
>>> performance is compared.
>>>
>>> The reason Intel P state called powersave when it actually implemented
>>> ondemand style P State selection, because the cpufreq core only allows
>>> two generic policies "performance and powersave" for drivers which has
>>> setpolicy() interface. All drivers using this interface are forced to
>>> support these two policies.
>>>
>>> This patchset adds feature to have configurable generic policies and
>>> allows ondemand as one of the policy. With this approach, Intel P state
>>> now adds support for ondemand policy and power save policy both in
>>> addition to performance.
>>
> Prarit,
>> Srinivas, if I read the patchset correctly then this means that ondemand ==
>> powersave ?
> Yes. Will it cause problem to you?
Nope :) I like that option. I was just asking to make sure I understood
the nature of the change.
>>
>> If so, is the intention to one day remove powersave altogether and switch to
>> only ondemand & performance?
> Yes. But we can add powersave, which all requests P state to max
> efficiency ratio. But I want to check, if it will this cause more
> confusion.
>
I'm thinking of end users -- we (Red Hat, but I'm pretty sure this applies
to all distributions) have spent a significant amount of effort in educating
users about the differences between the cpufreq and intel-pstate governors.
Google search yields several results detailing the difference between the
powersave and userspace governors as well, so I think that making changes at
this point, especially after years of use, will only lead to more confusion
for users.
IOW, I agree with the technical argument, but I think that our users will
really be confused.
P.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v2 0/4] cpufreq governors and Intel P state driver compatibility
2015-12-09 13:12 ` Prarit Bhargava
@ 2015-12-09 16:18 ` Srinivas Pandruvada
0 siblings, 0 replies; 12+ messages in thread
From: Srinivas Pandruvada @ 2015-12-09 16:18 UTC (permalink / raw)
To: Prarit Bhargava; +Cc: rafael.j.wysocki, viresh.kumar, linux-pm, trenn
On Wed, 2015-12-09 at 08:12 -0500, Prarit Bhargava wrote:
>
> On 12/08/2015 06:57 PM, Srinivas Pandruvada wrote:
> > On Tue, 2015-12-08 at 18:45 -0500, Prarit Bhargava wrote:
> > >
> > > On 12/08/2015 05:31 PM, Srinivas Pandruvada wrote:
> > > > Intel P State driver implements two policies, performance and
> > > > powersave.
> > > > The powersave policy is similar to ondemand cpufreq governor
> > > > when using
> > > > acpi-cpufreq. This causes lots of confusion among users. This
> > > > results
> > > > in invalid comparison of performance when acpi-cpufreq and
> > > > Intel P state
> > > > performance is compared.
> > > >
> > > > The reason Intel P state called powersave when it actually
> > > > implemented
> > > > ondemand style P State selection, because the cpufreq core only
> > > > allows
> > > > two generic policies "performance and powersave" for drivers
> > > > which has
> > > > setpolicy() interface. All drivers using this interface are
> > > > forced to
> > > > support these two policies.
> > > >
> > > > This patchset adds feature to have configurable generic
> > > > policies and
> > > > allows ondemand as one of the policy. With this approach, Intel
> > > > P state
> > > > now adds support for ondemand policy and power save policy both
> > > > in
> > > > addition to performance.
> > >
> > Prarit,
> > > Srinivas, if I read the patchset correctly then this means that
> > > ondemand ==
> > > powersave ?
> > Yes. Will it cause problem to you?
>
> Nope :) I like that option. I was just asking to make sure I
> understood
> the nature of the change.
>
> > >
> > > If so, is the intention to one day remove powersave altogether
> > > and switch to
> > > only ondemand & performance?
> > Yes. But we can add powersave, which all requests P state to max
> > efficiency ratio. But I want to check, if it will this cause more
> > confusion.
> >
>
> I'm thinking of end users -- we (Red Hat, but I'm pretty sure this
> applies
> to all distributions) have spent a significant amount of effort in
> educating
> users about the differences between the cpufreq and intel-pstate
> governors.
>
> Google search yields several results detailing the difference between
> the
> powersave and userspace governors as well, so I think that making
> changes at
> this point, especially after years of use, will only lead to more
> confusion
> for users.
>
Good point. We have customers in both camps. This is tough one.
> IOW, I agree with the technical argument, but I think that our users
> will
> really be confused.
>
Thanks,
Srinivas
> P.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v2 0/4] cpufreq governors and Intel P state driver compatibility
2015-12-08 22:31 [PATCH v2 0/4] cpufreq governors and Intel P state driver compatibility Srinivas Pandruvada
` (4 preceding siblings ...)
2015-12-08 23:45 ` [PATCH v2 0/4] cpufreq governors and Intel P state driver compatibility Prarit Bhargava
@ 2015-12-16 19:33 ` Srinivas Pandruvada
5 siblings, 0 replies; 12+ messages in thread
From: Srinivas Pandruvada @ 2015-12-16 19:33 UTC (permalink / raw)
To: prarit, trenn, Wysocki, Rafael J; +Cc: viresh.kumar, linux-pm
On Tue, 2015-12-08 at 14:31 -0800, Srinivas Pandruvada wrote:
> Intel P State driver implements two policies, performance and powersave.
> The powersave policy is similar to ondemand cpufreq governor when using
> acpi-cpufreq. This causes lots of confusion among users. This results
> in invalid comparison of performance when acpi-cpufreq and Intel P state
> performance is compared.
>
> The reason Intel P state called powersave when it actually implemented
> ondemand style P State selection, because the cpufreq core only allows
> two generic policies "performance and powersave" for drivers which has
> setpolicy() interface. All drivers using this interface are forced to
> support these two policies.
>
> This patchset adds feature to have configurable generic policies and
> allows ondemand as one of the policy. With this approach, Intel P state
> now adds support for ondemand policy and power save policy both in
> addition to performance.
>
Since there is negative feedback from Redhat and Suse as this will cause
more confusion to their customers, I will drop this patchset.
Thanks for reviews and feedback.
Thanks,
Srinivas
>
> v2
> - Suggestion by Viresh to remove callback to get policies
> - Document update for cpufreq cpu-drivers
> - Dropped powersave patch, so that it will still default to ondemand
> as a possible option suggested by Thomas.
>
> If it breaks any distros are user, who were using Intel P state driver with
> powersave, please comment.
>
> v1
> base version
>
> To be done:
> Intel P state document update
>
> Srinivas Pandruvada (4):
> cpufreq: Add configurable generic policies
> cpufreq: Add ondemand as a generic policy
> Documentation: cpu-freq: update setpolicy documentation
> cpufreq: intel_pstate: Change powersave to ondemand policy
>
> Documentation/cpu-freq/cpu-drivers.txt | 9 +++++++--
> drivers/cpufreq/cpufreq.c | 17 ++++++++++++++++-
> drivers/cpufreq/intel_pstate.c | 14 ++++++++------
> include/linux/cpufreq.h | 4 +++-
> 4 files changed, 34 insertions(+), 10 deletions(-)
>
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2015-12-16 19:34 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-08 22:31 [PATCH v2 0/4] cpufreq governors and Intel P state driver compatibility Srinivas Pandruvada
2015-12-08 22:31 ` [PATCH v2 1/4] cpufreq: Add configurable generic policies Srinivas Pandruvada
2015-12-09 2:18 ` Viresh Kumar
2015-12-08 22:31 ` [PATCH v2 2/4] cpufreq: Add ondemand as a generic policy Srinivas Pandruvada
2015-12-08 22:31 ` [PATCH v2 3/4] Documentation: cpu-freq: update setpolicy documentation Srinivas Pandruvada
2015-12-09 2:19 ` Viresh Kumar
2015-12-08 22:31 ` [PATCH v2 4/4] cpufreq: intel_pstate: Change powersave to ondemand policy Srinivas Pandruvada
2015-12-08 23:45 ` [PATCH v2 0/4] cpufreq governors and Intel P state driver compatibility Prarit Bhargava
2015-12-08 23:57 ` Srinivas Pandruvada
2015-12-09 13:12 ` Prarit Bhargava
2015-12-09 16:18 ` Srinivas Pandruvada
2015-12-16 19:33 ` Srinivas Pandruvada
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).