From: Morten Rasmussen <morten.rasmussen@arm.com>
To: Vincent Guittot <vincent.guittot@linaro.org>
Cc: Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@kernel.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
"rjw@rjwysocki.net" <rjw@rjwysocki.net>,
Juri Lelli <juri.lelli@arm.com>,
Dietmar Eggemann <dietmar.eggemann@arm.com>
Subject: Re: [RFC PATCH 1/2] sched/rt: add utilization tracking
Date: Wed, 31 May 2017 08:57:00 +0100 [thread overview]
Message-ID: <20170531075659.GB13580@e105550-lin.cambridge.arm.com> (raw)
In-Reply-To: <CAKfTPtAQZ6nJa2qLg89w4v7SWk6Ur3fM6mfzFRkJHECuhmFDTw@mail.gmail.com>
On Tue, May 30, 2017 at 06:24:27PM +0200, Vincent Guittot wrote:
> On 30 May 2017 at 17:50, Morten Rasmussen <morten.rasmussen@arm.com> wrote:
> > On Wed, May 24, 2017 at 11:00:51AM +0200, Vincent Guittot wrote:
> >> @@ -1534,6 +1534,8 @@ static struct task_struct *_pick_next_task_rt(struct rq *rq)
> >> return p;
> >> }
> >>
> >> +extern int update_rt_rq_load_avg(u64 now, int cpu, struct rt_rq *rt_rq, int running);
> >> +
> >> static struct task_struct *
> >> pick_next_task_rt(struct rq *rq, struct task_struct *prev, struct rq_flags *rf)
> >> {
> >> @@ -1579,6 +1581,10 @@ pick_next_task_rt(struct rq *rq, struct task_struct *prev, struct rq_flags *rf)
> >>
> >> queue_push_tasks(rq);
> >>
> >> + if (p)
> >> + update_rt_rq_load_avg(rq_clock_task(rq), cpu_of(rq), rt_rq,
> >> + rq->curr->sched_class == &rt_sched_class);
> >> +
> >> return p;
> >> }
> >
> > I'm quite likely missing something, but why is this update need here?
> >
> > IIUC, put_prev_task() was called just a couple of lines further up which
> > also does an update (below). The only difference is that this update
> > depends on the current task being an RT task, which isn't always the
> > case. Is it supposed to decay the RT PELT average when we pick an RT
> > task and the previous task !RT? In that case, the "running" argument
> > needs a ! in front.
>
> if prev task is not a rt task but a cfs task, the put_prev_task will
> apply on cfs class and cfs pelt but not on rt one
> so when the next task is a rt task, we have to update rt utilization
> either to decay the rt utilization if curr task (prev task) is not rt,
> or to add utilization if curr task is rt task.
> we have something similar with put_prev_task_rt
Yes. It was just me getting the logic wrong. rq->curr->sched_class ==
&rt_sched_class would of course be false if the previous task is CFS
meaning "running" is false and hence we will decay the rt rq PELT signal
as we correctly should.
next prev parent reply other threads:[~2017-05-31 7:57 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-24 9:00 [PATCH 0/2] track rt rq utilization Vincent Guittot
2017-05-24 9:00 ` [RFC PATCH 1/2] sched/rt: add utilization tracking Vincent Guittot
2017-05-30 15:50 ` Morten Rasmussen
2017-05-30 16:24 ` Vincent Guittot
2017-05-31 7:57 ` Morten Rasmussen [this message]
2017-05-31 9:40 ` Peter Zijlstra
2017-05-31 10:30 ` Peter Zijlstra
2017-05-31 10:41 ` Juri Lelli
2017-05-31 11:39 ` Peter Zijlstra
2017-05-31 11:24 ` Vincent Guittot
2017-05-24 9:00 ` [PATCH 2/2] cpufreq/schedutil: add rt " 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=20170531075659.GB13580@e105550-lin.cambridge.arm.com \
--to=morten.rasmussen@arm.com \
--cc=dietmar.eggemann@arm.com \
--cc=juri.lelli@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=rjw@rjwysocki.net \
--cc=vincent.guittot@linaro.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
all inboxes | Powered by JetHome®