public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [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

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