user-guide.txt 6.1 KB

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