linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] cpufreq: Fix ondemand governor powersave_bias execution time misuse
  2010-11-05 15:19 [PATCH] cpufreq: Fix ondemand governor powersave_bias execution time misuse Youquan Song
@ 2010-11-05 11:49 ` Arjan van de Ven
  2010-11-08 14:45   ` Youquan Song
  2011-03-02  1:07 ` Andrew Morton
  1 sibling, 1 reply; 7+ messages in thread
From: Arjan van de Ven @ 2010-11-05 11:49 UTC (permalink / raw)
  To: Youquan Song; +Cc: davej, venki, youquan.song, cpufreq-list, linux-kernel

On 11/5/2010 11:19 AM, Youquan Song wrote:
> Ondemand governor use powersave_bias tunable to do aggressive power save by
> decrease CPU average frequency. The average frequency achieve by adjust low and
> high frequency's execution time proportion during one sample time interval.
>
> Current kernel, only the high frequency executes in time proportion, but the low
> frequency wrongly execute in one whole sample time interval when powersave_bias
> is set.
>
> The patch fix it by set low frequency execution time to it deserved.
>
> Signed-off-by: Youquan Song<youquan.song@intel.com>
> ---


while your patch looks correct, I think the whole feature is wonky and 
likely ought to be removed...........


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH] cpufreq: Fix ondemand governor powersave_bias execution time misuse
@ 2010-11-05 15:19 Youquan Song
  2010-11-05 11:49 ` Arjan van de Ven
  2011-03-02  1:07 ` Andrew Morton
  0 siblings, 2 replies; 7+ messages in thread
From: Youquan Song @ 2010-11-05 15:19 UTC (permalink / raw)
  To: davej; +Cc: arjan, venki, youquan.song, cpufreq-list, linux-kernel

Ondemand governor use powersave_bias tunable to do aggressive power save by
decrease CPU average frequency. The average frequency achieve by adjust low and
high frequency's execution time proportion during one sample time interval.  

Current kernel, only the high frequency executes in time proportion, but the low
frequency wrongly execute in one whole sample time interval when powersave_bias
is set.  

The patch fix it by set low frequency execution time to it deserved. 

Signed-off-by: Youquan Song <youquan.song@intel.com>
---

diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c
index c631f27..01d84fa 100644
--- a/drivers/cpufreq/cpufreq_ondemand.c
+++ b/drivers/cpufreq/cpufreq_ondemand.c
@@ -666,6 +666,8 @@ static void do_dbs_timer(struct work_struct *work)
 	} else {
 		__cpufreq_driver_target(dbs_info->cur_policy,
 			dbs_info->freq_lo, CPUFREQ_RELATION_H);
+		if (dbs_info->sample_type == DBS_SUB_SAMPLE)
+			delay = dbs_info->freq_lo_jiffies;
 	}
 	queue_delayed_work_on(cpu, kondemand_wq, &dbs_info->work, delay);
 	mutex_unlock(&dbs_info->timer_mutex);

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] cpufreq: Fix ondemand governor powersave_bias execution time misuse
  2010-11-08 14:45   ` Youquan Song
@ 2010-11-08  4:32     ` Arjan van de Ven
  0 siblings, 0 replies; 7+ messages in thread
From: Arjan van de Ven @ 2010-11-08  4:32 UTC (permalink / raw)
  To: Youquan Song; +Cc: davej, venki, youquan.song, cpufreq, linux-kernel

On 11/8/2010 6:45 AM, Youquan Song wrote:
>> On 11/5/2010 11:19 AM, Youquan Song wrote:
>>> Ondemand governor use powersave_bias tunable to do aggressive power save by
>>> decrease CPU average frequency. The average frequency achieve by adjust low and
>>> high frequency's execution time proportion during one sample time interval.
>>>
>>> Current kernel, only the high frequency executes in time proportion, but the low
>>> frequency wrongly execute in one whole sample time interval when powersave_bias
>>> is set.
>>>
>>> The patch fix it by set low frequency execution time to it deserved.
>>>
>>> Signed-off-by: Youquan Song<youquan.song@intel.com>
>>> ---
>>
>> while your patch looks correct, I think the whole feature is wonky and
>> likely ought to be removed...........
> powersave_bias should be a useful feature, which give user an
> opportunity to set the CPU to work at wider average frequency accord to real
>   workload requirement, not just CPU frequency specific at P0,P1,...Pn.
> At the same time, it meets end user power comsumpation requirement in
> some degree.
> Unfortunately, it does not work for a long time.

in all measurements I've done... the intermediate states (between P1 and 
Pn) seem to not be power efficient.....


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] cpufreq: Fix ondemand governor powersave_bias execution time misuse
  2010-11-05 11:49 ` Arjan van de Ven
@ 2010-11-08 14:45   ` Youquan Song
  2010-11-08  4:32     ` Arjan van de Ven
  0 siblings, 1 reply; 7+ messages in thread
From: Youquan Song @ 2010-11-08 14:45 UTC (permalink / raw)
  To: Arjan van de Ven
  Cc: Youquan Song, davej, venki, youquan.song, cpufreq, linux-kernel

> On 11/5/2010 11:19 AM, Youquan Song wrote:
>> Ondemand governor use powersave_bias tunable to do aggressive power save by
>> decrease CPU average frequency. The average frequency achieve by adjust low and
>> high frequency's execution time proportion during one sample time interval.
>>
>> Current kernel, only the high frequency executes in time proportion, but the low
>> frequency wrongly execute in one whole sample time interval when powersave_bias
>> is set.
>>
>> The patch fix it by set low frequency execution time to it deserved.
>>
>> Signed-off-by: Youquan Song<youquan.song@intel.com>
>> ---
>
>
> while your patch looks correct, I think the whole feature is wonky and 
> likely ought to be removed...........

powersave_bias should be a useful feature, which give user an
opportunity to set the CPU to work at wider average frequency accord to real
 workload requirement, not just CPU frequency specific at P0,P1,...Pn.
At the same time, it meets end user power comsumpation requirement in
some degree. 
Unfortunately, it does not work for a long time.

Thanks
-Youquan

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] cpufreq: Fix ondemand governor powersave_bias execution time misuse
  2010-11-05 15:19 [PATCH] cpufreq: Fix ondemand governor powersave_bias execution time misuse Youquan Song
  2010-11-05 11:49 ` Arjan van de Ven
@ 2011-03-02  1:07 ` Andrew Morton
  2011-03-02 18:58   ` Youquan Song
  1 sibling, 1 reply; 7+ messages in thread
From: Andrew Morton @ 2011-03-02  1:07 UTC (permalink / raw)
  To: Youquan Song
  Cc: davej, arjan, venki, youquan.song, cpufreq-list, linux-kernel

On Fri, 5 Nov 2010 11:19:51 -0400
Youquan Song <youquan.song@linux.intel.com> wrote:

> Ondemand governor use powersave_bias tunable to do aggressive power save by
> decrease CPU average frequency. The average frequency achieve by adjust low and
> high frequency's execution time proportion during one sample time interval.  
> 
> Current kernel, only the high frequency executes in time proportion, but the low
> frequency wrongly execute in one whole sample time interval when powersave_bias
> is set.  
> 
> The patch fix it by set low frequency execution time to it deserved. 
> 
> Signed-off-by: Youquan Song <youquan.song@intel.com>
> ---
> 
> diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c
> index c631f27..01d84fa 100644
> --- a/drivers/cpufreq/cpufreq_ondemand.c
> +++ b/drivers/cpufreq/cpufreq_ondemand.c
> @@ -666,6 +666,8 @@ static void do_dbs_timer(struct work_struct *work)
>  	} else {
>  		__cpufreq_driver_target(dbs_info->cur_policy,
>  			dbs_info->freq_lo, CPUFREQ_RELATION_H);
> +		if (dbs_info->sample_type == DBS_SUB_SAMPLE)
> +			delay = dbs_info->freq_lo_jiffies;
>  	}
>  	queue_delayed_work_on(cpu, kondemand_wq, &dbs_info->work, delay);
>  	mutex_unlock(&dbs_info->timer_mutex);

Where are we with this patch?  Still needed in curent mainline?

Thnks.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] cpufreq: Fix ondemand governor powersave_bias execution time misuse
  2011-03-02 18:58   ` Youquan Song
@ 2011-03-02 16:00     ` Dave Jones
  0 siblings, 0 replies; 7+ messages in thread
From: Dave Jones @ 2011-03-02 16:00 UTC (permalink / raw)
  To: Youquan Song
  Cc: Andrew Morton, arjan, venki, youquan.song, cpufreq-list,
	linux-kernel, vincent.guittot

On Wed, Mar 02, 2011 at 01:58:02PM -0500, Youquan Song wrote:
 >  
 > > Where are we with this patch?  Still needed in curent mainline?
 > Do need it by current mainline. Without the patch, the ondemand
 > power_bias feature is broken and does not work at all.
 > Please take it.

This patch from Vincent Guittot is also pending, which seems to achieve
the same thing ?


commit 1f5a2969af7e0d040876c7ff25308c840eef18d4
Author: Vincent Guittot <vincent.guittot@linaro.org>
Date:   Mon Feb 7 17:14:25 2011 +0100

    [CPUFREQ] calculate delay after dbs_check_cpu
    
    calculate ondemand delay after dbs_check_cpu call because it can
    modify rate_mult value
    
    use freq_lo_jiffies value for the sub sample period of powersave_bias mode
    
    Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
    Signed-off-by: Dave Jones <davej@redhat.com>

diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c
index c631f27..b4e1f98 100644
--- a/drivers/cpufreq/cpufreq_ondemand.c
+++ b/drivers/cpufreq/cpufreq_ondemand.c
@@ -644,12 +644,7 @@ static void do_dbs_timer(struct work_struct *work)
 	unsigned int cpu = dbs_info->cpu;
 	int sample_type = dbs_info->sample_type;
 
-	/* We want all CPUs to do sampling nearly on same jiffy */
-	int delay = usecs_to_jiffies(dbs_tuners_ins.sampling_rate
-		* dbs_info->rate_mult);
-
-	if (num_online_cpus() > 1)
-		delay -= jiffies % delay;
+	int delay;
 
 	mutex_lock(&dbs_info->timer_mutex);
 
@@ -662,10 +657,20 @@ static void do_dbs_timer(struct work_struct *work)
 			/* Setup timer for SUB_SAMPLE */
 			dbs_info->sample_type = DBS_SUB_SAMPLE;
 			delay = dbs_info->freq_hi_jiffies;
+		} else {
+			/* We want all CPUs to do sampling nearly on
+			 * same jiffy
+			 */
+			delay = usecs_to_jiffies(dbs_tuners_ins.sampling_rate
+				* dbs_info->rate_mult);
+
+			if (num_online_cpus() > 1)
+				delay -= jiffies % delay;
 		}
 	} else {
 		__cpufreq_driver_target(dbs_info->cur_policy,
 			dbs_info->freq_lo, CPUFREQ_RELATION_H);
+		delay = dbs_info->freq_lo_jiffies;
 	}
 	queue_delayed_work_on(cpu, kondemand_wq, &dbs_info->work, delay);
 	mutex_unlock(&dbs_info->timer_mutex);

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] cpufreq: Fix ondemand governor powersave_bias execution time misuse
  2011-03-02  1:07 ` Andrew Morton
@ 2011-03-02 18:58   ` Youquan Song
  2011-03-02 16:00     ` Dave Jones
  0 siblings, 1 reply; 7+ messages in thread
From: Youquan Song @ 2011-03-02 18:58 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Youquan Song, davej, arjan, venki, youquan.song, cpufreq-list,
	linux-kernel

 
> Where are we with this patch?  Still needed in curent mainline?
Do need it by current mainline. Without the patch, the ondemand
power_bias feature is broken and does not work at all.
Please take it.

Thanks
-Youquan
 

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-03-02 16:01 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-05 15:19 [PATCH] cpufreq: Fix ondemand governor powersave_bias execution time misuse Youquan Song
2010-11-05 11:49 ` Arjan van de Ven
2010-11-08 14:45   ` Youquan Song
2010-11-08  4:32     ` Arjan van de Ven
2011-03-02  1:07 ` Andrew Morton
2011-03-02 18:58   ` Youquan Song
2011-03-02 16:00     ` Dave Jones

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).