boost.txt 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. Processor boosting control
  2. - information for users -
  3. Quick guide for the impatient:
  4. --------------------
  5. /sys/devices/system/cpu/cpufreq/boost
  6. controls the boost setting for the whole system. You can read and write
  7. that file with either "0" (boosting disabled) or "1" (boosting allowed).
  8. Reading or writing 1 does not mean that the system is boosting at this
  9. very moment, but only that the CPU _may_ raise the frequency at it's
  10. discretion.
  11. --------------------
  12. Introduction
  13. -------------
  14. Some CPUs support a functionality to raise the operating frequency of
  15. some cores in a multi-core package if certain conditions apply, mostly
  16. if the whole chip is not fully utilized and below it's intended thermal
  17. budget. The decision about boost disable/enable is made either at hardware
  18. (e.g. x86) or software (e.g ARM).
  19. On Intel CPUs this is called "Turbo Boost", AMD calls it "Turbo-Core",
  20. in technical documentation "Core performance boost". In Linux we use
  21. the term "boost" for convenience.
  22. Rationale for disable switch
  23. ----------------------------
  24. Though the idea is to just give better performance without any user
  25. intervention, sometimes the need arises to disable this functionality.
  26. Most systems offer a switch in the (BIOS) firmware to disable the
  27. functionality at all, but a more fine-grained and dynamic control would
  28. be desirable:
  29. 1. While running benchmarks, reproducible results are important. Since
  30. the boosting functionality depends on the load of the whole package,
  31. single thread performance can vary. By explicitly disabling the boost
  32. functionality at least for the benchmark's run-time the system will run
  33. at a fixed frequency and results are reproducible again.
  34. 2. To examine the impact of the boosting functionality it is helpful
  35. to do tests with and without boosting.
  36. 3. Boosting means overclocking the processor, though under controlled
  37. conditions. By raising the frequency and the voltage the processor
  38. will consume more power than without the boosting, which may be
  39. undesirable for instance for mobile users. Disabling boosting may
  40. save power here, though this depends on the workload.
  41. User controlled switch
  42. ----------------------
  43. To allow the user to toggle the boosting functionality, the cpufreq core
  44. driver exports a sysfs knob to enable or disable it. There is a file:
  45. /sys/devices/system/cpu/cpufreq/boost
  46. which can either read "0" (boosting disabled) or "1" (boosting enabled).
  47. The file is exported only when cpufreq driver supports boosting.
  48. Explicitly changing the permissions and writing to that file anyway will
  49. return EINVAL.
  50. On supported CPUs one can write either a "0" or a "1" into this file.
  51. This will either disable the boost functionality on all cores in the
  52. whole system (0) or will allow the software or hardware to boost at will
  53. (1).
  54. Writing a "1" does not explicitly boost the system, but just allows the
  55. CPU to boost at their discretion. Some implementations take external
  56. factors like the chip's temperature into account, so boosting once does
  57. not necessarily mean that it will occur every time even using the exact
  58. same software setup.
  59. AMD legacy cpb switch
  60. ---------------------
  61. The AMD powernow-k8 driver used to support a very similar switch to
  62. disable or enable the "Core Performance Boost" feature of some AMD CPUs.
  63. This switch was instantiated in each CPU's cpufreq directory
  64. (/sys/devices/system/cpu[0-9]*/cpufreq) and was called "cpb".
  65. Though the per CPU existence hints at a more fine grained control, the
  66. actual implementation only supported a system-global switch semantics,
  67. which was simply reflected into each CPU's file. Writing a 0 or 1 into it
  68. would pull the other CPUs to the same state.
  69. For compatibility reasons this file and its behavior is still supported
  70. on AMD CPUs, though it is now protected by a config switch
  71. (X86_ACPI_CPUFREQ_CPB). On Intel CPUs this file will never be created,
  72. even with the config option set.
  73. This functionality is considered legacy and will be removed in some future
  74. kernel version.
  75. More fine grained boosting control
  76. ----------------------------------
  77. Technically it is possible to switch the boosting functionality at least
  78. on a per package basis, for some CPUs even per core. Currently the driver
  79. does not support it, but this may be implemented in the future.