intel_thermal_throttle.rst 4.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. .. SPDX-License-Identifier: GPL-2.0
  2. .. include:: <isonum.txt>
  3. =======================================
  4. Intel thermal throttle events reporting
  5. =======================================
  6. :Author: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
  7. Introduction
  8. ------------
  9. Intel processors have built in automatic and adaptive thermal monitoring
  10. mechanisms that force the processor to reduce its power consumption in order
  11. to operate within predetermined temperature limits.
  12. Refer to section "THERMAL MONITORING AND PROTECTION" in the "Intel® 64 and
  13. IA-32 Architectures Software Developer’s Manual Volume 3 (3A, 3B, 3C, & 3D):
  14. System Programming Guide" for more details.
  15. In general, there are two mechanisms to control the core temperature of the
  16. processor. They are called "Thermal Monitor 1 (TM1) and Thermal Monitor 2 (TM2)".
  17. The status of the temperature sensor that triggers the thermal monitor (TM1/TM2)
  18. is indicated through the "thermal status flag" and "thermal status log flag" in
  19. MSR_IA32_THERM_STATUS for core level and MSR_IA32_PACKAGE_THERM_STATUS for
  20. package level.
  21. Thermal Status flag, bit 0 — When set, indicates that the processor core
  22. temperature is currently at the trip temperature of the thermal monitor and that
  23. the processor power consumption is being reduced via either TM1 or TM2, depending
  24. on which is enabled. When clear, the flag indicates that the core temperature is
  25. below the thermal monitor trip temperature. This flag is read only.
  26. Thermal Status Log flag, bit 1 — When set, indicates that the thermal sensor has
  27. tripped since the last power-up or reset or since the last time that software
  28. cleared this flag. This flag is a sticky bit; once set it remains set until
  29. cleared by software or until a power-up or reset of the processor. The default
  30. state is clear.
  31. It is possible that when user reads MSR_IA32_THERM_STATUS or
  32. MSR_IA32_PACKAGE_THERM_STATUS, TM1/TM2 is not active. In this case,
  33. "Thermal Status flag" will read "0" and the "Thermal Status Log flag" will be set
  34. to show any previous "TM1/TM2" activation. But since it needs to be cleared by
  35. the software, it can't show the number of occurrences of "TM1/TM2" activations.
  36. Hence, Linux provides counters of how many times the "Thermal Status flag" was
  37. set. Also presents how long the "Thermal Status flag" was active in milliseconds.
  38. Using these counters, users can check if the performance was limited because of
  39. thermal events. It is recommended to read from sysfs instead of directly reading
  40. MSRs as the "Thermal Status Log flag" is reset by the driver to implement rate
  41. control.
  42. Sysfs Interface
  43. ---------------
  44. Thermal throttling events are presented for each CPU under
  45. "/sys/devices/system/cpu/cpuX/thermal_throttle/", where "X" is the CPU number.
  46. All these counters are read-only. They can't be reset to 0. So, they can potentially
  47. overflow after reaching the maximum 64 bit unsigned integer.
  48. ``core_throttle_count``
  49. Shows the number of times "Thermal Status flag" changed from 0 to 1 for this
  50. CPU since OS boot and thermal vector is initialized. This is a 64 bit counter.
  51. ``package_throttle_count``
  52. Shows the number of times "Thermal Status flag" changed from 0 to 1 for the
  53. package containing this CPU since OS boot and thermal vector is initialized.
  54. Package status is broadcast to all CPUs; all CPUs in the package increment
  55. this count. This is a 64-bit counter.
  56. ``core_throttle_max_time_ms``
  57. Shows the maximum amount of time for which "Thermal Status flag" has been
  58. set to 1 for this CPU at the core level since OS boot and thermal vector
  59. is initialized.
  60. ``package_throttle_max_time_ms``
  61. Shows the maximum amount of time for which "Thermal Status flag" has been
  62. set to 1 for the package containing this CPU since OS boot and thermal
  63. vector is initialized.
  64. ``core_throttle_total_time_ms``
  65. Shows the cumulative time for which "Thermal Status flag" has been
  66. set to 1 for this CPU for core level since OS boot and thermal vector
  67. is initialized.
  68. ``package_throttle_total_time_ms``
  69. Shows the cumulative time for which "Thermal Status flag" has been set
  70. to 1 for the package containing this CPU since OS boot and thermal vector
  71. is initialized.