public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sched: make update_sd_pick_busiest return true on a busier sd
@ 2014-07-22 18:45 Rik van Riel
  2014-07-23  7:41 ` Vincent Guittot
  2014-07-25 15:27 ` Peter Zijlstra
  0 siblings, 2 replies; 19+ messages in thread
From: Rik van Riel @ 2014-07-22 18:45 UTC (permalink / raw)
  To: linux-kernel
  Cc: peterz, mikey, mingo, pjt, jhladky, ktkhai, tim.c.chen,
	nicolas.pitre

Currently update_sd_pick_busiest only returns true when an sd
is overloaded, or for SD_ASYM_PACKING when a domain is busier
than average and a higher numbered domain than the target.

This breaks load balancing between domains that are not overloaded,
in the !SD_ASYM_PACKING case. This patch makes update_sd_pick_busiest
return true when the busiest sd yet is encountered.

On a 4 node system, this seems to result in the load balancer finally
putting 1 thread of a 4 thread test run of "perf bench numa mem" on
each node, where before the load was generally not spread across all
nodes.

Behaviour for SD_ASYM_PACKING does not seem to match the comment,
in that groups with below average load average are ignored, but I
have no hardware to test that so I have left the behaviour of that
code unchanged.

Cc: mikey@neuling.org
Cc: peterz@infradead.org
Signed-off-by: Rik van Riel <riel@redhat.com>
---
 kernel/sched/fair.c | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index fea7d33..ff4ddba 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -5942,16 +5942,20 @@ static bool update_sd_pick_busiest(struct lb_env *env,
 	 * numbered CPUs in the group, therefore mark all groups
 	 * higher than ourself as busy.
 	 */
-	if ((env->sd->flags & SD_ASYM_PACKING) && sgs->sum_nr_running &&
-	    env->dst_cpu < group_first_cpu(sg)) {
-		if (!sds->busiest)
-			return true;
+	if (env->sd->flags & SD_ASYM_PACKING) {
+		if (sgs->sum_nr_running && env->dst_cpu < group_first_cpu(sg)) {
+			if (!sds->busiest)
+				return true;
 
-		if (group_first_cpu(sds->busiest) > group_first_cpu(sg))
-			return true;
+			if (group_first_cpu(sds->busiest) > group_first_cpu(sg))
+				return true;
+		}
+
+		return false;
 	}
 
-	return false;
+	/* See above: sgs->avg_load > sds->busiest_stat.avg_load */
+	return true;
 }
 
 #ifdef CONFIG_NUMA_BALANCING


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

end of thread, other threads:[~2014-07-28 15:05 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-22 18:45 [PATCH] sched: make update_sd_pick_busiest return true on a busier sd Rik van Riel
2014-07-23  7:41 ` Vincent Guittot
2014-07-25 13:33   ` Rik van Riel
2014-07-25 14:29     ` Vincent Guittot
2014-07-25 14:46       ` Rik van Riel
2014-07-25 14:02   ` Rik van Riel
2014-07-25 14:15     ` Peter Zijlstra
2014-07-25 15:02     ` Vincent Guittot
2014-07-25 15:13       ` Rik van Riel
2014-07-25 15:27 ` Peter Zijlstra
2014-07-25 15:45   ` Rik van Riel
2014-07-25 16:05     ` Peter Zijlstra
2014-07-25 16:22       ` Rik van Riel
2014-07-25 17:57         ` Vincent Guittot
2014-07-25 19:32           ` [PATCH v2] " Rik van Riel
2014-07-28  8:23             ` Vincent Guittot
2014-07-28 15:04               ` Rik van Riel
2014-07-28 14:30             ` Peter Zijlstra
2014-07-27 23:57   ` [PATCH] " Michael Neuling

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