From: Quentin Perret <qperret@google.com>
To: Vincent Donnefort <vincent.donnefort@arm.com>
Cc: peterz@infradead.org, rjw@rjwysocki.net, viresh.kumar@linaro.org,
vincent.guittot@linaro.org, linux-kernel@vger.kernel.org,
ionela.voinescu@arm.com, lukasz.luba@arm.com,
dietmar.eggemann@arm.com
Subject: Re: [PATCH] PM / EM: Inefficient OPPs detection
Date: Thu, 15 Apr 2021 14:59:54 +0000 [thread overview]
Message-ID: <YHhU6pb8E5W2eeCX@google.com> (raw)
In-Reply-To: <20210415143453.GB391924@e120877-lin.cambridge.arm.com>
On Thursday 15 Apr 2021 at 15:34:53 (+0100), Vincent Donnefort wrote:
> On Thu, Apr 15, 2021 at 01:16:35PM +0000, Quentin Perret wrote:
> > On Thursday 08 Apr 2021 at 18:10:29 (+0100), Vincent Donnefort wrote:
> > > --- a/kernel/sched/cpufreq_schedutil.c
> > > +++ b/kernel/sched/cpufreq_schedutil.c
> > > @@ -10,6 +10,7 @@
> > >
> > > #include "sched.h"
> > >
> > > +#include <linux/energy_model.h>
> > > #include <linux/sched/cpufreq.h>
> > > #include <trace/events/power.h>
> > >
> > > @@ -164,6 +165,9 @@ static unsigned int get_next_freq(struct sugov_policy *sg_policy,
> > >
> > > freq = map_util_freq(util, freq, max);
> > >
> > > + /* Avoid inefficient performance states */
> > > + freq = em_pd_get_efficient_freq(em_cpu_get(policy->cpu), freq);
> >
> > I remember this was discussed when Douglas sent his patches some time
> > ago, but I still find it sad we index the EM table here but still
> > re-index the cpufreq frequency table later :/
> >
> > Yes in your case this lookup is very inexpensive, but still. EAS relies
> > on the EM's table matching cpufreq's accurately, so this second lookup
> > still feels rather unnecessary ...
>
> To get only a single lookup, we would need to bring the inefficiency knowledge
> directly to the cpufreq framework. But it has its own limitations:
>
> The cpufreq driver can have its own resolve_freq() callback, which means that
> not all the drivers would benefit from that feature.
>
> The cpufreq_table can be ordered and accessed in several ways which brings
> many combinations that would need to be supported, ending-up with something
> much more intrusive. (We can though decide to limit the feature to the low to
> high access that schedutil needs).
>
> As the EM needs schedutil to exist anyway, it seemed to be the right place for
> this code. It allows any cpufreq driver to benefit from the feature, simplify a
> potential extension for a usage by devfreq devices and as a bonus it speeds-up
> energy computing, allowing a more complex Energy Model.
I was thinking of something a bit simpler. cpufreq_driver_resolve_freq
appears to be used only from schedutil (why is it even then?), so we
could just pull it into cpufreq_schedutil.c and just plain skip the call
to cpufreq_frequency_table_target if the target freq has been indexed in
the EM table -- it should already be matching a real OPP.
Thoughts?
Quentin
next prev parent reply other threads:[~2021-04-15 15:09 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-08 17:10 [PATCH] PM / EM: Inefficient OPPs detection Vincent Donnefort
2021-04-08 17:10 ` Vincent Donnefort
2021-04-15 13:12 ` Quentin Perret
2021-04-15 14:12 ` Vincent Donnefort
2021-04-15 15:04 ` Quentin Perret
2021-04-15 15:27 ` Vincent Donnefort
2021-04-22 15:36 ` Vincent Donnefort
2021-04-23 16:14 ` Quentin Perret
2021-04-28 14:46 ` Vincent Donnefort
2021-05-20 11:12 ` Quentin Perret
2021-04-15 13:16 ` Quentin Perret
2021-04-15 14:34 ` Vincent Donnefort
2021-04-15 14:59 ` Quentin Perret [this message]
2021-04-15 15:05 ` Quentin Perret
2021-04-15 15:14 ` Vincent Donnefort
2021-04-15 15:20 ` Quentin Perret
2021-04-15 15:32 ` Lukasz Luba
2021-04-15 15:43 ` Quentin Perret
2021-04-28 13:28 ` Vincent Donnefort
2021-04-22 17:26 ` Lukasz Luba
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=YHhU6pb8E5W2eeCX@google.com \
--to=qperret@google.com \
--cc=dietmar.eggemann@arm.com \
--cc=ionela.voinescu@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lukasz.luba@arm.com \
--cc=peterz@infradead.org \
--cc=rjw@rjwysocki.net \
--cc=vincent.donnefort@arm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox