linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "tip-bot2 for Vincent Guittot" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Vincent Guittot <vincent.guittot@linaro.org>,
	"Peter Zijlstra (Intel)" <peterz@infradead.org>,
	Phil Auld <pauld@redhat.com>, x86 <x86@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: [tip: sched/core] sched/fair: Minimize concurrent LBs between domain level
Date: Tue, 29 Sep 2020 07:56:48 -0000	[thread overview]
Message-ID: <160136620899.7002.5463550699330938953.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20200921072424.14813-4-vincent.guittot@linaro.org>

The following commit has been merged into the sched/core branch of tip:

Commit-ID:     e4d32e4d5444977d8dc25fa98b3ce0a65544db8c
Gitweb:        https://git.kernel.org/tip/e4d32e4d5444977d8dc25fa98b3ce0a65544db8c
Author:        Vincent Guittot <vincent.guittot@linaro.org>
AuthorDate:    Mon, 21 Sep 2020 09:24:23 +02:00
Committer:     Peter Zijlstra <peterz@infradead.org>
CommitterDate: Fri, 25 Sep 2020 14:23:26 +02:00

sched/fair: Minimize concurrent LBs between domain level

sched domains tend to trigger simultaneously the load balance loop but
the larger domains often need more time to collect statistics. This
slowness makes the larger domain trying to detach tasks from a rq whereas
tasks already migrated somewhere else at a sub-domain level. This is not
a real problem for idle LB because the period of smaller domains will
increase with its CPUs being busy and this will let time for higher ones
to pulled tasks. But this becomes a problem when all CPUs are already busy
because all domains stay synced when they trigger their LB.

A simple way to minimize simultaneous LB of all domains is to decrement the
the busy interval by 1 jiffies. Because of the busy_factor, the interval of
larger domain will not be a multiple of smaller ones anymore.

Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Phil Auld <pauld@redhat.com>
Link: https://lkml.kernel.org/r/20200921072424.14813-4-vincent.guittot@linaro.org
---
 kernel/sched/fair.c |  9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 5e3add3..24a5ee6 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -9790,6 +9790,15 @@ get_sd_balance_interval(struct sched_domain *sd, int cpu_busy)
 
 	/* scale ms to jiffies */
 	interval = msecs_to_jiffies(interval);
+
+	/*
+	 * Reduce likelihood of busy balancing at higher domains racing with
+	 * balancing at lower domains by preventing their balancing periods
+	 * from being multiples of each other.
+	 */
+	if (cpu_busy)
+		interval -= 1;
+
 	interval = clamp(interval, 1UL, max_load_balance_interval);
 
 	return interval;

  parent reply	other threads:[~2020-09-29  7:57 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-21  7:24 [PATCH 0/4 v2] sched/fair: Improve fairness between cfs tasks Vincent Guittot
2020-09-21  7:24 ` [PATCH 1/4 v2] sched/fair: relax constraint on task's load during load balance Vincent Guittot
2020-09-23 14:43   ` Valentin Schneider
2020-09-29  7:56   ` [tip: sched/core] sched/fair: Relax " tip-bot2 for Vincent Guittot
2020-09-21  7:24 ` [PATCH 2/4 v2] sched/fair: reduce minimal imbalance threshold Vincent Guittot
2020-09-23 14:43   ` Valentin Schneider
2020-09-29  7:56   ` [tip: sched/core] sched/fair: Reduce " tip-bot2 for Vincent Guittot
2020-09-21  7:24 ` [PATCH 3/4 v2] sched/fair: minimize concurrent LBs between domain level Vincent Guittot
2020-09-23 14:43   ` Valentin Schneider
2020-09-29  7:56   ` tip-bot2 for Vincent Guittot [this message]
2020-09-21  7:24 ` [PATCH 4/4 v2] sched/fair: reduce busy load balance interval Vincent Guittot
2020-09-23 14:43   ` Valentin Schneider
2020-09-29  7:56   ` [tip: sched/core] sched/fair: Reduce " tip-bot2 for Vincent Guittot
2020-09-23 15:47 ` [PATCH 0/4 v2] sched/fair: Improve fairness between cfs tasks Mel Gorman

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=160136620899.7002.5463550699330938953.tip-bot2@tip-bot2 \
    --to=tip-bot2@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=pauld@redhat.com \
    --cc=peterz@infradead.org \
    --cc=vincent.guittot@linaro.org \
    --cc=x86@kernel.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).