Prashanth Prakash | b382bf8 | 2018-04-04 12:14:53 -0600 | [diff] [blame] | 1 | |
| 2 | Collaborative Processor Performance Control (CPPC) |
| 3 | |
| 4 | CPPC defined in the ACPI spec describes a mechanism for the OS to manage the |
| 5 | performance of a logical processor on a contigious and abstract performance |
| 6 | scale. CPPC exposes a set of registers to describe abstract performance scale, |
| 7 | to request performance levels and to measure per-cpu delivered performance. |
| 8 | |
| 9 | For more details on CPPC please refer to the ACPI specification at: |
| 10 | |
| 11 | http://uefi.org/specifications |
| 12 | |
| 13 | Some of the CPPC registers are exposed via sysfs under: |
| 14 | |
| 15 | /sys/devices/system/cpu/cpuX/acpi_cppc/ |
| 16 | |
| 17 | for each cpu X |
| 18 | |
| 19 | -------------------------------------------------------------------------------- |
| 20 | |
| 21 | $ ls -lR /sys/devices/system/cpu/cpu0/acpi_cppc/ |
| 22 | /sys/devices/system/cpu/cpu0/acpi_cppc/: |
| 23 | total 0 |
| 24 | -r--r--r-- 1 root root 65536 Mar 5 19:38 feedback_ctrs |
| 25 | -r--r--r-- 1 root root 65536 Mar 5 19:38 highest_perf |
| 26 | -r--r--r-- 1 root root 65536 Mar 5 19:38 lowest_freq |
| 27 | -r--r--r-- 1 root root 65536 Mar 5 19:38 lowest_nonlinear_perf |
| 28 | -r--r--r-- 1 root root 65536 Mar 5 19:38 lowest_perf |
| 29 | -r--r--r-- 1 root root 65536 Mar 5 19:38 nominal_freq |
| 30 | -r--r--r-- 1 root root 65536 Mar 5 19:38 nominal_perf |
| 31 | -r--r--r-- 1 root root 65536 Mar 5 19:38 reference_perf |
| 32 | -r--r--r-- 1 root root 65536 Mar 5 19:38 wraparound_time |
| 33 | |
| 34 | -------------------------------------------------------------------------------- |
| 35 | |
| 36 | * highest_perf : Highest performance of this processor (abstract scale). |
| 37 | * nominal_perf : Highest sustained performance of this processor (abstract scale). |
| 38 | * lowest_nonlinear_perf : Lowest performance of this processor with nonlinear |
| 39 | power savings (abstract scale). |
| 40 | * lowest_perf : Lowest performance of this processor (abstract scale). |
| 41 | |
| 42 | * lowest_freq : CPU frequency corresponding to lowest_perf (in MHz). |
| 43 | * nominal_freq : CPU frequency corresponding to nominal_perf (in MHz). |
| 44 | The above frequencies should only be used to report processor performance in |
| 45 | freqency instead of abstract scale. These values should not be used for any |
| 46 | functional decisions. |
| 47 | |
| 48 | * feedback_ctrs : Includes both Reference and delivered performance counter. |
| 49 | Reference counter ticks up proportional to processor's reference performance. |
| 50 | Delivered counter ticks up proportional to processor's delivered performance. |
| 51 | * wraparound_time: Minimum time for the feedback counters to wraparound (seconds). |
| 52 | * reference_perf : Performance level at which reference performance counter |
| 53 | accumulates (abstract scale). |
| 54 | |
| 55 | -------------------------------------------------------------------------------- |
| 56 | |
| 57 | Computing Average Delivered Performance |
| 58 | |
| 59 | Below describes the steps to compute the average performance delivered by taking |
| 60 | two different snapshots of feedback counters at time T1 and T2. |
| 61 | |
| 62 | T1: Read feedback_ctrs as fbc_t1 |
| 63 | Wait or run some workload |
| 64 | T2: Read feedback_ctrs as fbc_t2 |
| 65 | |
| 66 | delivered_counter_delta = fbc_t2[del] - fbc_t1[del] |
| 67 | reference_counter_delta = fbc_t2[ref] - fbc_t1[ref] |
| 68 | |
| 69 | delivered_perf = (refernce_perf x delivered_counter_delta) / reference_counter_delta |