From: Peter Zijlstra <peterz@infradead.org>
To: Vincent Guittot <vincent.guittot@linaro.org>
Cc: linux@armlinux.org.uk, catalin.marinas@arm.com, will@kernel.org,
paul.walmsley@sifive.com, palmer@dabbelt.com,
aou@eecs.berkeley.edu, sudeep.holla@arm.com,
gregkh@linuxfoundation.org, rafael@kernel.org, mingo@redhat.com,
juri.lelli@redhat.com, dietmar.eggemann@arm.com,
rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de,
bristot@redhat.com, vschneid@redhat.com, viresh.kumar@linaro.org,
lenb@kernel.org, robert.moore@intel.com, lukasz.luba@arm.com,
ionela.voinescu@arm.com, pierre.gondois@arm.com,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org,
linux-pm@vger.kernel.org, linux-acpi@vger.kernel.org,
acpica-devel@lists.linuxfoundation.org,
conor.dooley@microchip.com, suagrfillet@gmail.com,
ajones@ventanamicro.com, lftan@kernel.org
Subject: Re: [PATCH v3 4/6] energy_model: use a fixed reference frequency
Date: Wed, 25 Oct 2023 13:54:56 +0200 [thread overview]
Message-ID: <20231025115456.GD31201@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <20231018162540.667646-5-vincent.guittot@linaro.org>
On Wed, Oct 18, 2023 at 06:25:38PM +0200, Vincent Guittot wrote:
> The last item of a performance domain is not always the performance point
> that has been used to compute CPU's capacity. This can lead to different
> target frequency compared with other part of the system like schedutil and
> would result in wrong energy estimation.
>
> A new arch_scale_freq_ref() is available to return a fixed and coherent
> frequency reference that can be used when computing the CPU's frequency
> for an level of utilization. Use this function to get this reference
> frequency.
>
> Energy model is never used without defining arch_scale_freq_ref() but
> can be compiled. Define a default arch_scale_freq_ref() returning 0
> in such case.
>
> Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
> Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
> Tested-by: Lukasz Luba <lukasz.luba@arm.com>
>
> ---
> include/linux/energy_model.h | 14 +++++++++++---
> 1 file changed, 11 insertions(+), 3 deletions(-)
>
> diff --git a/include/linux/energy_model.h b/include/linux/energy_model.h
> index b9caa01dfac4..1b0c8490d4bd 100644
> --- a/include/linux/energy_model.h
> +++ b/include/linux/energy_model.h
> @@ -204,6 +204,14 @@ struct em_perf_state *em_pd_get_efficient_state(struct em_perf_domain *pd,
> return ps;
> }
>
> +#ifndef arch_scale_freq_ref
> +static __always_inline
> +unsigned int arch_scale_freq_ref(int cpu)
> +{
> + return 0;
> +}
> +#endif
Hmm, did I not see the exact same thing in cpufreq.h two patches ago?
next prev parent reply other threads:[~2023-10-25 11:55 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-18 16:25 [PATCH v3 0/6] consolidate and cleanup CPU capacity Vincent Guittot
2023-10-18 16:25 ` [PATCH v3 1/6] topology: add a new arch_scale_freq_reference Vincent Guittot
2023-10-18 16:25 ` [PATCH v3 2/6] cpufreq: use the fixed and coherent frequency for scaling capacity Vincent Guittot
2023-10-18 17:23 ` Rafael J. Wysocki
2023-10-18 16:25 ` [PATCH v3 3/6] cpufreq/schedutil: use a fixed reference frequency Vincent Guittot
2023-10-18 17:22 ` Rafael J. Wysocki
2023-10-25 11:53 ` Peter Zijlstra
2023-10-25 12:51 ` Vincent Guittot
2023-10-25 20:13 ` Dietmar Eggemann
2023-10-26 15:13 ` Vincent Guittot
2023-10-18 16:25 ` [PATCH v3 4/6] energy_model: " Vincent Guittot
2023-10-25 11:54 ` Peter Zijlstra [this message]
2023-10-25 12:11 ` Peter Zijlstra
2023-10-25 12:24 ` Rafael J. Wysocki
2023-10-25 12:54 ` Vincent Guittot
2023-10-18 16:25 ` [PATCH v3 5/6] cpufreq/cppc: set the frequency used for computing the capacity Vincent Guittot
2023-10-18 17:26 ` Rafael J. Wysocki
2023-10-20 16:05 ` Pierre Gondois
2023-10-24 9:56 ` Vincent Guittot
2023-10-25 12:24 ` Peter Zijlstra
2023-10-25 12:51 ` Peter Zijlstra
2023-10-25 12:58 ` Vincent Guittot
2023-10-18 16:25 ` [RFC v3 6/6] arm64/amu: use capacity_ref_freq to set AMU ratio Vincent Guittot
2023-10-23 20:58 ` Ionela Voinescu
2023-10-24 9:58 ` Vincent Guittot
2023-10-26 11:19 ` Dietmar Eggemann
2023-10-26 14:30 ` 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=20231025115456.GD31201@noisy.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=acpica-devel@lists.linuxfoundation.org \
--cc=ajones@ventanamicro.com \
--cc=aou@eecs.berkeley.edu \
--cc=bristot@redhat.com \
--cc=bsegall@google.com \
--cc=catalin.marinas@arm.com \
--cc=conor.dooley@microchip.com \
--cc=dietmar.eggemann@arm.com \
--cc=gregkh@linuxfoundation.org \
--cc=ionela.voinescu@arm.com \
--cc=juri.lelli@redhat.com \
--cc=lenb@kernel.org \
--cc=lftan@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=linux@armlinux.org.uk \
--cc=lukasz.luba@arm.com \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=pierre.gondois@arm.com \
--cc=rafael@kernel.org \
--cc=robert.moore@intel.com \
--cc=rostedt@goodmis.org \
--cc=suagrfillet@gmail.com \
--cc=sudeep.holla@arm.com \
--cc=vincent.guittot@linaro.org \
--cc=viresh.kumar@linaro.org \
--cc=vschneid@redhat.com \
--cc=will@kernel.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