diff options
author | Zihuan Zhang <zhangzihuan@kylinos.cn> | 2025-07-25 07:14:50 +0300 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2025-08-19 22:13:12 +0300 |
commit | c5746dc1898a1bd5518a03081dc7e380569e269d (patch) | |
tree | 4b53abf24c19807377361e78a109799d28dc8b09 /tools/testing/selftests/bpf/prog_tests/autoload.c | |
parent | c17b750b3ad9f45f2b6f7e6f7f4679844244f0b9 (diff) | |
download | linux-c5746dc1898a1bd5518a03081dc7e380569e269d.tar.xz |
cpufreq: Avoid calling get_governor() for first policy
When a cpufreq driver registers the first policy, it may attempt to
initialize the policy governor from `last_governor`. However, this is
meaningless for the first policy instance, because `last_governor` is
only updated when policies are removed (e.g. during CPU offline).
The `last_governor` mechanism is intended to restore the previously
used governor across CPU hotplug events. For the very first policy,
there is no "previous governor" to restore, so calling
get_governor(last_governor) is unnecessary and potentially confusing.
Skip looking up `last_governor` when registering the first policy.
Instead, it directly uses the default governor after all governors
have been registered and are available.
This avoids meaningless lookups, reduces unnecessary module reference
handling, and simplifies the initial policy path.
Signed-off-by: Zihuan Zhang <zhangzihuan@kylinos.cn>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Lifeng Zheng <zhenglifeng1@huawei.com>
Link: https://patch.msgid.link/20250725041450.68754-1-zhangzihuan@kylinos.cn
[ rjw: Subject and changelog edits ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/autoload.c')
0 files changed, 0 insertions, 0 deletions