linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Qais Yousef <qyousef@layalina.io>
To: Ingo Molnar <mingo@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Dietmar Eggemann <dietmar.eggemann@arm.com>
Cc: linux-kernel@vger.kernel.org,
	"Pierre Gondois" <Pierre.Gondois@arm.com>,
	Qais Yousef <qyousef@layalina.io>
Subject: [PATCH v6 4/4] sched/fair: Don't double balance_interval for migrate_misfit
Date: Tue, 20 Feb 2024 22:56:22 +0000	[thread overview]
Message-ID: <20240220225622.2626569-5-qyousef@layalina.io> (raw)
In-Reply-To: <20240220225622.2626569-1-qyousef@layalina.io>

It is not necessarily an indication of the system being busy and
requires a backoff of the load balancer activities. But pushing it high
could mean generally delaying other misfit activities or other type of
imbalances.

Also don't pollute nr_balance_failed because of misfit failures. The
value is used for enabling cache hot migration and in migrate_util/load
types. None of which should be impacted (skewed) by misfit failures.

Signed-off-by: Qais Yousef <qyousef@layalina.io>
---
 kernel/sched/fair.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 20006fcf7df2..4c1235a5dd60 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -11467,8 +11467,12 @@ static int load_balance(int this_cpu, struct rq *this_rq,
 		 * We do not want newidle balance, which can be very
 		 * frequent, pollute the failure counter causing
 		 * excessive cache_hot migrations and active balances.
+		 *
+		 * Similarly for migration_misfit which is not related to
+		 * load/util migration, don't pollute nr_balance_failed.
 		 */
-		if (idle != CPU_NEWLY_IDLE)
+		if (idle != CPU_NEWLY_IDLE &&
+		    env.migration_type != migrate_misfit)
 			sd->nr_balance_failed++;
 
 		if (need_active_balance(&env)) {
@@ -11551,8 +11555,13 @@ static int load_balance(int this_cpu, struct rq *this_rq,
 	 * repeatedly reach this code, which would lead to balance_interval
 	 * skyrocketing in a short amount of time. Skip the balance_interval
 	 * increase logic to avoid that.
+	 *
+	 * Similarly misfit migration which is not necessarily an indication of
+	 * the system being busy and requires lb to backoff to let it settle
+	 * down.
 	 */
-	if (env.idle == CPU_NEWLY_IDLE)
+	if (env.idle == CPU_NEWLY_IDLE ||
+	    env.migration_type == migrate_misfit)
 		goto out;
 
 	/* tune up the balancing interval */
-- 
2.34.1


  parent reply	other threads:[~2024-02-20 22:56 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-20 22:56 [PATCH v6 0/4] sched: Don't trigger misfit if affinity is restricted Qais Yousef
2024-02-20 22:56 ` [PATCH v6 1/4] sched/topology: Export asym_capacity_list Qais Yousef
2024-02-23  9:30   ` Vincent Guittot
2024-02-20 22:56 ` [PATCH v6 2/4] sched/fair: Check a task has a fitting cpu when updating misfit Qais Yousef
2024-02-23  9:30   ` Vincent Guittot
2024-02-23 13:48     ` [PATCH v7] " Qais Yousef
2024-02-23 13:50     ` [PATCH v6 2/4] " Qais Yousef
2024-02-27  9:42   ` Dietmar Eggemann
2024-03-03 17:44     ` Qais Yousef
2024-03-06 21:47       ` Qais Yousef
2024-03-07  9:14         ` Vincent Guittot
2024-03-07 10:35           ` Qais Yousef
2024-03-07 17:54             ` Dietmar Eggemann
2024-03-21 12:20               ` Qais Yousef
2024-02-20 22:56 ` [PATCH v6 3/4] sched/topology: Remove max_cpu_capacity from root_domain Qais Yousef
2024-02-23  9:31   ` Vincent Guittot
2024-02-20 22:56 ` Qais Yousef [this message]
2024-02-23  9:32   ` [PATCH v6 4/4] sched/fair: Don't double balance_interval for migrate_misfit Vincent Guittot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240220225622.2626569-5-qyousef@layalina.io \
    --to=qyousef@layalina.io \
    --cc=Pierre.Gondois@arm.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=vincent.guittot@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).