* Re: [PATCH] cpufreq: ondemand: update frequency when limits are relaxed
[not found] <F22FC3EF73EF0942A7CD99A3AC5E4E1F380AF6B7BF@HQMAIL04.nvidia.com>
@ 2012-09-06 21:40 ` Rafael J. Wysocki
2012-09-07 8:13 ` Thomas Renninger
0 siblings, 1 reply; 3+ messages in thread
From: Rafael J. Wysocki @ 2012-09-06 21:40 UTC (permalink / raw)
To: Michal Pecio, Thomas Renninger
Cc: cpufreq@vger.kernel.org, linux-pm@vger.kernel.org,
ACPI Devel Mailing List
On Friday, August 31, 2012, Michal Pecio wrote:
> From: Michal Pecio <mpecio@nvidia.com>
>
> Reevaluate CPU load and update frequency immediately whenever limits
> are changed. Currently ondemand doesn't do so when limits are relaxed,
> wasting power on CPUs with relatively low sampling rate.
> Also, update the prev_cpu_* variables on frequency transitions. Their
> old values aren't valid anymore because the governor assumes constant
> frequency during entire sampling period.
>
> Signed-off-by: Michal Pecio <mpecio@nvidia.com>
Well, this makes sense to me.
Thomas, what do you think?
Rafael
> ---
>
> diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c
> index 1aaf7af..8cee63e 100644
> --- a/drivers/cpufreq/cpufreq_ondemand.c
> +++ b/drivers/cpufreq/cpufreq_ondemand.c
> @@ -754,12 +754,7 @@ static int cpufreq_governor_dbs(struct cpufreq_policy *policy,
>
> case CPUFREQ_GOV_LIMITS:
> mutex_lock(&this_dbs_info->timer_mutex);
> - if (policy->max < this_dbs_info->cur_policy->cur)
> - __cpufreq_driver_target(this_dbs_info->cur_policy,
> - policy->max, CPUFREQ_RELATION_H);
> - else if (policy->min > this_dbs_info->cur_policy->cur)
> - __cpufreq_driver_target(this_dbs_info->cur_policy,
> - policy->min, CPUFREQ_RELATION_L);
> + dbs_check_cpu(this_dbs_info);
> mutex_unlock(&this_dbs_info->timer_mutex);
> break;
> }
> -----------------------------------------------------------------------------------
> This email message is for the sole use of the intended recipient(s) and may contain
> confidential information. Any unauthorized review, use, disclosure or distribution
> is prohibited. If you are not the intended recipient, please contact the sender by
> reply email and destroy all copies of the original message.
> -----------------------------------------------------------------------------------
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] cpufreq: ondemand: update frequency when limits are relaxed
2012-09-06 21:40 ` [PATCH] cpufreq: ondemand: update frequency when limits are relaxed Rafael J. Wysocki
@ 2012-09-07 8:13 ` Thomas Renninger
2012-09-07 20:48 ` Rafael J. Wysocki
0 siblings, 1 reply; 3+ messages in thread
From: Thomas Renninger @ 2012-09-07 8:13 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: Michal Pecio, cpufreq@vger.kernel.org, linux-pm@vger.kernel.org,
ACPI Devel Mailing List
On Thursday, September 06, 2012 11:40:33 PM Rafael J. Wysocki wrote:
> On Friday, August 31, 2012, Michal Pecio wrote:
> > From: Michal Pecio <mpecio@nvidia.com>
> >
> > Reevaluate CPU load and update frequency immediately whenever limits
> > are changed. Currently ondemand doesn't do so when limits are relaxed,
> > wasting power on CPUs with relatively low sampling rate.
> > Also, update the prev_cpu_* variables on frequency transitions. Their
> > old values aren't valid anymore because the governor assumes constant
> > frequency during entire sampling period.
> >
> > Signed-off-by: Michal Pecio <mpecio@nvidia.com>
>
> Well, this makes sense to me.
>
> Thomas, what do you think?
Looks fine to me as well.
But the same should be done in the conservative driver as well then.
Could you send another, separate patch doing the same in
cpufreq_conservative.c.
Thanks,
Thomas
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] cpufreq: ondemand: update frequency when limits are relaxed
2012-09-07 8:13 ` Thomas Renninger
@ 2012-09-07 20:48 ` Rafael J. Wysocki
0 siblings, 0 replies; 3+ messages in thread
From: Rafael J. Wysocki @ 2012-09-07 20:48 UTC (permalink / raw)
To: Thomas Renninger
Cc: Michal Pecio, cpufreq@vger.kernel.org, linux-pm@vger.kernel.org,
ACPI Devel Mailing List
On Friday, September 07, 2012, Thomas Renninger wrote:
> On Thursday, September 06, 2012 11:40:33 PM Rafael J. Wysocki wrote:
> > On Friday, August 31, 2012, Michal Pecio wrote:
> > > From: Michal Pecio <mpecio@nvidia.com>
> > >
> > > Reevaluate CPU load and update frequency immediately whenever limits
> > > are changed. Currently ondemand doesn't do so when limits are relaxed,
> > > wasting power on CPUs with relatively low sampling rate.
> > > Also, update the prev_cpu_* variables on frequency transitions. Their
> > > old values aren't valid anymore because the governor assumes constant
> > > frequency during entire sampling period.
> > >
> > > Signed-off-by: Michal Pecio <mpecio@nvidia.com>
> >
> > Well, this makes sense to me.
> >
> > Thomas, what do you think?
> Looks fine to me as well.
> But the same should be done in the conservative driver as well then.
> Could you send another, separate patch doing the same in
> cpufreq_conservative.c.
Do you mean something like the appended patch?
Rafael
---
drivers/cpufreq/cpufreq_conservative.c | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
Index: linux/drivers/cpufreq/cpufreq_conservative.c
===================================================================
--- linux.orig/drivers/cpufreq/cpufreq_conservative.c
+++ linux/drivers/cpufreq/cpufreq_conservative.c
@@ -576,14 +576,7 @@ static int cpufreq_governor_dbs(struct c
case CPUFREQ_GOV_LIMITS:
mutex_lock(&this_dbs_info->timer_mutex);
- if (policy->max < this_dbs_info->cur_policy->cur)
- __cpufreq_driver_target(
- this_dbs_info->cur_policy,
- policy->max, CPUFREQ_RELATION_H);
- else if (policy->min > this_dbs_info->cur_policy->cur)
- __cpufreq_driver_target(
- this_dbs_info->cur_policy,
- policy->min, CPUFREQ_RELATION_L);
+ dbs_check_cpu(this_dbs_info);
mutex_unlock(&this_dbs_info->timer_mutex);
break;
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-09-07 20:48 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <F22FC3EF73EF0942A7CD99A3AC5E4E1F380AF6B7BF@HQMAIL04.nvidia.com>
2012-09-06 21:40 ` [PATCH] cpufreq: ondemand: update frequency when limits are relaxed Rafael J. Wysocki
2012-09-07 8:13 ` Thomas Renninger
2012-09-07 20:48 ` Rafael J. Wysocki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox