diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2025-03-28 21:47:31 +0100 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2025-04-09 21:22:16 +0200 |
commit | 684e1855211145b71f8d9aaa49d2cc67067cd42a (patch) | |
tree | a5a7224f604a01aca4f81fb3d28d61917fc6b71f /rust/helpers | |
parent | ece898da386214cf9bf693fe21694b556b785428 (diff) |
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
Diffstat (limited to 'rust/helpers')
0 files changed, 0 insertions, 0 deletions