Commit fd187aaf authored by Dominik Brodowski's avatar Dominik Brodowski Committed by Dave Jones

[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: default avatarJean-Christian Goussard <jeanchristian.goussard@sfr.fr>
Signed-off-by: default avatarDominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: default avatarDave Jones <davej@redhat.com>
parent 499bca9b
...@@ -444,6 +444,7 @@ static struct attribute_group dbs_attr_group_old = { ...@@ -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) static void dbs_check_cpu(struct cpu_dbs_info_s *this_dbs_info)
{ {
unsigned int load = 0; unsigned int load = 0;
unsigned int max_load = 0;
unsigned int freq_target; unsigned int freq_target;
struct cpufreq_policy *policy; struct cpufreq_policy *policy;
...@@ -501,6 +502,9 @@ static void dbs_check_cpu(struct cpu_dbs_info_s *this_dbs_info) ...@@ -501,6 +502,9 @@ static void dbs_check_cpu(struct cpu_dbs_info_s *this_dbs_info)
continue; continue;
load = 100 * (wall_time - idle_time) / wall_time; 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) ...@@ -511,7 +515,7 @@ static void dbs_check_cpu(struct cpu_dbs_info_s *this_dbs_info)
return; return;
/* Check for frequency increase */ /* 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; this_dbs_info->down_skip = 0;
/* if we are already at full speed then break out early */ /* 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) ...@@ -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 * can support the current CPU usage without triggering the up
* policy. To be safe, we focus 10 points under the threshold. * 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; freq_target = (dbs_tuners_ins.freq_step * policy->max) / 100;
this_dbs_info->requested_freq -= freq_target; this_dbs_info->requested_freq -= freq_target;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment