cpufreq: schedutil: Move max CPU capacity to sugov_policy
authorLukasz Luba <lukasz.luba@arm.com>
Tue, 16 Aug 2022 13:06:29 +0000 (14:06 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 23 Aug 2022 18:03:33 +0000 (20:03 +0200)
commit6d5afdc97ea71958287364a1f1d07e59ef151b11
treeb6933f7745af4bbd96557c1b3c1a4aa2f0cd242d
parent1c23f9e627a7b412978b4e852793c5e3c3efc555
cpufreq: schedutil: Move max CPU capacity to sugov_policy

There is no need to keep the max CPU capacity in the per_cpu instance.
Furthermore, there is no need to check and update that variable
(sg_cpu->max) every time in the frequency change request, which is part
of hot path. Instead use struct sugov_policy to store that information.
Initialize the max CPU capacity during the setup and start callback.
We can do that since all CPUs in the same frequency domain have the same
max capacity (capacity setup and thermal pressure are based on that).

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Lukasz Luba <lukasz.luba@arm.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
kernel/sched/cpufreq_schedutil.c