From: Peter Zijlstra <peterz@infradead.org>
To: Vincent Guittot <vincent.guittot@linaro.org>
Cc: Yuyang Du <yuyang.du@intel.com>, Ingo Molnar <mingo@kernel.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
Mike Galbraith <umgwanakikbuti@gmail.com>,
Benjamin Segall <bsegall@google.com>,
Paul Turner <pjt@google.com>,
Morten Rasmussen <morten.rasmussen@arm.com>,
Dietmar Eggemann <dietmar.eggemann@arm.com>,
Matt Fleming <matt@codeblueprint.co.uk>
Subject: Re: [PATCH v6 1/4] sched/fair: Fix attaching task sched avgs twice when switching to fair or changing task group
Date: Fri, 17 Jun 2016 13:31:01 +0200 [thread overview]
Message-ID: <20160617113101.GO30154@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <CAKfTPtDopSCBsooZdO=nO_EGja9MvHu5de0zFPb9d+aebPE16g@mail.gmail.com>
On Thu, Jun 16, 2016 at 11:21:55PM +0200, Vincent Guittot wrote:
> Your proposal below looks good to me
> > ---
> > kernel/sched/fair.c | 4 ++++
> > 1 file changed, 4 insertions(+)
> >
> > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> > index f75930bdd326..5d8fa135bbc5 100644
> > --- a/kernel/sched/fair.c
> > +++ b/kernel/sched/fair.c
> > @@ -8349,6 +8349,7 @@ static void detach_task_cfs_rq(struct task_struct *p)
> > {
> > struct sched_entity *se = &p->se;
> > struct cfs_rq *cfs_rq = cfs_rq_of(se);
> > + u64 now = cfs_rq_clock_task(cfs_rq);
> >
> > if (!vruntime_normalized(p)) {
> > /*
> > @@ -8360,6 +8361,7 @@ static void detach_task_cfs_rq(struct task_struct *p)
> > }
> >
> > /* Catch up with the cfs_rq and remove our load when we leave */
> > + update_cfs_rq_load_avg(now, cfs_rq, false);
> > detach_entity_load_avg(cfs_rq, se);
> > }
> >
> > @@ -8367,6 +8369,7 @@ static void attach_task_cfs_rq(struct task_struct *p)
> > {
> > struct sched_entity *se = &p->se;
> > struct cfs_rq *cfs_rq = cfs_rq_of(se);
> > + u64 now = cfs_rq_clock_task(cfs_rq);
> >
> > #ifdef CONFIG_FAIR_GROUP_SCHED
> > /*
> > @@ -8377,6 +8380,7 @@ static void attach_task_cfs_rq(struct task_struct *p)
> > #endif
> >
> > /* Synchronize task with its cfs_rq */
> > + update_cfs_rq_load_avg(now, cfs_rq, false);
> > attach_entity_load_avg(cfs_rq, se);
> >
> > if (!vruntime_normalized(p))
Should we also call update_tg_load_avg() if update_cfs_rq_load_avg()
returns? Most sites seem to do this.
Someone should document these things somewhere....
next prev parent reply other threads:[~2016-06-17 11:31 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-14 22:21 [PATCH v6 0/4] sched/fair: Fix attach and detach sched avgs for task group change and sched class change Yuyang Du
2016-06-14 22:21 ` [PATCH v6 1/4] sched/fair: Fix attaching task sched avgs twice when switching to fair or changing task group Yuyang Du
2016-06-15 7:46 ` Vincent Guittot
2016-06-15 0:18 ` Yuyang Du
2016-06-15 14:15 ` Vincent Guittot
2016-06-15 15:22 ` Peter Zijlstra
2016-06-16 1:00 ` Yuyang Du
2016-06-16 16:30 ` Vincent Guittot
2016-06-16 17:17 ` Peter Zijlstra
2016-06-16 18:57 ` Vincent Guittot
2016-06-16 18:51 ` Peter Zijlstra
2016-06-16 19:00 ` Vincent Guittot
2016-06-16 20:07 ` Peter Zijlstra
2016-06-16 21:21 ` Vincent Guittot
2016-06-17 2:12 ` Yuyang Du
2016-06-17 12:00 ` Vincent Guittot
2016-06-17 9:48 ` Peter Zijlstra
2016-06-17 11:31 ` Peter Zijlstra [this message]
2016-06-14 22:21 ` [PATCH v6 2/4] sched/fair: Move load and util avgs from wake_up_new_task() to sched_fork() Yuyang Du
2016-06-14 22:21 ` [PATCH v6 3/4] sched/fair: Skip detach sched avgs for new task when changing task groups Yuyang Du
2016-06-14 22:21 ` [PATCH v6 4/4] sched/fair: Add inline to detach_entity_load_evg() Yuyang Du
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=20160617113101.GO30154@twins.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=bsegall@google.com \
--cc=dietmar.eggemann@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=matt@codeblueprint.co.uk \
--cc=mingo@kernel.org \
--cc=morten.rasmussen@arm.com \
--cc=pjt@google.com \
--cc=umgwanakikbuti@gmail.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;
as well as URLs for NNTP newsgroup(s).