summaryrefslogtreecommitdiff
path: root/kernel/sched/fair.c
diff options
context:
space:
mode:
authorTodd Kjos <tkjos@google.com>2016-07-13 16:13:47 -0700
committerAmit Pundir <amit.pundir@linaro.org>2016-09-14 15:02:22 +0530
commit831623e6fe5ea7a8dc858b10f369882b6d4fa39f (patch)
treec99e2b5228502935a06e52ca8a8241ec06d02408 /kernel/sched/fair.c
parent7bba794daaa85dce327e52b201439bb2c148b6c9 (diff)
sched: use util instead of capacity to select busy cpu
If cpus are busy, the cpu selection algorithm was favoring cpus with lower capacity. This can result in uneven packing since there will be a bias toward the same cpu until there is a capacity change. Instead use the utilization so there is immediate feedback as tasks are assigned BUG: 30115868 Change-Id: I0ac7ae3ab5d8f2f5a5838c29bb6da2c3e8ef44e8
Diffstat (limited to 'kernel/sched/fair.c')
-rw-r--r--kernel/sched/fair.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index a45a6e1a692c..26c7e3fd332f 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -5614,7 +5614,7 @@ static inline int find_best_target(struct task_struct *p, bool boosted)
{
int iter_cpu;
int target_cpu = -1;
- int target_capacity = 0;
+ int target_util = 0;
int backup_capacity = 0;
int best_idle_cpu = -1;
int best_idle_cstate = INT_MAX;
@@ -5670,10 +5670,10 @@ static inline int find_best_target(struct task_struct *p, bool boosted)
if (new_util < cur_capacity) {
if (cpu_rq(i)->nr_running) {
- if (target_capacity == 0 ||
- target_capacity > cur_capacity) {
+ if (target_util == 0 ||
+ target_util > new_util) {
target_cpu = i;
- target_capacity = cur_capacity;
+ target_util = new_util;
}
} else if (!boosted) {
if (best_idle_cpu < 0 ||