Re: [PATCH v1 09/10] cpufreq: Introduce cpufreq_policy_refresh()

From: Viresh Kumar
Date: Tue Apr 01 2025 - 04:51:35 EST


On 28-03-25, 21:47, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>
>
> Since cpufreq_update_limits() obtains a cpufreq policy pointer for the
> given CPU and reference counts the object pointed to by it, calling
> cpufreq_update_policy() from cpufreq_update_limits() is somewhat
> wasteful because that function calls cpufreq_cpu_get() on the same
> CPU again.
>
> To avoid that unnecessary overhead, move the part of the code running
> under the policy rwsem from cpufreq_update_policy() to a new function
> called cpufreq_policy_refresh() and invoke that new function from
> both cpufreq_update_policy() and cpufreq_update_limits().
>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>
> ---
> drivers/cpufreq/cpufreq.c | 31 ++++++++++++++++++-------------
> 1 file changed, 18 insertions(+), 13 deletions(-)

Acked-by: Viresh Kumar <viresh.kumar@xxxxxxxxxx>

--
viresh