summaryrefslogtreecommitdiffstats
path: root/include/linux/arch_topology.h
diff options
context:
space:
mode:
authorIonela Voinescu <ionela.voinescu@arm.com>2022-03-10 14:54:50 +0000
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2022-03-10 20:21:58 +0100
commit9924fbb51e0ae30b8d7eec7c1c839d74da9678b3 (patch)
treeb9eba95a9ca8cc9f5b3735c479b217db0aa9c6bd /include/linux/arch_topology.h
parent1132e6de11cfc334b44f609792664f1bc3055c52 (diff)
downloadlinux-9924fbb51e0ae30b8d7eec7c1c839d74da9678b3.tar.bz2
arch_topology: obtain cpu capacity using information from CPPC
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: Ionela Voinescu <ionela.voinescu@arm.com> Acked-by: Sudeep Holla <sudeep.holla@arm.com> Tested-by: Valentin Schneider <valentin.schneider@arm.com> Tested-by: Yicong Yang <yangyicong@hisilicon.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'include/linux/arch_topology.h')
-rw-r--r--include/linux/arch_topology.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/arch_topology.h b/include/linux/arch_topology.h
index cce6136b300a..58cbe18d825c 100644
--- a/include/linux/arch_topology.h
+++ b/include/linux/arch_topology.h
@@ -11,6 +11,10 @@
void topology_normalize_cpu_scale(void);
int topology_update_cpu_topology(void);
+#ifdef CONFIG_ACPI_CPPC_LIB
+void topology_init_cpu_capacity_cppc(void);
+#endif
+
struct device_node;
bool topology_parse_cpu_capacity(struct device_node *cpu_node, int cpu);