All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vincent Guittot <vincent.guittot@linaro.org>
To: Ben Segall <bsegall@google.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>,
	Mel Gorman <mgorman@suse.de>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Phil Auld <pauld@redhat.com>, Parth Shah <parth@linux.ibm.com>,
	Valentin Schneider <valentin.schneider@arm.com>,
	Hillf Danton <hdanton@sina.com>,
	zhout@vivaldi.net
Subject: Re: [PATCH] sched/fair: fix runnable_avg for throttled cfs
Date: Wed, 26 Feb 2020 22:01:36 +0100	[thread overview]
Message-ID: <CAKfTPtBm9Gt16gqQgxoErOOmpbUHit6bNf4CVLvDzf04SjWtEg@mail.gmail.com> (raw)
In-Reply-To: <xm26r1yhtbjr.fsf@bsegall-linux.svl.corp.google.com>

On Wed, 26 Feb 2020 at 20:04, <bsegall@google.com> wrote:
>
> Vincent Guittot <vincent.guittot@linaro.org> writes:
>
> > When a cfs_rq is throttled, its group entity is dequeued and its running
> > tasks are removed. We must update runnable_avg with current h_nr_running
> > and update group_se->runnable_weight with new h_nr_running at each level
> > of the hierarchy.
>
> You'll also need to do this for task enqueue/dequeue inside of a
> throttled hierarchy, I'm pretty sure.

AFAICT, this is already done with patch "sched/pelt: Add a new
runnable average signal" when task is enqueued/dequeued inside a
throttled hierarchy

>
> >
> > Fixes: 9f68395333ad ("sched/pelt: Add a new runnable average signal")
> > Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
> > ---
> > This patch applies on top of tip/sched/core
> >
> >  kernel/sched/fair.c | 10 ++++++++++
> >  1 file changed, 10 insertions(+)
> >
> > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> > index fcc968669aea..6d46974e9be7 100644
> > --- a/kernel/sched/fair.c
> > +++ b/kernel/sched/fair.c
> > @@ -4703,6 +4703,11 @@ static void throttle_cfs_rq(struct cfs_rq *cfs_rq)
> >
> >               if (dequeue)
> >                       dequeue_entity(qcfs_rq, se, DEQUEUE_SLEEP);
> > +             else {
> > +                     update_load_avg(qcfs_rq, se, 0);
> > +                     se_update_runnable(se);
> > +             }
> > +
> >               qcfs_rq->h_nr_running -= task_delta;
> >               qcfs_rq->idle_h_nr_running -= idle_task_delta;
> >
> > @@ -4772,6 +4777,11 @@ void unthrottle_cfs_rq(struct cfs_rq *cfs_rq)
> >               cfs_rq = cfs_rq_of(se);
> >               if (enqueue)
> >                       enqueue_entity(cfs_rq, se, ENQUEUE_WAKEUP);
> > +             else {
> > +                     update_load_avg(cfs_rq, se, 0);
>
>
> > +                     se_update_runnable(se);
> > +             }
> > +
> >               cfs_rq->h_nr_running += task_delta;
> >               cfs_rq->idle_h_nr_running += idle_task_delta;

  reply	other threads:[~2020-02-26 21:01 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-26 18:16 [PATCH] sched/fair: fix runnable_avg for throttled cfs Vincent Guittot
2020-02-26 19:04 ` bsegall
2020-02-26 21:01   ` Vincent Guittot [this message]
2020-02-27 11:20     ` Dietmar Eggemann
2020-02-27 13:10       ` Vincent Guittot
2020-02-27 14:58         ` Vincent Guittot
2020-02-27 15:17           ` Dietmar Eggemann
2020-02-27 15:34           ` Phil Auld
2020-02-27 15:39             ` Vincent Guittot
     [not found]       ` <20200227131228.GA5872@geo.homenetwork>
2020-02-27 13:12         ` Vincent Guittot
2020-02-27 15:15           ` Dietmar Eggemann
2020-02-27 19:13     ` bsegall

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=CAKfTPtBm9Gt16gqQgxoErOOmpbUHit6bNf4CVLvDzf04SjWtEg@mail.gmail.com \
    --to=vincent.guittot@linaro.org \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=hdanton@sina.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=parth@linux.ibm.com \
    --cc=pauld@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=valentin.schneider@arm.com \
    --cc=zhout@vivaldi.net \
    /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.