From: Vincent Guittot <vincent.guittot@linaro.org>
To: "Michal Koutný" <mkoutny@suse.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
Phil Auld <pauld@redhat.com>, 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>,
Daniel Bristot de Oliveira <bristot@redhat.com>,
Odin Ugedal <odin@uged.al>, Rik van Riel <riel@surriel.com>,
Giovanni Gherdovich <ggherdovich@suse.cz>
Subject: Re: [RFC PATCH v2 1/5] sched/fair: Add ancestors of unthrottled undecayed cfs_rq
Date: Fri, 10 Sep 2021 15:17:05 +0200 [thread overview]
Message-ID: <CAKfTPtA+q0PEJtzkZAe=6bMFjD4JrA3k34mGMpDfmMUr5nPfiA@mail.gmail.com> (raw)
In-Reply-To: <20210910113544.GB24156@blackbody.suse.cz>
On Fri, 10 Sept 2021 at 13:35, Michal Koutný <mkoutny@suse.com> wrote:
>
> Hello Vincent.
>
> Thank you for looking into this!
>
> On Thu, Sep 09, 2021 at 03:57:37PM +0200, Vincent Guittot <vincent.guittot@linaro.org> wrote:
> > > + /* Nothing to run but something to decay? Complete the branch */
> > > + if (cfs_rq->on_list)
> >
> > Could you use !cfs_rq_is decayed(cfs_rq) ?
>
> What needs to be checked here is whether the list was modified by adding
> the cfs_rq (and branch needs closing).
>
> It'd appear that the equal condition like in tg_unthrottle_up() would
> make do, i.e.
> !cfs_rq_is_decayed(cfs_rq) || cfs_rq->nr_running
> but the unthrottle_cfs_rq() can be called under a still throttled
> ancestor (i.e. throttle_count not dropping to zero) and in such a case
> cfs_rq should not be added to the list yet.
>
> Therefore, mere !cfs_rq_is_decayed(cfs_rq) doesn't seem correct to me.
fair enough
>
> > > + for_each_sched_entity(se) {
> > > + if (list_add_leaf_cfs_rq(group_cfs_rq(se)))
> > > + break;
> > > + }
> > > + assert_list_leaf_cfs_rq(rq);
> >
> > Instead of adding a loop here you should better jump to unthrottle_throttle ?
>
> Oh, that looks a bit clumsy now (it's an artifact I've left when
> reordering the patch in the series to be backport-friendly).
> Jump to unthrottle_throttle seems easier indeed, there would be just the
> additional check
> if (rq->curr == rq->idle && rq->cfs.nr_running)
> . Besides unnecessary work, it should be harmless.
yes the condition should be always false
>
> Is the jump the preferred form?
yes compared to adding the exact same loop
>
> Michal
next prev parent reply other threads:[~2021-09-10 13:17 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-19 17:50 [RFC PATCH v2 0/5] leaf_cfs_rq_list cleanups and fix Michal Koutný
2021-08-19 17:50 ` [RFC PATCH v2 1/5] sched/fair: Add ancestors of unthrottled undecayed cfs_rq Michal Koutný
2021-09-09 13:57 ` Vincent Guittot
2021-09-10 11:35 ` Michal Koutný
2021-09-10 13:17 ` Vincent Guittot [this message]
2021-08-19 17:50 ` [RFC PATCH v2 2/5] sched: Add group_se() helper Michal Koutný
2021-08-19 17:50 ` [RFC PATCH v2 3/5] sched/fair: Rename leaf_list to more fitting load_list Michal Koutný
2021-09-21 19:06 ` Odin Ugedal
2021-08-19 17:50 ` [RFC PATCH v2 4/5] sched/fair: Simplify load_cfs_rq_list maintenance Michal Koutný
2021-09-10 14:19 ` Vincent Guittot
2021-09-14 9:22 ` Michal Koutný
2021-09-14 9:45 ` Vincent Guittot
2021-09-15 12:30 ` Vincent Guittot
2021-09-15 18:59 ` Odin Ugedal
2021-09-21 19:21 ` Odin Ugedal
2021-09-21 21:40 ` Michal Koutný
2021-08-19 17:50 ` [RFC PATCH v2 5/5] sched/fair: Simplify ancestor enqueue loops Michal Koutný
2021-09-09 14:04 ` Vincent Guittot
2021-09-10 11:35 ` Michal Koutný
2021-09-10 11:43 ` 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='CAKfTPtA+q0PEJtzkZAe=6bMFjD4JrA3k34mGMpDfmMUr5nPfiA@mail.gmail.com' \
--to=vincent.guittot@linaro.org \
--cc=bristot@redhat.com \
--cc=bsegall@google.com \
--cc=dietmar.eggemann@arm.com \
--cc=ggherdovich@suse.cz \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=mkoutny@suse.com \
--cc=odin@uged.al \
--cc=pauld@redhat.com \
--cc=peterz@infradead.org \
--cc=riel@surriel.com \
--cc=rostedt@goodmis.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).