From: Lukasz Luba <lukasz.luba@arm.com>
To: Vincent Guittot <vincent.guittot@linaro.org>
Cc: conor.dooley@microchip.com, will@kernel.org,
ionela.voinescu@arm.com, vschneid@redhat.com, mgorman@suse.de,
bsegall@google.com, dietmar.eggemann@arm.com,
peterz@infradead.org, sudeep.holla@arm.com,
aou@eecs.berkeley.edu, palmer@dabbelt.com,
linux-pm@vger.kernel.org, linux-riscv@lists.infradead.org,
pierre.gondois@arm.com, paul.walmsley@sifive.com,
catalin.marinas@arm.com, linux@armlinux.org.uk,
suagrfillet@gmail.com, ajones@ventanamicro.com,
juri.lelli@redhat.com, lftan@kernel.org, mingo@redhat.com,
rafael@kernel.org, gregkh@linuxfoundation.org,
rostedt@goodmis.org, bristot@redhat.com, viresh.kumar@linaro.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/6] topology: add a new arch_scale_freq_reference
Date: Wed, 18 Oct 2023 12:06:24 +0100 [thread overview]
Message-ID: <db2ba48c-f1f4-41ca-99e6-4cb756a8ac00@arm.com> (raw)
In-Reply-To: <20231009103621.374412-3-vincent.guittot@linaro.org>
On 10/9/23 11:36, Vincent Guittot wrote:
> Create a new method to get a unique and fixed max frequency. Currently
> cpuinfo.max_freq or the highest (or last) state of performance domain are
> used as the max frequency when computing the frequency for a level of
> utilization but:
> - cpuinfo_max_freq can change at runtime. boost is one example of
> such change.
> - cpuinfo.max_freq and last item of the PD can be different leading to
> different results between cpufreq and energy model.
>
> We need to save the reference frequency that has been used when computing
> the CPUs capacity and use this fixed and coherent value to convert between
> frequency and CPU's capacity.
>
> In fact, we already save the frequency that has been used when computing
> the capacity of each CPU. We extend the precision to save khZ instead of
> Mhz currently and we modify the type to be aligned with other variables
> used when converting frequency to capacity and the other way.
>
> Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
> ---
> arch/arm/include/asm/topology.h | 1 +
> arch/arm64/include/asm/topology.h | 1 +
> arch/riscv/include/asm/topology.h | 1 +
> drivers/base/arch_topology.c | 29 ++++++++++++++---------------
> include/linux/arch_topology.h | 7 +++++++
> 5 files changed, 24 insertions(+), 15 deletions(-)
[snip]
> @@ -170,9 +172,9 @@ DEFINE_PER_CPU(unsigned long, thermal_pressure);
> * operating on stale data when hot-plug is used for some CPUs. The
> * @capped_freq reflects the currently allowed max CPUs frequency due to
> * thermal capping. It might be also a boost frequency value, which is bigger
> - * than the internal 'freq_factor' max frequency. In such case the pressure
> - * value should simply be removed, since this is an indication that there is
> - * no thermal throttling. The @capped_freq must be provided in kHz.
> + * than the internal 'capacity_ref_freq' max frequency. In such case the
> + * pressure value should simply be removed, since this is an indication that
> + * there is no thermal throttling. The @capped_freq must be provided in kHz.
> */
> void topology_update_thermal_pressure(const struct cpumask *cpus,
> unsigned long capped_freq)
> @@ -183,10 +185,7 @@ void topology_update_thermal_pressure(const struct cpumask *cpus,
>
> cpu = cpumask_first(cpus);
> max_capacity = arch_scale_cpu_capacity(cpu);
> - max_freq = per_cpu(freq_factor, cpu);
> -
> - /* Convert to MHz scale which is used in 'freq_factor' */
> - capped_freq /= 1000;
I do like this small speed-up and I'm happy that it's possible with this
new design. (IIRC some of your platforms can update the thermal
pressure quite many time per sec - that might be the reason why
you see some speed-ups mentioned in the cover letter)
> + max_freq = arch_scale_freq_ref(cpu);
>
LGTM
Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
next prev parent reply other threads:[~2023-10-18 11:05 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-09 10:36 [PATCH v2 0/6] consolidate and cleanup CPU capacity Vincent Guittot
2023-10-09 10:36 ` [PATCH v2 1/6] sched: consolidate and cleanup access to CPU's max compute capacity Vincent Guittot
2023-10-09 11:01 ` Ingo Molnar
2023-10-09 10:36 ` [PATCH v2 2/6] topology: add a new arch_scale_freq_reference Vincent Guittot
2023-10-11 10:27 ` Pierre Gondois
2023-10-11 13:48 ` Vincent Guittot
2023-10-18 11:06 ` Lukasz Luba [this message]
2023-10-09 10:36 ` [PATCH v2 3/6] cpufreq: use the fixed and coherent frequency for scaling capacity Vincent Guittot
2023-10-09 11:01 ` Viresh Kumar
2023-10-18 11:16 ` Lukasz Luba
2023-10-09 10:36 ` [PATCH v2 4/6] cpufreq/schedutil: use a fixed reference frequency Vincent Guittot
2023-10-18 11:21 ` Lukasz Luba
2023-10-09 10:36 ` [PATCH v2 5/6] energy_model: " Vincent Guittot
2023-10-18 9:16 ` Lukasz Luba
2023-10-09 10:36 ` [PATCH v2 6/6] cpufreq/cppc: set the frequency used for capacity computation Vincent Guittot
2023-10-11 10:27 ` Pierre Gondois
2023-10-11 14:25 ` Vincent Guittot
2023-10-16 12:12 ` Ionela Voinescu
2023-10-16 15:32 ` Vincent Guittot
2023-10-17 9:02 ` Ionela Voinescu
2023-10-17 13:41 ` Vincent Guittot
2023-10-18 11:27 ` [PATCH v2 0/6] consolidate and cleanup CPU capacity 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=db2ba48c-f1f4-41ca-99e6-4cb756a8ac00@arm.com \
--to=lukasz.luba@arm.com \
--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=lftan@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=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=peterz@infradead.org \
--cc=pierre.gondois@arm.com \
--cc=rafael@kernel.org \
--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