Re: [PATCH v2 2/2] cpufreq: CPPC: Dont read counters for idle CPUs

From: Beata Michalska
Date: Thu Jul 31 2025 - 16:23:53 EST


On Thu, Jul 31, 2025 at 04:43:24PM +0530, Viresh Kumar wrote:
> On 31-07-25, 10:27, Beata Michalska wrote:
> > I am still wondering whether cpufreq core is not a better suited place for
> > checking whether the CPU is idle. We could potentially try on anther CPU within
> > the policy and if there is none, just provide the last known freq ?
> >
> > @Viresh: What are your thoughts on that ?
>
> For other platforms (that' don't have counters to read), I think a call to
> ->get() to get the currently configured frequency is perfectly fine. Isn't it ?
I assume it is. I was just thinking out loud and wasn't suggesting anything
otherwise. The reason why I mentioned that is that getting current frequency
for an idle CPU seems like smth we could potentially optimise away and save some
cycles (fixing other problems on the way, like this one).
But if that's undesired for any reason, it's perfectly fine to stay with
unconditional calls to `->get()'.

---
BR
Beata
>
> --
> viresh