All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sched: using dst_rq instead of this_rq during load balance
@ 2012-08-06  8:41 Michael Wang
  2012-08-13 17:00 ` [tip:sched/core] " tip-bot for Michael Wang
  2012-08-13 17:06 ` tip-bot for Michael Wang
  0 siblings, 2 replies; 3+ messages in thread
From: Michael Wang @ 2012-08-06  8:41 UTC (permalink / raw)
  To: LKML; +Cc: Peter Zijlstra, Ingo Molnar

From: Michael Wang <wangyun@linux.vnet.ibm.com>

As we already have dst_rq in lb_env, using or changing "this_rq" do not
make sense.

This patch will replace "this_rq" with dst_rq in load_balance, and we
don't need to change "this_rq" while process LBF_SOME_PINNED any more.

Signed-off-by: Michael Wang <wangyun@linux.vnet.ibm.com>
---
 kernel/sched/fair.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index d0cc03b..f03b99c 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -4275,7 +4275,7 @@ redo:
 		goto out_balanced;
 	}
 
-	BUG_ON(busiest == this_rq);
+	BUG_ON(busiest == env.dst_rq);
 
 	schedstat_add(sd, lb_imbalance[idle], env.imbalance);
 
@@ -4295,7 +4295,7 @@ redo:
 
 more_balance:
 		local_irq_save(flags);
-		double_rq_lock(this_rq, busiest);
+		double_rq_lock(env.dst_rq, busiest);
 		if (!env.loop)
 			update_h_load(env.src_cpu);
 
@@ -4305,7 +4305,7 @@ more_balance:
 		 */
 		cur_ld_moved = move_tasks(&env);
 		ld_moved += cur_ld_moved;
-		double_rq_unlock(this_rq, busiest);
+		double_rq_unlock(env.dst_rq, busiest);
 		local_irq_restore(flags);
 
 		if (env.flags & LBF_NEED_BREAK) {
@@ -4341,8 +4341,7 @@ more_balance:
 		if ((env.flags & LBF_SOME_PINNED) && env.imbalance > 0 &&
 				lb_iterations++ < max_lb_iterations) {
 
-			this_rq		 = cpu_rq(env.new_dst_cpu);
-			env.dst_rq	 = this_rq;
+			env.dst_rq	 = cpu_rq(env.new_dst_cpu);
 			env.dst_cpu	 = env.new_dst_cpu;
 			env.flags	&= ~LBF_SOME_PINNED;
 			env.loop	 = 0;
-- 
1.7.4.1


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

end of thread, other threads:[~2012-08-13 17:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-06  8:41 [PATCH] sched: using dst_rq instead of this_rq during load balance Michael Wang
2012-08-13 17:00 ` [tip:sched/core] " tip-bot for Michael Wang
2012-08-13 17:06 ` tip-bot for Michael Wang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.