From: Peter Zijlstra <peterz@infradead.org>
To: Patrick Bellasi <patrick.bellasi@arm.com>
Cc: Juri Lelli <Juri.Lelli@arm.com>,
Viresh Kumar <viresh.kumar@linaro.org>,
Rafael Wysocki <rjw@rjwysocki.net>,
Ingo Molnar <mingo@redhat.com>,
linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org,
linux-kernel@vger.kernel.org,
Vincent Guittot <vincent.guittot@linaro.org>,
Robin Randhawa <robin.randhawa@arm.com>,
Steve Muckle <smuckle.linux@gmail.com>,
tkjos@google.com, Morten Rasmussen <morten.rasmussen@arm.com>
Subject: Re: [PATCH] cpufreq: schedutil: add up/down frequency transition rate limits
Date: Mon, 21 Nov 2016 16:26:06 +0100 [thread overview]
Message-ID: <20161121152606.GI3092@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <20161121145919.GA3414@e105326-lin>
On Mon, Nov 21, 2016 at 02:59:19PM +0000, Patrick Bellasi wrote:
> A fundamental problem in IMO is that we are trying to use a "dynamic
> metric" to act as a "predictor".
>
> PELT is a "dynamic metric" since it continuously change while a task
> is running. Thus it does not really provides an answer to the question
> "how big this task is?" _while_ the task is running.
> Such an information is available only when the task sleep.
> Indeed, only when the task completes an activation and goes to sleep
> PELT has reached a value which represents how much CPU bandwidth has
> been required by that task.
I'm not sure I agree with that. We can only tell how big a task is
_while_ its running, esp. since its behaviour is not steady-state. Tasks
can change etc..
Also, as per the whole argument on why peak_util was bad, at the moment
a task goes to sleep, the PELT signal is actually an over-estimate,
since it hasn't yet had time to average out.
And a real predictor requires a crytal-ball instruction, but until such
time that hardware people bring us that goodness, we'll have to live
with predicting the near future based on the recent past.
> For example, if we consider the simple yet interesting case of a
> periodic task, PELT is a wobbling signal which reports a correct
> measure of how much bandwidth is required only when a task completes
> its RUNNABLE status.
Its actually an over-estimate at that point, since it just added a
sizable chunk to the signal (for having been runnable) that hasn't yet
had time to decay back to the actual value.
> To be more precise, the correct value is provided by the average PELT
> and this also depends on the period of the task compared to the
> PELT rate constant.
> But still, to me a fundamental point is that the "raw PELT value" is
> not really meaningful in _each and every single point in time_.
Agreed.
> All that considered, we should be aware that to properly drive
> schedutil and (in the future) the energy aware scheduler decisions we
> perhaps need better instead a "predictor".
> In the simple case of the periodic task, a good predictor should be
> something which reports always the same answer _in each point in
> time_.
So the problem with this is that not many tasks are that periodic, and
any filter you put on top will add, lets call it, momentum to the
signal. A reluctance to change. This might negatively affect
non-periodic tasks.
In any case, worth trying, see what happens.
> For example, a task running 30 [ms] every 100 [ms] is a ~300 util_avg
> task. With PELT, we get a signal which range between [120,550] with an
> average of ~300 which is instead completely ignored. By capping the
> decay we will get:
>
> decay_cap [ms] range average
> 0 120:550 300
> 64 140:560 310
> 32 320:660 430
>
> which means that still the raw PELT signal is wobbling and never
> provides a consistent response to drive decisions.
>
> Thus, a "predictor" should be something which sample information from
> PELT to provide a more consistent view, a sort of of low-pass filter
> on top of the "dynamic metric" which is PELT.
>
> Should not such a "predictor" help on solving some of the issues
> related to PELT slow ramp-up or fast ramp-down?
I think intel_pstate recently added a local PID filter, I asked at the
time if something like that should live in generic code, looks like
maybe it should.
next prev parent reply other threads:[~2016-11-21 15:26 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-17 5:18 [PATCH] cpufreq: schedutil: add up/down frequency transition rate limits Viresh Kumar
2016-11-21 10:08 ` Viresh Kumar
2016-11-21 10:19 ` Peter Zijlstra
2016-11-21 10:48 ` Viresh Kumar
2016-11-21 11:12 ` Peter Zijlstra
2016-11-21 11:30 ` Viresh Kumar
2016-11-21 11:48 ` Peter Zijlstra
2016-11-21 12:14 ` Juri Lelli
2016-11-21 12:26 ` Peter Zijlstra
2016-11-21 13:53 ` Juri Lelli
2016-11-21 14:17 ` Peter Zijlstra
2016-11-21 14:37 ` Juri Lelli
2016-11-21 14:43 ` Peter Zijlstra
2016-11-21 14:59 ` Juri Lelli
2016-11-22 9:27 ` Vincent Guittot
2016-11-22 11:03 ` Patrick Bellasi
2016-11-21 14:59 ` Patrick Bellasi
2016-11-21 15:26 ` Peter Zijlstra [this message]
2016-11-21 15:34 ` Peter Zijlstra
2016-11-21 16:24 ` Patrick Bellasi
2016-11-21 16:46 ` Peter Zijlstra
2016-11-21 20:53 ` Rafael J. Wysocki
2016-12-29 3:24 ` Wanpeng Li
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=20161121152606.GI3092@twins.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=Juri.Lelli@arm.com \
--cc=linaro-kernel@lists.linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=morten.rasmussen@arm.com \
--cc=patrick.bellasi@arm.com \
--cc=rjw@rjwysocki.net \
--cc=robin.randhawa@arm.com \
--cc=smuckle.linux@gmail.com \
--cc=tkjos@google.com \
--cc=vincent.guittot@linaro.org \
--cc=viresh.kumar@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 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.