From: Peter Zijlstra <peterz@infradead.org>
To: Vincent Guittot <vincent.guittot@linaro.org>
Cc: Dietmar Eggemann <dietmar.eggemann@arm.com>,
Ingo Molnar <mingo@kernel.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
Yuyang Du <yuyang.du@intel.com>,
Morten Rasmussen <Morten.Rasmussen@arm.com>,
"linaro-kernel@lists.linaro.org" <linaro-kernel@lists.linaro.org>,
Paul Turner <pjt@google.com>, Ben Segall <bsegall@google.com>,
Wanpeng Li <kernellwp@gmail.com>
Subject: Re: [PATCH 4/6 v5] sched: propagate load during synchronous attach/detach
Date: Wed, 26 Oct 2016 13:16:17 +0200 [thread overview]
Message-ID: <20161026111617.GF3102@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <CAKfTPtBR1YTEwqQ0Ys4h17YhW8z45QmqkS1j7phN6MShZ++0cQ@mail.gmail.com>
On Wed, Oct 26, 2016 at 09:05:49AM +0200, Vincent Guittot wrote:
> >
> > The 'detach across' and 'attach across' in detach_task_cfs_rq() and
> > attach_entity_cfs_rq() do the same so couldn't you not create a
> > function propagate_foo() for it? This would avoid this ifdef as
> > well.
> >
> > You could further create in your '[PATCH 1/6 v5] sched: factorize attach entity':
> >
> > detach_entity_cfs_rq() {
> > update_load_avg()
> > detach_entity_load_avg()
> > update_tg_load_avg()
> > propagate_load_avg()
> > }
> >
> > and then we would have:
> >
> > attach_task_cfs_rq() -> attach_entity_cfs_rq() -> propagate_foo()
> > detach_task_cfs_rq() -> detach_entity_cfs_rq() -> propagate_foo()
> >
> > I guess you didn't because it would be only called one time but this
> > symmetric approaches are easier to remember (at least for me).
>
> Yes i haven't created attach_entity_cfs_rq because it would be used only once.
> Regarding the creation of a propagate_foo function, i have just
> followed a similar skeleton as what is done in
> enqueue/dequeue_task_fair
>
> I don't have strong opinion about creating this indirection for code
> readability. Others, have you got a preference ?
I think I agree with Dietmar. Duplicate code needs a helper function and
it would be nice to keep symmetry, even if there's only a single
call site.
next prev parent reply other threads:[~2016-10-26 11:16 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-17 9:14 [PATCH 0/6 v5] sched: reflect sched_entity move into task_group's load Vincent Guittot
2016-10-17 9:14 ` [PATCH 1/6 v5] sched: factorize attach entity Vincent Guittot
2016-10-17 9:14 ` [PATCH 2/6 v5] sched: fix hierarchical order in rq->leaf_cfs_rq_list Vincent Guittot
2016-10-17 9:14 ` [PATCH 3/6 v5] sched: factorize PELT update Vincent Guittot
2016-10-26 11:41 ` Peter Zijlstra
2016-10-26 12:56 ` Vincent Guittot
2016-10-17 9:14 ` [PATCH 4/6 v5] sched: propagate load during synchronous attach/detach Vincent Guittot
2016-10-21 12:19 ` Dietmar Eggemann
2016-10-26 7:05 ` Vincent Guittot
2016-10-26 11:16 ` Peter Zijlstra [this message]
2016-10-26 12:31 ` Vincent Guittot
2016-10-26 10:54 ` Peter Zijlstra
2016-10-26 12:31 ` Vincent Guittot
2016-10-26 14:28 ` Peter Zijlstra
2016-10-26 18:40 ` Vincent Guittot
2016-10-26 11:45 ` Peter Zijlstra
2016-10-17 9:14 ` [PATCH 5/6 v5] sched: propagate asynchrous detach Vincent Guittot
2016-10-17 9:14 ` [PATCH 6/6 v5] sched: fix task group initialization 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=20161026111617.GF3102@twins.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=Morten.Rasmussen@arm.com \
--cc=bsegall@google.com \
--cc=dietmar.eggemann@arm.com \
--cc=kernellwp@gmail.com \
--cc=linaro-kernel@lists.linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=pjt@google.com \
--cc=vincent.guittot@linaro.org \
--cc=yuyang.du@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox