Jean-Christian, On Thu, Mar 25, 2010 at 09:59:44PM +0100, Jean-Christian Goussard wrote: > Le 25/03/2010 18:44, Dominik Brodowski a écrit : > > Subject: [PATCH] cpufreq: use average load in conservative governor > > > > Instead of using the load of the last CPU in a package, use the > > average of all CPUs in a package. > > Don't we want to check the max load rather than the average, for a user > running a single threaded job wants the CPU to jump to max speed? You're right -- that's what I implemented first (that's why there was a max_load variable). Then I was mis-lead to believe averaging out (e.g. on two 50%-jobs) would be a better idea. But that's the scheduler's task, not the governor's. Thanks, Dominik From: Dominik Brodowski <linux@xxxxxxxxxxxxxxxxxxxx> Date: Fri, 26 Mar 2010 10:00:20 +0100 Subject: [PATCH] cpufreq: use max load in conservative governor Instead of using the load of the last CPU in a package, use the maximum load of all CPUs in a package. Reported-by: Jean-Christian Goussard <jeanchristian.goussard@xxxxxx> Signed-off-by: Dominik Brodowski <linux@xxxxxxxxxxxxxxxxxxxx> diff --git a/drivers/cpufreq/cpufreq_conservative.c b/drivers/cpufreq/cpufreq_conservative.c index 599a40b..3a14787 100644 --- a/drivers/cpufreq/cpufreq_conservative.c +++ b/drivers/cpufreq/cpufreq_conservative.c @@ -444,6 +444,7 @@ static struct attribute_group dbs_attr_group_old = { static void dbs_check_cpu(struct cpu_dbs_info_s *this_dbs_info) { unsigned int load = 0; + unsigned int max_load = 0; unsigned int freq_target; struct cpufreq_policy *policy; @@ -501,6 +502,9 @@ static void dbs_check_cpu(struct cpu_dbs_info_s *this_dbs_info) continue; load = 100 * (wall_time - idle_time) / wall_time; + + if (load > max_load) + max_load = load; } /* @@ -511,7 +515,7 @@ static void dbs_check_cpu(struct cpu_dbs_info_s *this_dbs_info) return; /* Check for frequency increase */ - if (load > dbs_tuners_ins.up_threshold) { + if (max_load > dbs_tuners_ins.up_threshold) { this_dbs_info->down_skip = 0; /* if we are already at full speed then break out early */ @@ -538,7 +542,7 @@ static void dbs_check_cpu(struct cpu_dbs_info_s *this_dbs_info) * can support the current CPU usage without triggering the up * policy. To be safe, we focus 10 points under the threshold. */ - if (load < (dbs_tuners_ins.down_threshold - 10)) { + if (max_load < (dbs_tuners_ins.down_threshold - 10)) { freq_target = (dbs_tuners_ins.freq_step * policy->max) / 100; this_dbs_info->requested_freq -= freq_target; -- To unsubscribe from this list: send the line "unsubscribe cpufreq" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html