From c7b587d9aa093de529b2fc6efd90b1f856a78bc7 Mon Sep 17 00:00:00 2001 From: Olav Haugan Date: Wed, 26 Nov 2014 12:54:37 -0800 Subject: sched: Avoid migrating tasks to little cores due to EA If during the check whether migration is needed we find that there is a lower power CPU available we commence to find a new CPU for this task. However, by the time we search for a new CPU the lower power CPU might no longer be available. We should abort the attempt to migrate a task in this case. CRs-Fixed: 764788 Change-Id: I867923a82b95c599278b81cd73bb102b6aff4d03 Signed-off-by: Olav Haugan --- kernel/sched/fair.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'kernel') diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 3204ca2a9619..f0d34f818428 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -3174,6 +3174,10 @@ static int skip_cpu(struct task_struct *p, int cpu, int reason) skip = (rq->capacity >= task_rq->capacity); break; + case MOVE_TO_POWER_EFFICIENT_CPU: + skip = rq->capacity < task_rq->capacity || + power_cost(p, cpu) > power_cost(p, task_cpu(p)); + break; default: skip = (cpu == task_cpu(p)); break; -- cgit v1.2.3