All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sched: reset loop counters if all tasks are pinned and we need to redo load balance
@ 2012-06-19 12:22 Prashanth Nageshappa
  2012-07-06  6:22 ` [tip:sched/core] sched: Reset " tip-bot for Prashanth Nageshappa
  2012-07-24 14:20 ` tip-bot for Prashanth Nageshappa
  0 siblings, 2 replies; 3+ messages in thread
From: Prashanth Nageshappa @ 2012-06-19 12:22 UTC (permalink / raw)
  To: Peter Zijlstra, mingo, LKML, roland, Srivatsa Vaddagiri, efault,
	Ingo Molnar

While load balancing, if all tasks on the source runqueue are pinned,
we retry after excluding the corresponding source cpu. However, loop counters
env.loop and env.loop_break are not reset before retrying, which can lead
to failure in moving the tasks. In this patch we reset env.loop and
env.loop_break to their inital values before we retry.

Signed-off-by: Prashanth Nageshappa <prashanth@linux.vnet.ibm.com>
---

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 939fd63..60f8b66 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -4520,8 +4520,11 @@ more_balance:
 		/* All tasks on this runqueue were pinned by CPU affinity */
 		if (unlikely(env.flags & LBF_ALL_PINNED)) {
 			cpumask_clear_cpu(cpu_of(busiest), cpus);
-			if (!cpumask_empty(cpus))
+			if (!cpumask_empty(cpus)) {
+				env.loop = 0;
+				env.loop_break = sched_nr_migrate_break;
 				goto redo;
+			}
 			goto out_balanced;
 		}
 	}


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

* [tip:sched/core] sched: Reset loop counters if all tasks are pinned and we need to redo load balance
  2012-06-19 12:22 [PATCH] sched: reset loop counters if all tasks are pinned and we need to redo load balance Prashanth Nageshappa
@ 2012-07-06  6:22 ` tip-bot for Prashanth Nageshappa
  2012-07-24 14:20 ` tip-bot for Prashanth Nageshappa
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Prashanth Nageshappa @ 2012-07-06  6:22 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, a.p.zijlstra, tglx, prashanth

Commit-ID:  4d44f7090f8233f6994e7397679a32c81187506d
Gitweb:     http://git.kernel.org/tip/4d44f7090f8233f6994e7397679a32c81187506d
Author:     Prashanth Nageshappa <prashanth@linux.vnet.ibm.com>
AuthorDate: Tue, 19 Jun 2012 17:52:07 +0530
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Thu, 5 Jul 2012 21:09:10 +0200

sched: Reset loop counters if all tasks are pinned and we need to redo load balance

While load balancing, if all tasks on the source runqueue are pinned,
we retry after excluding the corresponding source cpu. However, loop counters
env.loop and env.loop_break are not reset before retrying, which can lead
to failure in moving the tasks. In this patch we reset env.loop and
env.loop_break to their inital values before we retry.

Signed-off-by: Prashanth Nageshappa <prashanth@linux.vnet.ibm.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/4FE06EEF.2090709@linux.vnet.ibm.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 kernel/sched/fair.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 39b5771..3f94840 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -4497,8 +4497,11 @@ more_balance:
 		/* All tasks on this runqueue were pinned by CPU affinity */
 		if (unlikely(env.flags & LBF_ALL_PINNED)) {
 			cpumask_clear_cpu(cpu_of(busiest), cpus);
-			if (!cpumask_empty(cpus))
+			if (!cpumask_empty(cpus)) {
+				env.loop = 0;
+				env.loop_break = sched_nr_migrate_break;
 				goto redo;
+			}
 			goto out_balanced;
 		}
 	}

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

* [tip:sched/core] sched: Reset loop counters if all tasks are pinned and we need to redo load balance
  2012-06-19 12:22 [PATCH] sched: reset loop counters if all tasks are pinned and we need to redo load balance Prashanth Nageshappa
  2012-07-06  6:22 ` [tip:sched/core] sched: Reset " tip-bot for Prashanth Nageshappa
@ 2012-07-24 14:20 ` tip-bot for Prashanth Nageshappa
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Prashanth Nageshappa @ 2012-07-24 14:20 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, a.p.zijlstra, tglx, prashanth

Commit-ID:  bbf18b19495942cc730e8ff11fc3ffadf20cbfe1
Gitweb:     http://git.kernel.org/tip/bbf18b19495942cc730e8ff11fc3ffadf20cbfe1
Author:     Prashanth Nageshappa <prashanth@linux.vnet.ibm.com>
AuthorDate: Tue, 19 Jun 2012 17:52:07 +0530
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Tue, 24 Jul 2012 13:55:37 +0200

sched: Reset loop counters if all tasks are pinned and we need to redo load balance

While load balancing, if all tasks on the source runqueue are pinned,
we retry after excluding the corresponding source cpu. However, loop counters
env.loop and env.loop_break are not reset before retrying, which can lead
to failure in moving the tasks. In this patch we reset env.loop and
env.loop_break to their inital values before we retry.

Signed-off-by: Prashanth Nageshappa <prashanth@linux.vnet.ibm.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/4FE06EEF.2090709@linux.vnet.ibm.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 kernel/sched/fair.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 9361669..f9f9aa0 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -4288,8 +4288,11 @@ more_balance:
 		/* All tasks on this runqueue were pinned by CPU affinity */
 		if (unlikely(env.flags & LBF_ALL_PINNED)) {
 			cpumask_clear_cpu(cpu_of(busiest), cpus);
-			if (!cpumask_empty(cpus))
+			if (!cpumask_empty(cpus)) {
+				env.loop = 0;
+				env.loop_break = sched_nr_migrate_break;
 				goto redo;
+			}
 			goto out_balanced;
 		}
 	}

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

end of thread, other threads:[~2012-07-24 14:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-19 12:22 [PATCH] sched: reset loop counters if all tasks are pinned and we need to redo load balance Prashanth Nageshappa
2012-07-06  6:22 ` [tip:sched/core] sched: Reset " tip-bot for Prashanth Nageshappa
2012-07-24 14:20 ` tip-bot for Prashanth Nageshappa

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.