Commit 3d44e8c0 authored by Ionela Voinescu's avatar Ionela Voinescu Committed by Jie Liu
Browse files

arch_topology: obtain cpu capacity using information from CPPC

mainline inclusion
from mainline-v5.17-rc8
commit 9924fbb5
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I7C2TX
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=9924fbb51e0ae30b8d7eec7c1c839d74da9678b3



----------------------------------------------------------------------

Define topology_init_cpu_capacity_cppc() to use highest performance
values from _CPC objects to obtain and set maximum capacity information
for each CPU. acpi_cppc_processor_probe() is a good point at which to
trigger the initialization of CPU (u-arch) capacity values, as at this
point the highest performance values can be obtained from each CPU's
_CPC objects. Architectures can therefore use this functionality
through arch_init_invariance_cppc().

The performance scale used by CPPC is a unified scale for all CPUs in
the system. Therefore, by obtaining the raw highest performance values
from the _CPC objects, and normalizing them on the [0, 1024] capacity
scale, used by the task scheduler, we obtain the CPU capacity of each
CPU.

While an ACPI Notify(0x85) could alert about a change in the highest
performance value, which should in turn retrigger the CPU capacity
computations, this notification is not currently handled by the ACPI
processor driver. When supported, a call to arch_init_invariance_cppc()
would perform the update.

Signed-off-by: default avatarIonela Voinescu <ionela.voinescu@arm.com>
Acked-by: default avatarSudeep Holla <sudeep.holla@arm.com>
Tested-by: default avatarValentin Schneider <valentin.schneider@arm.com>
Tested-by: default avatarYicong Yang <yangyicong@hisilicon.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: default avatarJie Liu <liujie375@h-partners.com>
parent f1ef70c5
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment