From: Lukasz Luba <lukasz.luba@arm.com>
To: Vincent Donnefort <vincent.donnefort@arm.com>
Cc: peterz@infradead.org, rjw@rjwysocki.net, viresh.kumar@linaro.org,
vincent.guittot@linaro.org, qperret@google.com,
linux-kernel@vger.kernel.org, ionela.voinescu@arm.com,
dietmar.eggemann@arm.com
Subject: Re: [PATCH v2 3/3] PM / EM: Skip inefficient OPPs
Date: Mon, 24 May 2021 13:55:44 +0100 [thread overview]
Message-ID: <b2a24d60-966e-7ee6-b3b8-9c1920881d76@arm.com> (raw)
In-Reply-To: <1621616064-340235-4-git-send-email-vincent.donnefort@arm.com>
On 5/21/21 5:54 PM, Vincent Donnefort wrote:
> Some SoCs, such as the sd855 have OPPs within the same performance domain,
> whose cost is higher than others with a higher frequency. Even though
> those OPPs are interesting from a cooling perspective, it makes no sense
> to use them when the device can run at full capacity. Those OPPs handicap
> the performance domain, when choosing the most energy-efficient CPU and
> are wasting energy. They are inefficient.
>
> Hence, add support for such OPPs to the Energy Model. The table can now
> be read skipping inefficient performance states (and by extension,
> inefficient OPPs).
>
> Currently, the efficient table is used in two paths. Schedutil, and
> find_energy_efficient_cpu(). We have to modify both paths in the same
> patch so they stay synchronized. The thermal framework still relies on
> the full table.
>
> Signed-off-by: Vincent Donnefort <vincent.donnefort@arm.com>
>
> diff --git a/include/linux/energy_model.h b/include/linux/energy_model.h
> index 9be7bde..daaeccf 100644
> --- a/include/linux/energy_model.h
> +++ b/include/linux/energy_model.h
> @@ -17,13 +17,25 @@
> * device). It can be a total power: static and dynamic.
> * @cost: The cost coefficient associated with this level, used during
> * energy calculation. Equal to: power * max_frequency / frequency
> + * @flags: see "em_perf_state flags" description below.
> */
> struct em_perf_state {
> unsigned long frequency;
> unsigned long power;
> unsigned long cost;
> + unsigned long flags;
Maybe for now, we can have 'bool' here?
We would avoid *Num_opps of 'and' operations below
[snip]
> +static inline
> +struct em_perf_state *em_pd_get_efficient_state(struct em_perf_domain *pd,
> + unsigned long freq)
> +{
> + struct em_perf_state *ps;
> + int i;
> +
> + for (i = 0; i < pd->nr_perf_states; i++) {
> + ps = &pd->table[i];
> + if (ps->flags & EM_PERF_STATE_INEFFICIENT)
Here, we can avoid this *N of '&', when having a simple bool
> + continue;
> + if (ps->frequency >= freq)
> + break;
> + }
> +
> + return ps;
> +}
> +
[snip
> +static inline unsigned long em_pd_get_efficient_freq(struct em_perf_domain *pd,
> + unsigned long freq)
> +{
> + struct em_perf_state *ps;
> +
> + if (!pd || !(pd->flags & EM_PERF_DOMAIN_INEFFICIENCIES))
This one is OK, since we have two features for this 'flags' now.
The rest looks good.
Regards,
Lukasz
next prev parent reply other threads:[~2021-05-24 12:55 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-21 16:54 [PATCH v2 0/3] EM / PM: Inefficient OPPs Vincent Donnefort
2021-05-21 16:54 ` [PATCH v2 1/3] PM / EM: Fix inefficient state detection Vincent Donnefort
2021-05-24 12:41 ` Lukasz Luba
2021-05-25 9:50 ` Quentin Perret
2021-05-21 16:54 ` [PATCH v2 2/3] PM / EM: Extend em_perf_domain with a flag field Vincent Donnefort
2021-05-24 12:44 ` Lukasz Luba
2021-05-25 9:54 ` Quentin Perret
2021-05-21 16:54 ` [PATCH v2 3/3] PM / EM: Skip inefficient OPPs Vincent Donnefort
2021-05-24 12:55 ` Lukasz Luba [this message]
2021-05-25 8:48 ` Peter Zijlstra
2021-05-25 9:21 ` Vincent Donnefort
2021-05-25 10:00 ` Vincent Donnefort
2021-05-28 5:09 ` Viresh Kumar
2021-06-01 8:47 ` Vincent Donnefort
2021-06-01 8:56 ` Viresh Kumar
2021-06-01 9:07 ` Quentin Perret
2021-06-01 9:13 ` Viresh Kumar
2021-05-25 9:33 ` Quentin Perret
2021-05-25 9:46 ` Vincent Donnefort
2021-05-25 11:03 ` Lukasz Luba
2021-05-25 13:06 ` Quentin Perret
2021-05-25 13:34 ` Lukasz Luba
2021-05-25 9:47 ` Vincent Donnefort
2021-05-28 5:04 ` Viresh Kumar
2021-05-28 9:00 ` Lukasz Luba
2021-05-26 3:47 ` [PATCH v2 0/3] EM / PM: Inefficient OPPs Viresh Kumar
2021-05-26 8:56 ` Lukasz Luba
2021-05-26 9:33 ` Viresh Kumar
2021-05-27 7:13 ` Lukasz Luba
2021-05-26 9:01 ` Vincent Donnefort
2021-05-26 9:38 ` Viresh Kumar
2021-05-26 9:39 ` Viresh Kumar
2021-05-26 10:24 ` Lukasz Luba
2021-05-26 10:39 ` Lukasz Luba
2021-05-26 11:50 ` Lukasz Luba
2021-05-26 13:49 ` Vincent Donnefort
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=b2a24d60-966e-7ee6-b3b8-9c1920881d76@arm.com \
--to=lukasz.luba@arm.com \
--cc=dietmar.eggemann@arm.com \
--cc=ionela.voinescu@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=qperret@google.com \
--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;
as well as URLs for NNTP newsgroup(s).