Re: [PATCH v7 16/23] powercap/dtpm_cpu: Use new Energy Model interface to get table

From: Dietmar Eggemann
Date: Mon Jan 29 2024 - 13:14:38 EST


On 17/01/2024 10:57, Lukasz Luba wrote:

[...]

> drivers/powercap/dtpm_cpu.c | 39 +++++++++++++++++++++++++++----------
> 1 file changed, 29 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/powercap/dtpm_cpu.c b/drivers/powercap/dtpm_cpu.c
> index 9193c3b8edeb..ee0d1aa3e023 100644
> --- a/drivers/powercap/dtpm_cpu.c
> +++ b/drivers/powercap/dtpm_cpu.c
> @@ -42,6 +42,7 @@ static u64 set_pd_power_limit(struct dtpm *dtpm, u64 power_limit)
> {
> struct dtpm_cpu *dtpm_cpu = to_dtpm_cpu(dtpm);
> struct em_perf_domain *pd = em_cpu_get(dtpm_cpu->cpu);
> + struct em_perf_state *table;
> struct cpumask cpus;
> unsigned long freq;
> u64 power;
> @@ -50,20 +51,22 @@ static u64 set_pd_power_limit(struct dtpm *dtpm, u64 power_limit)
> cpumask_and(&cpus, cpu_online_mask, to_cpumask(pd->cpus));
> nr_cpus = cpumask_weight(&cpus);
>
> + rcu_read_lock();
> + table = em_perf_state_from_pd(pd);

'table' vs. 'perf state(s)' ... another example (compare to comment in
12/23).

[...]