Skip to content

Commit 3466fe1

Browse files
credpExactExampl
authored andcommitted
FROMLIST: sched/fair: Don't move tasks to lower capacity cpus unless necessary
When lower capacity CPUs are load balancing and considering to pull something from a higher capacity group, we should not pull tasks from a cpu with only one task running as this is guaranteed to impede progress for that task. If there is more than one task running, load balance in the higher capacity group would have already made any possible moves to resolve imbalance and we should make better use of system compute capacity by moving a task if we still have more than one running. cc: Ingo Molnar <mingo@redhat.com> cc: Peter Zijlstra <peterz@infradead.org> Change-Id: Ib86570abdd453a51be885b086c8d80be2773a6f2 Signed-off-by: Chris Redpath <chris.redpath@arm.com> Signed-off-by: Morten Rasmussen <morten.rasmussen@arm.com> [from https://lore.kernel.org/lkml/1530699470-29808-11-git-send-email-morten.rasmussen@arm.com/] Signed-off-by: Chris Redpath <chris.redpath@arm.com> Git-commit: 07e7ce6c8459defc34e63ae0f0334e811d223990 Git-repo: https://android.googlesource.com/kernel/common/ [clingutla@codeaurora.org: Resolved merge conflicts.] Signed-off-by: Lingutla Chandrasekhar <clingutla@codeaurora.org> (cherry picked from commit 779459e3fffda001181cfd6b1be2ffd3da25002c)
1 parent 0ea6c8f commit 3466fe1

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

kernel/sched/fair.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9942,6 +9942,17 @@ static struct rq *find_busiest_queue(struct lb_env *env,
99429942

99439943
capacity = capacity_of(i);
99449944

9945+
/*
9946+
* For ASYM_CPUCAPACITY domains, don't pick a cpu that could
9947+
* eventually lead to active_balancing high->low capacity.
9948+
* Higher per-cpu capacity is considered better than balancing
9949+
* average load.
9950+
*/
9951+
if (env->sd->flags & SD_ASYM_CPUCAPACITY &&
9952+
capacity_of(env->dst_cpu) < capacity &&
9953+
rq->nr_running == 1)
9954+
continue;
9955+
99459956
wl = weighted_cpuload(i);
99469957

99479958
/*

0 commit comments

Comments
 (0)