cppc_sysfs.rst 2.9 KB

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