public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sched: fix env->src_cpu for active migration
@ 2013-02-12 13:19 Vincent Guittot
  2013-02-13  6:18 ` Damien Wyart
  2013-02-13 20:03 ` Paul Turner
  0 siblings, 2 replies; 13+ messages in thread
From: Vincent Guittot @ 2013-02-12 13:19 UTC (permalink / raw)
  To: linux-kernel, linaro-dev, peterz, mingo; +Cc: Vincent Guittot

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>
---
 kernel/sched/fair.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 81fa536..32938ea 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -5044,6 +5044,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
@@ -5052,8 +5056,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);
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2013-02-14 13:37 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-12 13:19 [PATCH] sched: fix env->src_cpu for active migration Vincent Guittot
2013-02-13  6:18 ` Damien Wyart
2013-02-13  7:54   ` Vincent Guittot
2013-02-13  9:21     ` Damien Wyart
2013-02-13 12:08       ` Vincent Guittot
2013-02-13 14:08         ` Damien Wyart
2013-02-13 14:28           ` Vincent Guittot
2013-02-13 17:49             ` Vincent Guittot
2013-02-13 18:47               ` Damien Wyart
2013-02-13 20:02                 ` Damien Wyart
2013-02-14  8:32                   ` Vincent Guittot
2013-02-13 20:03 ` Paul Turner
2013-02-14 13:37   ` Vincent Guittot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox