aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Guittot <vincent.guittot@linaro.org>2013-02-11 18:45:33 +0100
committerVincent Guittot <vincent.guittot@linaro.org>2013-03-13 09:29:29 +0100
commit7050a644e98ebfc0bbbb7059015e3bc9d08b4755 (patch)
treed7d8a0b55efb3b47486d1d4eb74d6d09abbeb8dd
parentf6161aa153581da4a3867a2d1a7caf4be19b6ec9 (diff)
sched: fix env->src_cpu for active migrationupstream-sched-fix-env-src-active-migration-v1
need_active_balance uses env->src_cpu which is set only if there is more than 1 task on the run queue. We must set the src_cpu field unconditionnally otherwise the test "env->src_cpu > env->dst_cpu" will always fail if there is only 1 task on the run queue Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
-rw-r--r--kernel/sched/fair.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 7a33e5986fc..1b44b2d23b8 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -5035,6 +5035,10 @@ redo:
ld_moved = 0;
lb_iterations = 1;
+
+ env.src_cpu = busiest->cpu;
+ env.src_rq = busiest;
+
if (busiest->nr_running > 1) {
/*
* Attempt to move tasks. If find_busiest_group has found
@@ -5043,8 +5047,6 @@ redo:
* correctly treated as an imbalance.
*/
env.flags |= LBF_ALL_PINNED;
- env.src_cpu = busiest->cpu;
- env.src_rq = busiest;
env.loop_max = min(sysctl_sched_nr_migrate, busiest->nr_running);
update_h_load(env.src_cpu);