user-guide.txt 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. CPU frequency and voltage scaling code in the Linux(TM) kernel
  2. L i n u x C P U F r e q
  3. U S E R G U I D E
  4. Dominik Brodowski <linux@brodo.de>
  5. Clock scaling allows you to change the clock speed of the CPUs on the
  6. fly. This is a nice method to save battery power, because the lower
  7. the clock speed, the less power the CPU consumes.
  8. Contents:
  9. ---------
  10. 1. Supported Architectures and Processors
  11. 1.1 ARM
  12. 1.2 x86
  13. 1.3 sparc64
  14. 1.4 ppc
  15. 1.5 SuperH
  16. 1.6 Blackfin
  17. 2. "Policy" / "Governor"?
  18. 2.1 Policy
  19. 2.2 Governor
  20. 3. How to change the CPU cpufreq policy and/or speed
  21. 3.1 Preferred interface: sysfs
  22. 3.2 Deprecated interfaces
  23. 1. Supported Architectures and Processors
  24. =========================================
  25. 1.1 ARM
  26. -------
  27. The following ARM processors are supported by cpufreq:
  28. ARM Integrator
  29. ARM-SA1100
  30. ARM-SA1110
  31. Intel PXA
  32. 1.2 x86
  33. -------
  34. The following processors for the x86 architecture are supported by cpufreq:
  35. AMD Elan - SC400, SC410
  36. AMD mobile K6-2+
  37. AMD mobile K6-3+
  38. AMD mobile Duron
  39. AMD mobile Athlon
  40. AMD Opteron
  41. AMD Athlon 64
  42. Cyrix Media GXm
  43. Intel mobile PIII and Intel mobile PIII-M on certain chipsets
  44. Intel Pentium 4, Intel Xeon
  45. Intel Pentium M (Centrino)
  46. National Semiconductors Geode GX
  47. Transmeta Crusoe
  48. Transmeta Efficeon
  49. VIA Cyrix 3 / C3
  50. various processors on some ACPI 2.0-compatible systems [*]
  51. [*] Only if "ACPI Processor Performance States" are available
  52. to the ACPI<->BIOS interface.
  53. 1.3 sparc64
  54. -----------
  55. The following processors for the sparc64 architecture are supported by
  56. cpufreq:
  57. UltraSPARC-III
  58. 1.4 ppc
  59. -------
  60. Several "PowerBook" and "iBook2" notebooks are supported.
  61. 1.5 SuperH
  62. ----------
  63. All SuperH processors supporting rate rounding through the clock
  64. framework are supported by cpufreq.
  65. 1.6 Blackfin
  66. ------------
  67. The following Blackfin processors are supported by cpufreq:
  68. BF522, BF523, BF524, BF525, BF526, BF527, Rev 0.1 or higher
  69. BF531, BF532, BF533, Rev 0.3 or higher
  70. BF534, BF536, BF537, Rev 0.2 or higher
  71. BF561, Rev 0.3 or higher
  72. BF542, BF544, BF547, BF548, BF549, Rev 0.1 or higher
  73. 2. "Policy" / "Governor" ?
  74. ==========================
  75. Some CPU frequency scaling-capable processor switch between various
  76. frequencies and operating voltages "on the fly" without any kernel or
  77. user involvement. This guarantees very fast switching to a frequency
  78. which is high enough to serve the user's needs, but low enough to save
  79. power.
  80. 2.1 Policy
  81. ----------
  82. On these systems, all you can do is select the lower and upper
  83. frequency limit as well as whether you want more aggressive
  84. power-saving or more instantly available processing power.
  85. 2.2 Governor
  86. ------------
  87. On all other cpufreq implementations, these boundaries still need to
  88. be set. Then, a "governor" must be selected. Such a "governor" decides
  89. what speed the processor shall run within the boundaries. One such
  90. "governor" is the "userspace" governor. This one allows the user - or
  91. a yet-to-implement userspace program - to decide what specific speed
  92. the processor shall run at.
  93. 3. How to change the CPU cpufreq policy and/or speed
  94. ====================================================
  95. 3.1 Preferred Interface: sysfs
  96. ------------------------------
  97. The preferred interface is located in the sysfs filesystem. If you
  98. mounted it at /sys, the cpufreq interface is located in a subdirectory
  99. "cpufreq" within the cpu-device directory
  100. (e.g. /sys/devices/system/cpu/cpu0/cpufreq/ for the first CPU).
  101. cpuinfo_min_freq : this file shows the minimum operating
  102. frequency the processor can run at(in kHz)
  103. cpuinfo_max_freq : this file shows the maximum operating
  104. frequency the processor can run at(in kHz)
  105. cpuinfo_transition_latency The time it takes on this CPU to
  106. switch between two frequencies in nano
  107. seconds. If unknown or known to be
  108. that high that the driver does not
  109. work with the ondemand governor, -1
  110. (CPUFREQ_ETERNAL) will be returned.
  111. Using this information can be useful
  112. to choose an appropriate polling
  113. frequency for a kernel governor or
  114. userspace daemon. Make sure to not
  115. switch the frequency too often
  116. resulting in performance loss.
  117. scaling_driver : this file shows what cpufreq driver is
  118. used to set the frequency on this CPU
  119. scaling_available_governors : this file shows the CPUfreq governors
  120. available in this kernel. You can see the
  121. currently activated governor in
  122. scaling_governor, and by "echoing" the name of another
  123. governor you can change it. Please note
  124. that some governors won't load - they only
  125. work on some specific architectures or
  126. processors.
  127. cpuinfo_cur_freq : Current speed of the CPU, in KHz.
  128. scaling_available_frequencies : List of available frequencies, in KHz.
  129. scaling_min_freq and
  130. scaling_max_freq show the current "policy limits" (in
  131. kHz). By echoing new values into these
  132. files, you can change these limits.
  133. NOTE: when setting a policy you need to
  134. first set scaling_max_freq, then
  135. scaling_min_freq.
  136. affected_cpus : List of CPUs that require software coordination
  137. of frequency.
  138. related_cpus : List of CPUs that need some sort of frequency
  139. coordination, whether software or hardware.
  140. scaling_driver : Hardware driver for cpufreq.
  141. scaling_cur_freq : Current frequency of the CPU, in KHz.
  142. If you have selected the "userspace" governor which allows you to
  143. set the CPU operating frequency to a specific value, you can read out
  144. the current frequency in
  145. scaling_setspeed. By "echoing" a new frequency into this
  146. you can change the speed of the CPU,
  147. but only within the limits of
  148. scaling_min_freq and scaling_max_freq.