diff options
| author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2017-03-19 09:30:02 -0400 |
|---|---|---|
| committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2017-03-20 20:03:08 -0400 |
| commit | 4296f23ed49a15d36949458adcc66ff993dee2a8 (patch) | |
| tree | e2c20f28627ea313e6439e4aa5600c3bc48bda96 | |
| parent | 97da3854c526d3a6ee05c849c96e48d21527606c (diff) | |
cpufreq: schedutil: Fix per-CPU structure initialization in sugov_start()
sugov_start() only initializes struct sugov_cpu per-CPU structures
for shared policies, but it should do that for single-CPU policies too.
That in particular makes the IO-wait boost mechanism work in the
cases when cpufreq policies correspond to individual CPUs.
Fixes: 21ca6d2c52f8 (cpufreq: schedutil: Add iowait boosting)
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Cc: 4.9+ <stable@vger.kernel.org> # 4.9+
| -rw-r--r-- | kernel/sched/cpufreq_schedutil.c | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c index cd7cd489f739..54c577578da6 100644 --- a/kernel/sched/cpufreq_schedutil.c +++ b/kernel/sched/cpufreq_schedutil.c | |||
| @@ -584,20 +584,14 @@ static int sugov_start(struct cpufreq_policy *policy) | |||
| 584 | for_each_cpu(cpu, policy->cpus) { | 584 | for_each_cpu(cpu, policy->cpus) { |
| 585 | struct sugov_cpu *sg_cpu = &per_cpu(sugov_cpu, cpu); | 585 | struct sugov_cpu *sg_cpu = &per_cpu(sugov_cpu, cpu); |
| 586 | 586 | ||
| 587 | memset(sg_cpu, 0, sizeof(*sg_cpu)); | ||
| 587 | sg_cpu->sg_policy = sg_policy; | 588 | sg_cpu->sg_policy = sg_policy; |
| 588 | if (policy_is_shared(policy)) { | 589 | sg_cpu->flags = SCHED_CPUFREQ_RT; |
| 589 | sg_cpu->util = 0; | 590 | sg_cpu->iowait_boost_max = policy->cpuinfo.max_freq; |
| 590 | sg_cpu->max = 0; | 591 | cpufreq_add_update_util_hook(cpu, &sg_cpu->update_util, |
| 591 | sg_cpu->flags = SCHED_CPUFREQ_RT; | 592 | policy_is_shared(policy) ? |
| 592 | sg_cpu->last_update = 0; | 593 | sugov_update_shared : |
| 593 | sg_cpu->iowait_boost = 0; | 594 | sugov_update_single); |
| 594 | sg_cpu->iowait_boost_max = policy->cpuinfo.max_freq; | ||
| 595 | cpufreq_add_update_util_hook(cpu, &sg_cpu->update_util, | ||
| 596 | sugov_update_shared); | ||
| 597 | } else { | ||
| 598 | cpufreq_add_update_util_hook(cpu, &sg_cpu->update_util, | ||
| 599 | sugov_update_single); | ||
| 600 | } | ||
| 601 | } | 595 | } |
| 602 | return 0; | 596 | return 0; |
| 603 | } | 597 | } |
