[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <76133a77-3098-5bb4-cdae-060d2e4b93c9@arm.com>
Date: Wed, 17 Mar 2021 11:52:06 +0100
From: Dietmar Eggemann <dietmar.eggemann@....com>
To: Valentin Schneider <valentin.schneider@....com>,
linux-kernel@...r.kernel.org
Cc: Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...nel.org>,
Vincent Guittot <vincent.guittot@...aro.org>,
Morten Rasmussen <morten.rasmussen@....com>,
Qais Yousef <qais.yousef@....com>,
Quentin Perret <qperret@...gle.com>,
Pavan Kondeti <pkondeti@...eaurora.org>,
Rik van Riel <riel@...riel.com>,
Lingutla Chandrasekhar <clingutla@...eaurora.org>
Subject: Re: [PATCH v3 2/7] sched/fair: Clean up active balance
nr_balance_failed trickery
On 11/03/2021 13:05, Valentin Schneider wrote:
[...]
> @@ -9952,7 +9954,8 @@ static int active_load_balance_cpu_stop(void *data)
> * @dst_grpmask we need to make that test go away with lying
> * about DST_PINNED.
> */
> - .flags = LBF_DST_PINNED,
> + .flags = LBF_DST_PINNED |
> + LBF_ACTIVE_LB,
Since you now have a dedicated LBF flag for active balancing you could remove the
LBF_DST_PINNED here and adapt the if condition in can_migrate_task():
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index f50a902bdf24..9f7feb512016 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -7583,10 +7583,13 @@ int can_migrate_task(struct task_struct *p, struct lb_env *env)
* meet load balance goals by pulling other tasks on src_cpu.
*
* Avoid computing new_dst_cpu for NEWLY_IDLE or if we have
- * already computed one in current iteration.
+ * already computed one in current iteration or if it is an
+ * active balance.
*/
- if (env->idle == CPU_NEWLY_IDLE || (env->flags & LBF_DST_PINNED))
+ if (env->idle == CPU_NEWLY_IDLE ||
+ (env->flags & (LBF_DST_PINNED | LBF_ACTIVE_LB))) {
return 0;
+ }
/* Prevent to re-select dst_cpu via env's CPUs: */
for_each_cpu_and(cpu, env->dst_grpmask, env->cpus) {
@@ -9948,14 +9951,7 @@ static int active_load_balance_cpu_stop(void *data)
.src_cpu = busiest_rq->cpu,
.src_rq = busiest_rq,
.idle = CPU_IDLE,
- /*
- * can_migrate_task() doesn't need to compute new_dst_cpu
- * for active balancing. Since we have CPU_IDLE, but no
- * @dst_grpmask we need to make that test go away with lying
- * about DST_PINNED.
- */
- .flags = LBF_DST_PINNED |
- LBF_ACTIVE_LB,
+ .flags = LBF_ACTIVE_LB,
};
Powered by blists - more mailing lists