All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vincent Guittot <vincent.guittot@linaro.org>
To: Valentin Schneider <valentin.schneider@arm.com>
Cc: Ingo Molnar <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Juri Lelli <juri.lelli@redhat.com>,
	Dietmar Eggemann <dietmar.eggemann@arm.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Ben Segall <bsegall@google.com>, Mel Gorman <mgorman@suse.de>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 3/4] sched/fair: minimize concurrent LBs between domain level
Date: Wed, 16 Sep 2020 08:54:40 +0200	[thread overview]
Message-ID: <CAKfTPtA5PHN=9ykqHd5MYJvTxdR_pdtZOO=gjsJ7AWfLnLzMag@mail.gmail.com> (raw)
In-Reply-To: <jhjh7ry6eup.mognet@arm.com>

On Tue, 15 Sep 2020 at 21:04, Valentin Schneider
<valentin.schneider@arm.com> wrote:
>
>
> On 14/09/20 11:03, Vincent Guittot wrote:
> > 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>
> > ---
> >  kernel/sched/fair.c | 3 +++
> >  1 file changed, 3 insertions(+)
> >
> > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> > index 765be8273292..7d7eefd8e2d4 100644
> > --- a/kernel/sched/fair.c
> > +++ b/kernel/sched/fair.c
> > @@ -9780,6 +9780,9 @@ get_sd_balance_interval(struct sched_domain *sd, int cpu_busy)
> >
> >       /* scale ms to jiffies */
> >       interval = msecs_to_jiffies(interval);
>
> A comment here would be nice, I think. What about:
>
> /*
>  * 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.
>  */

Yes a comment would be nice. Will add it

Thanks
>
> > +     if (cpu_busy)
> > +             interval -= 1;
> > +
> >       interval = clamp(interval, 1UL, max_load_balance_interval);
> >
> >       return interval;

  reply	other threads:[~2020-09-16  6:54 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-14 10:03 [PATCH 0/4] sched/fair: Improve fairness between cfs tasks Vincent Guittot
2020-09-14 10:03 ` [PATCH 1/4] sched/fair: relax constraint on task's load during load balance Vincent Guittot
2020-09-14 10:03 ` [PATCH 2/4] sched/fair: reduce minimal imbalance threshold Vincent Guittot
2020-09-15 19:04   ` Valentin Schneider
2020-09-16  6:53     ` Vincent Guittot
2020-09-16  8:33       ` Valentin Schneider
2020-09-14 10:03 ` [PATCH 3/4] sched/fair: minimize concurrent LBs between domain level Vincent Guittot
2020-09-15 19:04   ` Valentin Schneider
2020-09-16  6:54     ` Vincent Guittot [this message]
2020-09-14 10:03 ` [PATCH 4/4] sched/fair: reduce busy load balance interval Vincent Guittot
2020-09-15  9:11   ` Jiang Biao
2020-09-15  9:28     ` Vincent Guittot
2020-09-15 11:36       ` Jiang Biao
2020-09-15 12:42         ` Vincent Guittot
2020-09-16  1:14           ` Jiang Biao
2020-09-15 19:04   ` Valentin Schneider
2020-09-16  7:02     ` Vincent Guittot
2020-09-16  8:34       ` Valentin Schneider
2020-09-14 11:42 ` [PATCH 0/4] sched/fair: Improve fairness between cfs tasks peterz
2020-09-14 12:53   ` Phil Auld
2020-09-14 16:03     ` Vincent Guittot
2020-09-14 15:50   ` Mel Gorman
2020-09-14 16:04     ` Vincent Guittot
2020-09-18 16:39   ` Phil Auld
2020-09-18 17:27     ` Phil Auld
2020-09-15 19:05 ` Valentin Schneider

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='CAKfTPtA5PHN=9ykqHd5MYJvTxdR_pdtZOO=gjsJ7AWfLnLzMag@mail.gmail.com' \
    --to=vincent.guittot@linaro.org \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=valentin.schneider@arm.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.