2019-04-25 01:53:03 +08:00
.. SPDX-License-Identifier: GPL-2.0
2018-04-04 12:14:53 -06:00
2019-04-25 01:53:03 +08:00
==================================================
Collaborative Processor Performance Control (CPPC)
==================================================
2021-12-24 09:05:07 +08:00
.. _cppc_sysfs:
2019-04-25 01:53:03 +08:00
CPPC
====
2018-04-04 12:14:53 -06:00
CPPC defined in the ACPI spec describes a mechanism for the OS to manage the
2020-12-04 10:02:35 +03:00
performance of a logical processor on a contiguous and abstract performance
2018-04-04 12:14:53 -06:00
scale. CPPC exposes a set of registers to describe abstract performance scale,
to request performance levels and to measure per-cpu delivered performance.
For more details on CPPC please refer to the ACPI specification at:
http://uefi.org/specifications
2019-04-25 01:53:03 +08:00
Some of the CPPC registers are exposed via sysfs under::
2018-04-04 12:14:53 -06:00
2019-04-25 01:53:03 +08:00
/sys/devices/system/cpu/cpuX/acpi_cppc/
2018-04-04 12:14:53 -06:00
2019-04-25 01:53:03 +08:00
for each cpu X::
2018-04-04 12:14:53 -06:00
2019-04-25 01:53:03 +08:00
$ ls -lR /sys/devices/system/cpu/cpu0/acpi_cppc/
/sys/devices/system/cpu/cpu0/acpi_cppc/:
total 0
-r--r--r-- 1 root root 65536 Mar 5 19:38 feedback_ctrs
-r--r--r-- 1 root root 65536 Mar 5 19:38 highest_perf
-r--r--r-- 1 root root 65536 Mar 5 19:38 lowest_freq
-r--r--r-- 1 root root 65536 Mar 5 19:38 lowest_nonlinear_perf
-r--r--r-- 1 root root 65536 Mar 5 19:38 lowest_perf
-r--r--r-- 1 root root 65536 Mar 5 19:38 nominal_freq
-r--r--r-- 1 root root 65536 Mar 5 19:38 nominal_perf
-r--r--r-- 1 root root 65536 Mar 5 19:38 reference_perf
-r--r--r-- 1 root root 65536 Mar 5 19:38 wraparound_time
2018-04-04 12:14:53 -06:00
* highest_perf : Highest performance of this processor (abstract scale).
2019-04-25 01:53:03 +08:00
* nominal_perf : Highest sustained performance of this processor
(abstract scale).
2018-04-04 12:14:53 -06:00
* lowest_nonlinear_perf : Lowest performance of this processor with nonlinear
power savings (abstract scale).
* lowest_perf : Lowest performance of this processor (abstract scale).
* lowest_freq : CPU frequency corresponding to lowest_perf (in MHz).
* nominal_freq : CPU frequency corresponding to nominal_perf (in MHz).
The above frequencies should only be used to report processor performance in
2020-12-04 10:02:35 +03:00
frequency instead of abstract scale. These values should not be used for any
2018-04-04 12:14:53 -06:00
functional decisions.
* feedback_ctrs : Includes both Reference and delivered performance counter.
Reference counter ticks up proportional to processor's reference performance.
Delivered counter ticks up proportional to processor's delivered performance.
2019-04-25 01:53:03 +08:00
* wraparound_time: Minimum time for the feedback counters to wraparound
(seconds).
2018-04-04 12:14:53 -06:00
* reference_perf : Performance level at which reference performance counter
accumulates (abstract scale).
2019-04-25 01:53:03 +08:00
Computing Average Delivered Performance
=======================================
Below describes the steps to compute the average performance delivered by
taking two different snapshots of feedback counters at time T1 and T2.
T1: Read feedback_ctrs as fbc_t1
Wait or run some workload
2018-04-04 12:14:53 -06:00
2019-04-25 01:53:03 +08:00
T2: Read feedback_ctrs as fbc_t2
2018-04-04 12:14:53 -06:00
2019-04-25 01:53:03 +08:00
::
2018-04-04 12:14:53 -06:00
2019-04-25 01:53:03 +08:00
delivered_counter_delta = fbc_t2[del] - fbc_t1[del]
reference_counter_delta = fbc_t2[ref] - fbc_t1[ref]
2018-04-04 12:14:53 -06:00
2019-04-25 01:53:03 +08:00
delivered_perf = (refernce_perf x delivered_counter_delta) / reference_counter_delta