]> www.infradead.org Git - users/jedix/linux-maple.git/commit
cpufreq: Introduce cpufreq_policy_refresh()
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 28 Mar 2025 20:47:31 +0000 (21:47 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 9 Apr 2025 19:22:16 +0000 (21:22 +0200)
commit684e1855211145b71f8d9aaa49d2cc67067cd42a
treea5a7224f604a01aca4f81fb3d28d61917fc6b71f
parentece898da386214cf9bf693fe21694b556b785428
cpufreq: Introduce cpufreq_policy_refresh()

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@intel.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Acked-by: Sudeep Holla <sudeep.holla@arm.com>
Tested-by: Sudeep Holla <sudeep.holla@arm.com>
Link: https://patch.msgid.link/6047110.MhkbZ0Pkbq@rjwysocki.net
drivers/cpufreq/cpufreq.c