[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <160136620995.7002.3858604337402103241.tip-bot2@tip-bot2>
Date: Tue, 29 Sep 2020 07:56:49 -0000
From: "tip-bot2 for Vincent Guittot" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Vincent Guittot <vincent.guittot@...aro.org>,
"Peter Zijlstra (Intel)" <peterz@...radead.org>,
Phil Auld <pauld@...hat.com>, x86 <x86@...nel.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: [tip: sched/core] sched/fair: Relax constraint on task's load during
load balance
The following commit has been merged into the sched/core branch of tip:
Commit-ID: 5a7f555904671c0737819fe4d19bd6143de3f6c0
Gitweb: https://git.kernel.org/tip/5a7f555904671c0737819fe4d19bd6143de3f6c0
Author: Vincent Guittot <vincent.guittot@...aro.org>
AuthorDate: Mon, 21 Sep 2020 09:24:21 +02:00
Committer: Peter Zijlstra <peterz@...radead.org>
CommitterDate: Fri, 25 Sep 2020 14:23:25 +02:00
sched/fair: Relax constraint on task's load during load balance
Some UCs like 9 always running tasks on 8 CPUs can't be balanced and the
load balancer currently migrates the waiting task between the CPUs in an
almost random manner. The success of a rq pulling a task depends of the
value of nr_balance_failed of its domains and its ability to be faster
than others to detach it. This behavior results in an unfair distribution
of the running time between tasks because some CPUs will run most of the
time, if not always, the same task whereas others will share their time
between several tasks.
Instead of using nr_balance_failed as a boolean to relax the condition
for detaching task, the LB will use nr_balanced_failed to relax the
threshold between the tasks'load and the imbalance. This mecanism
prevents the same rq or domain to always win the load balance fight.
Signed-off-by: Vincent Guittot <vincent.guittot@...aro.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Reviewed-by: Phil Auld <pauld@...hat.com>
Link: https://lkml.kernel.org/r/20200921072424.14813-2-vincent.guittot@linaro.org
---
kernel/sched/fair.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index b56276a..5e3add3 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -7679,8 +7679,8 @@ static int detach_tasks(struct lb_env *env)
* scheduler fails to find a good waiting task to
* migrate.
*/
- if (load/2 > env->imbalance &&
- env->sd->nr_balance_failed <= env->sd->cache_nice_tries)
+
+ if ((load >> env->sd->nr_balance_failed) > env->imbalance)
goto next;
env->imbalance -= load;
Powered by blists - more mailing lists