user-guide.txt 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  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. 1.2 x86
  31. -------
  32. The following processors for the x86 architecture are supported by cpufreq:
  33. AMD Elan - SC400, SC410
  34. AMD mobile K6-2+
  35. AMD mobile K6-3+
  36. AMD mobile Duron
  37. AMD mobile Athlon
  38. AMD Opteron
  39. AMD Athlon 64
  40. Cyrix Media GXm
  41. Intel mobile PIII and Intel mobile PIII-M on certain chipsets
  42. Intel Pentium 4, Intel Xeon
  43. Intel Pentium M (Centrino)
  44. National Semiconductors Geode GX
  45. Transmeta Crusoe
  46. Transmeta Efficeon
  47. VIA Cyrix 3 / C3
  48. various processors on some ACPI 2.0-compatible systems [*]
  49. [*] Only if "ACPI Processor Performance States" are available
  50. to the ACPI<->BIOS interface.
  51. 1.3 sparc64
  52. -----------
  53. The following processors for the sparc64 architecture are supported by
  54. cpufreq:
  55. UltraSPARC-III
  56. 1.4 ppc
  57. -------
  58. Several "PowerBook" and "iBook2" notebooks are supported.
  59. 1.5 SuperH
  60. ----------
  61. The following SuperH processors are supported by cpufreq:
  62. SH-3
  63. SH-4
  64. 2. "Policy" / "Governor" ?
  65. ==========================
  66. Some CPU frequency scaling-capable processor switch between various
  67. frequencies and operating voltages "on the fly" without any kernel or
  68. user involvement. This guarantees very fast switching to a frequency
  69. which is high enough to serve the user's needs, but low enough to save
  70. power.
  71. 2.1 Policy
  72. ----------
  73. On these systems, all you can do is select the lower and upper
  74. frequency limit as well as whether you want more aggressive
  75. power-saving or more instantly available processing power.
  76. 2.2 Governor
  77. ------------
  78. On all other cpufreq implementations, these boundaries still need to
  79. be set. Then, a "governor" must be selected. Such a "governor" decides
  80. what speed the processor shall run within the boundaries. One such
  81. "governor" is the "userspace" governor. This one allows the user - or
  82. a yet-to-implement userspace program - to decide what specific speed
  83. the processor shall run at.
  84. 3. How to change the CPU cpufreq policy and/or speed
  85. ====================================================
  86. 3.1 Preferred Interface: sysfs
  87. ------------------------------
  88. The preferred interface is located in the sysfs filesystem. If you
  89. mounted it at /sys, the cpufreq interface is located in a subdirectory
  90. "cpufreq" within the cpu-device directory
  91. (e.g. /sys/devices/system/cpu/cpu0/cpufreq/ for the first CPU).
  92. cpuinfo_min_freq : this file shows the minimum operating
  93. frequency the processor can run at(in kHz)
  94. cpuinfo_max_freq : this file shows the maximum operating
  95. frequency the processor can run at(in kHz)
  96. scaling_driver : this file shows what cpufreq driver is
  97. used to set the frequency on this CPU
  98. scaling_available_governors : this file shows the CPUfreq governors
  99. available in this kernel. You can see the
  100. currently activated governor in
  101. scaling_governor, and by "echoing" the name of another
  102. governor you can change it. Please note
  103. that some governors won't load - they only
  104. work on some specific architectures or
  105. processors.
  106. scaling_min_freq and
  107. scaling_max_freq show the current "policy limits" (in
  108. kHz). By echoing new values into these
  109. files, you can change these limits.
  110. NOTE: when setting a policy you need to
  111. first set scaling_max_freq, then
  112. scaling_min_freq.
  113. If you have selected the "userspace" governor which allows you to
  114. set the CPU operating frequency to a specific value, you can read out
  115. the current frequency in
  116. scaling_setspeed. By "echoing" a new frequency into this
  117. you can change the speed of the CPU,
  118. but only within the limits of
  119. scaling_min_freq and scaling_max_freq.
  120. 3.2 Deprecated Interfaces
  121. -------------------------
  122. Depending on your kernel configuration, you might find the following
  123. cpufreq-related files:
  124. /proc/cpufreq
  125. /proc/sys/cpu/*/speed
  126. /proc/sys/cpu/*/speed-min
  127. /proc/sys/cpu/*/speed-max
  128. These are files for deprecated interfaces to cpufreq, which offer far
  129. less functionality. Because of this, these interfaces aren't described
  130. here.