linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vincent Guittot <vincent.guittot@linaro.org>
To: Peng Liu <iwtbavbm@gmail.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] sched/fair: Fix nohz.next_balance update
Date: Fri, 8 May 2020 17:31:40 +0200	[thread overview]
Message-ID: <CAKfTPtDRxrSvLMy1WD-J2zK7=OxE+ozjX052fvtwmFy96w14hg@mail.gmail.com> (raw)
In-Reply-To: <20200508130118.GA4514@iZj6chx1xj0e0buvshuecpZ>

On Fri, 8 May 2020 at 15:01, Peng Liu <iwtbavbm@gmail.com> wrote:
>
> On Tue, May 05, 2020 at 04:27:11PM +0200, Vincent Guittot wrote:
> > Le mardi 05 mai 2020 à 21:40:56 (+0800), Peng Liu a écrit :
> >
>
> [...]
>
> >
> > Your proposal below looks quite complex. IMO, one solution would be to move the
> > update of nohz.next_balance before calling rebalance_domains(this_rq, CPU_IDLE)
> > so you are back to the previous behavior.
> >
> > The only difference is that in case of an break because of need_resched, it
> > doesn't update nohz.next_balance. But on the other hand, we haven't yet
> > finished run rebalance_domains for all CPUs and some load_balance are still
> > pending. In fact, this will be done during next tick by an idle CPU.
> >
> > So I would be in favor of something as simple as :
> >
>
> Vincent, could you refine this patch with some changelog?

Hi Peng , I'm going to prepare it and another one for the case that we
discussed about kicking a new ilb in case of abort

> And have my reported-by if possible.

Yes I will

>
> > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> > index 04098d678f3b..e028bc1c4744 100644
> > --- a/kernel/sched/fair.c
> > +++ b/kernel/sched/fair.c
> > @@ -10457,6 +10457,14 @@ static bool _nohz_idle_balance(struct rq *this_rq, unsigned int flags,
> >                 }
> >         }
> >
> > +       /*
> > +        * next_balance will be updated only when there is a need.
> > +        * When the CPU is attached to null domain for ex, it will not be
> > +        * updated.
> > +        */
> > +       if (likely(update_next_balance))
> > +               nohz.next_balance = next_balance;
> > +
> >         /* Newly idle CPU doesn't need an update */
> >         if (idle != CPU_NEWLY_IDLE) {
> >                 update_blocked_averages(this_cpu);
> > @@ -10477,14 +10485,6 @@ static bool _nohz_idle_balance(struct rq *this_rq, unsigned int flags,
> >         if (has_blocked_load)
> >                 WRITE_ONCE(nohz.has_blocked, 1);
> >
> > -       /*
> > -        * next_balance will be updated only when there is a need.
> > -        * When the CPU is attached to null domain for ex, it will not be
> > -        * updated.
> > -        */
> > -       if (likely(update_next_balance))
> > -               nohz.next_balance = next_balance;
> > -
> >         return ret;
> >  }
> >

  reply	other threads:[~2020-05-08 15:31 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-03  8:34 [PATCH] sched/fair: Fix nohz.next_balance update Peng Liu
2020-05-04  0:10 ` Valentin Schneider
2020-05-05 12:36   ` Peng Liu
2020-05-04 15:17 ` Vincent Guittot
2020-05-04 15:48   ` Valentin Schneider
2020-05-04 16:05   ` Dietmar Eggemann
2020-05-05 13:40   ` Peng Liu
2020-05-05 14:27     ` Vincent Guittot
2020-05-05 15:16       ` Peng Liu
2020-05-05 15:43         ` Vincent Guittot
2020-05-05 16:08           ` Peng Liu
2020-05-06 10:29       ` Valentin Schneider
2020-05-06 13:45         ` Vincent Guittot
2020-05-06 16:02           ` Valentin Schneider
2020-05-06 16:56             ` Vincent Guittot
2020-05-06 20:21               ` Valentin Schneider
2020-05-07 12:41             ` Peng Liu
2020-05-07 12:53               ` Vincent Guittot
2020-05-08 13:01       ` Peng Liu
2020-05-08 15:31         ` Vincent Guittot [this message]
2020-05-06 10:28   ` 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='CAKfTPtDRxrSvLMy1WD-J2zK7=OxE+ozjX052fvtwmFy96w14hg@mail.gmail.com' \
    --to=vincent.guittot@linaro.org \
    --cc=iwtbavbm@gmail.com \
    --cc=linux-kernel@vger.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).