diff options
author | Dietmar Eggemann <dietmar.eggemann@arm.com> | 2015-01-26 19:01:34 +0000 |
---|---|---|
committer | Robin Randhawa <robin.randhawa@arm.com> | 2015-04-09 12:26:15 +0100 |
commit | 08eda3bb8804847aa42dbb4154aecd53102b7fd7 (patch) | |
tree | 7e06cdb22c363dd2ec829ae59ef34bf3d435d9f2 | |
parent | 93859f6416c77c358d316e1b291524bd3ec0316d (diff) |
sched: Skip cpu as lb src which has one task and capacity gte the dst cpu
Skip cpu as a potential src (costliest) in case it has only one task
running and its original capacity is greater than or equal to the
original capacity of the dst cpu.
cc: Ingo Molnar <mingo@redhat.com>
cc: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
[major changes: Juri Lelli]
-rw-r--r-- | kernel/sched/fair.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 42cd7cbe58b6..bf175b54a301 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -6758,6 +6758,10 @@ static struct rq *find_busiest_queue(struct lb_env *env, }; unsigned long energy = sched_group_energy(&eenv); + if (rq->nr_running == 1 && capacity_orig_of(i) >= + capacity_orig_of(env->dst_cpu)) + continue; + /* * We're looking for the minimal cpu efficiency * min(u_i / e_i), crosswise multiplication leads to @@ -7176,7 +7180,8 @@ static int idle_balance(struct rq *this_rq) */ this_rq->idle_stamp = rq_clock(this_rq); - if (this_rq->avg_idle < sysctl_sched_migration_cost) + if (this_rq->avg_idle < sysctl_sched_migration_cost || + !energy_aware()) goto out; /* |