Skip to content

Commit

Permalink
sched/balancing: Prevent the reselection of a previous env.dst_cpu if…
Browse files Browse the repository at this point in the history
… some tasks are pinned

Currently new_dst_cpu is prevented from being reselected actually, not
dst_cpu. This can result in attempting to pull tasks to this_cpu twice.

Signed-off-by: Vladimir Davydov <vdavydov@parallels.com>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/281f59b6e596c718dd565ad267fc38f5b8e5c995.1379265590.git.vdavydov@parallels.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
  • Loading branch information
Vladimir Davydov authored and Ingo Molnar committed Sep 20, 2013
1 parent 40a0c68 commit 7aff2e3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions kernel/sched/fair.c
Original file line number Diff line number Diff line change
Expand Up @@ -5261,15 +5261,15 @@ static int load_balance(int this_cpu, struct rq *this_rq,
*/
if ((env.flags & LBF_DST_PINNED) && env.imbalance > 0) {

/* Prevent to re-select dst_cpu via env's cpus */
cpumask_clear_cpu(env.dst_cpu, env.cpus);

env.dst_rq = cpu_rq(env.new_dst_cpu);
env.dst_cpu = env.new_dst_cpu;
env.flags &= ~LBF_DST_PINNED;
env.loop = 0;
env.loop_break = sched_nr_migrate_break;

/* Prevent to re-select dst_cpu via env's cpus */
cpumask_clear_cpu(env.dst_cpu, env.cpus);

/*
* Go back to "more_balance" rather than "redo" since we
* need to continue with same src_cpu.
Expand Down

0 comments on commit 7aff2e3

Please sign in to comment.