xref: /linux/Documentation/admin-guide/acpi/cppc_sysfs.rst (revision cdd38c5f1ce4398ec58fec95904b75824daab7b5)
13e57460fSChangbin Du.. SPDX-License-Identifier: GPL-2.0
23e57460fSChangbin Du
33e57460fSChangbin Du==================================================
43e57460fSChangbin DuCollaborative Processor Performance Control (CPPC)
53e57460fSChangbin Du==================================================
63e57460fSChangbin Du
73e57460fSChangbin DuCPPC
83e57460fSChangbin Du====
93e57460fSChangbin Du
103e57460fSChangbin DuCPPC defined in the ACPI spec describes a mechanism for the OS to manage the
11*b2105aa2SAndrew Klychkovperformance of a logical processor on a contiguous and abstract performance
123e57460fSChangbin Duscale. CPPC exposes a set of registers to describe abstract performance scale,
133e57460fSChangbin Duto request performance levels and to measure per-cpu delivered performance.
143e57460fSChangbin Du
153e57460fSChangbin DuFor more details on CPPC please refer to the ACPI specification at:
163e57460fSChangbin Du
173e57460fSChangbin Duhttp://uefi.org/specifications
183e57460fSChangbin Du
193e57460fSChangbin DuSome of the CPPC registers are exposed via sysfs under::
203e57460fSChangbin Du
213e57460fSChangbin Du  /sys/devices/system/cpu/cpuX/acpi_cppc/
223e57460fSChangbin Du
233e57460fSChangbin Dufor each cpu X::
243e57460fSChangbin Du
253e57460fSChangbin Du  $ ls -lR  /sys/devices/system/cpu/cpu0/acpi_cppc/
263e57460fSChangbin Du  /sys/devices/system/cpu/cpu0/acpi_cppc/:
273e57460fSChangbin Du  total 0
283e57460fSChangbin Du  -r--r--r-- 1 root root 65536 Mar  5 19:38 feedback_ctrs
293e57460fSChangbin Du  -r--r--r-- 1 root root 65536 Mar  5 19:38 highest_perf
303e57460fSChangbin Du  -r--r--r-- 1 root root 65536 Mar  5 19:38 lowest_freq
313e57460fSChangbin Du  -r--r--r-- 1 root root 65536 Mar  5 19:38 lowest_nonlinear_perf
323e57460fSChangbin Du  -r--r--r-- 1 root root 65536 Mar  5 19:38 lowest_perf
333e57460fSChangbin Du  -r--r--r-- 1 root root 65536 Mar  5 19:38 nominal_freq
343e57460fSChangbin Du  -r--r--r-- 1 root root 65536 Mar  5 19:38 nominal_perf
353e57460fSChangbin Du  -r--r--r-- 1 root root 65536 Mar  5 19:38 reference_perf
363e57460fSChangbin Du  -r--r--r-- 1 root root 65536 Mar  5 19:38 wraparound_time
373e57460fSChangbin Du
383e57460fSChangbin Du* highest_perf : Highest performance of this processor (abstract scale).
393e57460fSChangbin Du* nominal_perf : Highest sustained performance of this processor
403e57460fSChangbin Du  (abstract scale).
413e57460fSChangbin Du* lowest_nonlinear_perf : Lowest performance of this processor with nonlinear
423e57460fSChangbin Du  power savings (abstract scale).
433e57460fSChangbin Du* lowest_perf : Lowest performance of this processor (abstract scale).
443e57460fSChangbin Du
453e57460fSChangbin Du* lowest_freq : CPU frequency corresponding to lowest_perf (in MHz).
463e57460fSChangbin Du* nominal_freq : CPU frequency corresponding to nominal_perf (in MHz).
473e57460fSChangbin Du  The above frequencies should only be used to report processor performance in
48*b2105aa2SAndrew Klychkov  frequency instead of abstract scale. These values should not be used for any
493e57460fSChangbin Du  functional decisions.
503e57460fSChangbin Du
513e57460fSChangbin Du* feedback_ctrs : Includes both Reference and delivered performance counter.
523e57460fSChangbin Du  Reference counter ticks up proportional to processor's reference performance.
533e57460fSChangbin Du  Delivered counter ticks up proportional to processor's delivered performance.
543e57460fSChangbin Du* wraparound_time: Minimum time for the feedback counters to wraparound
553e57460fSChangbin Du  (seconds).
563e57460fSChangbin Du* reference_perf : Performance level at which reference performance counter
573e57460fSChangbin Du  accumulates (abstract scale).
583e57460fSChangbin Du
593e57460fSChangbin Du
603e57460fSChangbin DuComputing Average Delivered Performance
613e57460fSChangbin Du=======================================
623e57460fSChangbin Du
633e57460fSChangbin DuBelow describes the steps to compute the average performance delivered by
643e57460fSChangbin Dutaking two different snapshots of feedback counters at time T1 and T2.
653e57460fSChangbin Du
663e57460fSChangbin Du  T1: Read feedback_ctrs as fbc_t1
673e57460fSChangbin Du      Wait or run some workload
683e57460fSChangbin Du
693e57460fSChangbin Du  T2: Read feedback_ctrs as fbc_t2
703e57460fSChangbin Du
713e57460fSChangbin Du::
723e57460fSChangbin Du
733e57460fSChangbin Du  delivered_counter_delta = fbc_t2[del] - fbc_t1[del]
743e57460fSChangbin Du  reference_counter_delta = fbc_t2[ref] - fbc_t1[ref]
753e57460fSChangbin Du
763e57460fSChangbin Du  delivered_perf = (refernce_perf x delivered_counter_delta) / reference_counter_delta
77