diff options
| author | Todd Kjos <tkjos@google.com> | 2016-06-29 11:30:07 -0700 |
|---|---|---|
| committer | John Stultz <john.stultz@linaro.org> | 2016-08-11 14:26:45 -0700 |
| commit | 782c9d64a1d12aaf3d6decf7b54e212343bb3f7e (patch) | |
| tree | 6f3d9971ca056c3073ef1e298ee402f97fa7d46a /kernel/sched/core.c | |
| parent | dfc1151b46bb5862154a8be2be867dbc1c8aaeb8 (diff) | |
sched: EAS: Avoid causing spikes to max-freq unnecessarily
During scheduler tick handling, the frequency was being set to
max-freq if the current frequency is less than the current
utilization. Change to just request "right" frequency instead
of max.
BUG: 29871410
Change-Id: I6fe65b14413da44b1520ba116f72320083eb92f8
Diffstat (limited to 'kernel/sched/core.c')
| -rw-r--r-- | kernel/sched/core.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index deb45d1b4e49..f07615a1674f 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -2940,7 +2940,7 @@ static unsigned long sum_capacity_reqs(unsigned long cfs_cap, static void sched_freq_tick(int cpu) { struct sched_capacity_reqs *scr; - unsigned long capacity_orig, capacity_curr; + unsigned long capacity_orig, capacity_curr, capacity_sum; if (!sched_freq()) return; @@ -2953,12 +2953,15 @@ static void sched_freq_tick(int cpu) /* * To make free room for a task that is building up its "real" * utilization and to harm its performance the least, request - * a jump to max OPP as soon as the margin of free capacity is - * impacted (specified by capacity_margin). + * a jump to a higher OPP as soon as the margin of free capacity + * is impacted (specified by capacity_margin). */ + scr = &per_cpu(cpu_sched_capacity_reqs, cpu); - if (capacity_curr < sum_capacity_reqs(cpu_util(cpu), scr)) - set_cfs_cpu_capacity(cpu, true, capacity_max); + capacity_sum = sum_capacity_reqs(cpu_util(cpu), scr); + if (capacity_curr < capacity_sum) { + set_cfs_cpu_capacity(cpu, true, capacity_sum); + } } #else static inline void sched_freq_tick(int cpu) { } |
