user-guide.txt 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  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. 2. "Policy" / "Governor"?
  17. 2.1 Policy
  18. 2.2 Governor
  19. 3. How to change the CPU cpufreq policy and/or speed
  20. 3.1 Preferred interface: sysfs
  21. 3.2 Deprecated interfaces
  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. The following SuperH processors are supported by cpufreq:
  63. SH-3
  64. SH-4
  65. 2. "Policy" / "Governor" ?
  66. ==========================
  67. Some CPU frequency scaling-capable processor switch between various
  68. frequencies and operating voltages "on the fly" without any kernel or
  69. user involvement. This guarantees very fast switching to a frequency
  70. which is high enough to serve the user's needs, but low enough to save
  71. power.
  72. 2.1 Policy
  73. ----------
  74. On these systems, all you can do is select the lower and upper
  75. frequency limit as well as whether you want more aggressive
  76. power-saving or more instantly available processing power.
  77. 2.2 Governor
  78. ------------
  79. On all other cpufreq implementations, these boundaries still need to
  80. be set. Then, a "governor" must be selected. Such a "governor" decides
  81. what speed the processor shall run within the boundaries. One such
  82. "governor" is the "userspace" governor. This one allows the user - or
  83. a yet-to-implement userspace program - to decide what specific speed
  84. the processor shall run at.
  85. 3. How to change the CPU cpufreq policy and/or speed
  86. ====================================================
  87. 3.1 Preferred Interface: sysfs
  88. ------------------------------
  89. The preferred interface is located in the sysfs filesystem. If you
  90. mounted it at /sys, the cpufreq interface is located in a subdirectory
  91. "cpufreq" within the cpu-device directory
  92. (e.g. /sys/devices/system/cpu/cpu0/cpufreq/ for the first CPU).
  93. cpuinfo_min_freq : this file shows the minimum operating
  94. frequency the processor can run at(in kHz)
  95. cpuinfo_max_freq : this file shows the maximum operating
  96. frequency the processor can run at(in kHz)
  97. scaling_driver : this file shows what cpufreq driver is
  98. used to set the frequency on this CPU
  99. scaling_available_governors : this file shows the CPUfreq governors
  100. available in this kernel. You can see the
  101. currently activated governor in
  102. scaling_governor, and by "echoing" the name of another
  103. governor you can change it. Please note
  104. that some governors won't load - they only
  105. work on some specific architectures or
  106. processors.
  107. cpuinfo_cur_freq : Current speed of the CPU, in KHz.
  108. scaling_available_frequencies : List of available frequencies, in KHz.
  109. scaling_min_freq and
  110. scaling_max_freq show the current "policy limits" (in
  111. kHz). By echoing new values into these
  112. files, you can change these limits.
  113. NOTE: when setting a policy you need to
  114. first set scaling_max_freq, then
  115. scaling_min_freq.
  116. affected_cpus : List of CPUs that require software coordination
  117. of frequency.
  118. related_cpus : List of CPUs that need some sort of frequency
  119. coordination, whether software or hardware.
  120. scaling_driver : Hardware driver for cpufreq.
  121. scaling_cur_freq : Current frequency of the CPU, in KHz.
  122. If you have selected the "userspace" governor which allows you to
  123. set the CPU operating frequency to a specific value, you can read out
  124. the current frequency in
  125. scaling_setspeed. By "echoing" a new frequency into this
  126. you can change the speed of the CPU,
  127. but only within the limits of
  128. scaling_min_freq and scaling_max_freq.
  129. 3.2 Deprecated Interfaces
  130. -------------------------
  131. Depending on your kernel configuration, you might find the following
  132. cpufreq-related files:
  133. /proc/cpufreq
  134. /proc/sys/cpu/*/speed
  135. /proc/sys/cpu/*/speed-min
  136. /proc/sys/cpu/*/speed-max
  137. These are files for deprecated interfaces to cpufreq, which offer far
  138. less functionality. Because of this, these interfaces aren't described
  139. here.