Re: [RFC PATCH 1/2] thermal/cpufreq_cooling: remove unused cpu_idx in get_load()
From: Viresh Kumar
Date: Mon Mar 23 2026 - 06:49:40 EST
On 23-03-26, 09:20, Lukasz Luba wrote:
> Thanks for monitoring the development (it's always good
> to have extra engineer opinion)!
>
> I've checked the commit that you referred to and the 'i++' there.
> It's safe. That commit removed the heavy operation for only
> tracing purpose, namely:
> - allocate buffer for N CPUs for 'load_cpu' pointer
> - populate CPUs' load from the idle fwk
> - put that info into the trace
> - free the 'load_cpu' buffer
>
> That has been redesigned since it was just for tracing
> and introducing extra time spent for code run in the
> throttling phase.
>
> The code in get_load() is OK with the commit that you
> mentioned.
The code
load = get_load(cpufreq_cdev, cpu, i);
depends on `i` being incremented in the loop to get the correct
`cpu_idx`. But the said commit removed it and left `i` to be set to 0
for ever.
How is that okay ? What am I missing ?
--
viresh