public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sched/fair: Don't pull task if local group is more loaded than busiest group
@ 2020-03-25 12:46 Aubrey Li
  2020-03-25 13:43 ` Phil Auld
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Aubrey Li @ 2020-03-25 12:46 UTC (permalink / raw)
  To: vincent.guittot, mingo, peterz, juri.lelli, dietmar.eggemann,
	rostedt, bsegall, mgorman, linux-kernel
  Cc: tim.c.chen, vpillai, joel, Aubrey Li, Aubrey Li

A huge number of load imbalance was observed when the local group
type is group_fully_busy, and the average load of local group is
greater than the selected busiest group, so the imbalance calculation
returns a negative value actually. Fix this problem by comparing the
average load before local group type check.

Signed-off-by: Aubrey Li <aubrey.li@linux.intel.com>
---
 kernel/sched/fair.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index c1217bf..c524369 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -8862,17 +8862,17 @@ static struct sched_group *find_busiest_group(struct lb_env *env)
 		goto out_balanced;
 
 	/*
+	 * If the local group is more loaded than the selected
+	 * busiest group don't try to pull any tasks.
+	 */
+	if (local->avg_load >= busiest->avg_load)
+		goto out_balanced;
+
+	/*
 	 * When groups are overloaded, use the avg_load to ensure fairness
 	 * between tasks.
 	 */
 	if (local->group_type == group_overloaded) {
-		/*
-		 * If the local group is more loaded than the selected
-		 * busiest group don't try to pull any tasks.
-		 */
-		if (local->avg_load >= busiest->avg_load)
-			goto out_balanced;
-
 		/* XXX broken for overlapping NUMA groups */
 		sds.avg_load = (sds.total_load * SCHED_CAPACITY_SCALE) /
 				sds.total_capacity;
-- 
2.7.4


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

end of thread, other threads:[~2020-03-29  4:27 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-25 12:46 [PATCH] sched/fair: Don't pull task if local group is more loaded than busiest group Aubrey Li
2020-03-25 13:43 ` Phil Auld
2020-03-26  1:51   ` Li, Aubrey
2020-03-25 13:58 ` Vincent Guittot
2020-03-26  1:57   ` Li, Aubrey
2020-03-28 13:23 ` [sched/fair] 59901cb452: netperf.Throughput_Mbps -27.3% regression kernel test robot
2020-03-29  4:26   ` Aubrey Li

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