slitaz-doc-wiki-data view pages/en/guides/cpu-frequency.txt @ rev 7

Add pages/en folder.
author Christopher Rogers <slaxemulator@gmail.com>
date Sat Feb 26 12:17:18 2011 +0000 (2011-02-26)
parents
children
line source
1 ======= CPU Frequency Scaling =======
3 ==== Introduction ====
5 To reduce power consumption is not only essential for portable computers: it is also essential to use it on desktop machines to reduce unnecessary CO2 emissions. You can save power by turning off not needed hardware components like WiFi, Bluetooth, etc., switching off or reducing the monitor backlight, spinning down HDDs and controlling the CPU frequency.
7 CPU frequency scaling is built into the 2.6 kernel and available; but because Slitaz is very small and light, you have to install some additional tools and set it up by yourself.
9 ==== Installation ====
11 Install linux-cpufreq, linux-acpi, cpufrequtils and optional powertop (for easy controlling) - cpufrequtils and powertop we have to take from cooking, because cpufrequtils does not exist in 3.0 and powertop is buggy.
13 <code># tazpkg get-install linux-cpufreq
14 # tazpkg get-install linux-acpi,
15 # wget http://mirror.slitaz.org/packages/cooking/cpufrequtils-008.tazpkg
16 # wget http://mirror.slitaz.org/packages/cooking/powertop-1.13.tazpkg
17 # tazpkg install cpufrequtils-008.tazpkg
18 # tazpkg install powertop-1.13.tazpkg
19 </code>
21 ==== Cpu driver ====
23 You have to load the correct CPU kernel driver for your CPU - if you don't know, which CPU is in your PC you can get it from:
25 <file> $ cat /proc/cpuinfo</file>
27 Depending on the CPU, load one of the following modules - if you choose the wrong driver, you will get an error message, the module is not loaded and nothing goes wrong.
29 Generic ACPI P-States based driver:
30 <code> # modprobe acpi-cpufreq</code>
31 AMD mobile K6-2/3+ PowerNow!:
32 <code> # modprobe powernow-k6</code>
33 AMD mobile Athlon PowerNow!:
34 <code> # powernow-k7</code>
35 AMD Cool&Quiet PowerNow!(up to AMD "K10" CPU):
36 <code> # modprobe powernow-k8</code>
37 Intel SpeedStep using the SMI BIOS interface:
38 <code> # modprobe speedstep-smi</code>
39 Intel SpeedStep on ICH-based chipsets:
40 <code> # speedstep-ich</code>
41 Intel Enhanced SpeedStep (deprecated - use acpi-cpufreq):
42 <code> # modprobe speedstep-centrino</code>
43 Intel Pentium4/Xeon - The kernel documentation says "This adds the CPUFreq driver for Intel Pentium 4 / XEON processors. When enabled it will lower CPU temperature by skipping clocks. This driver should be only used in exceptional circumstances when very low power is needed because it causes severe slowdowns and noticeable latencies. Normally Speedstep should be used instead." - the p4-clockmod supports only performance and powersave governors (due to the long transition latency of the module itself):
44 <code> # modprobe p4-clockmod</code>
45 NatSemi Geode GX / Cyrix MediaGXm:
46 <code> # modprobe gx-suspmod</code>
47 Transmeta Crusoe / Efficeon LongRun:
48 <code> # modprobe longrun</code>
49 VIA Cyrix Longhaul:
50 <code> # /sbin/modprobe longhaul</code>
51 nForce2 FSB changing cpufreq driver:
52 <code> # modprobe cpufreq-nforce2</code>
53 Enhanced PowerSaver driver for VIA C7 CPUs:
54 <code> # modprobe e_powersaver</code>
56 ==== Scaling governors ====
58 Governors can be thought of as pre-configured power schemes for the CPU.
60 Available governors:
62 **cpufreq_performance (default in SliTaz)** \\
63 The performance governor is built into the kernel and runs the CPU(s) at maximum clock speed
65 **cpufreq_ondemand (also built into the kernel)** \\
66 Dynamically increases/decreases the CPU(s) clock speed based on system load
68 **cpufreq_conservative** \\
69 Similar to ondemand, but more conservative (clock speed changes are more graceful)
71 **cpufreq_powersave** \\
72 Runs the CPU at minimum speed
74 **cpufreq_userspace** \\
75 Manually configured clock speeds by user
77 The built in governors must not be loaded - the others must be loaded with modprobe - you may load as many governors as desired (only one will be active at any given time).
79 Which poses the question, which governor saves most energy? The Powersave governor will only save you power if you're playing 3D games (it does not save power because application process completion times are prolonged at the lower processor frequency and the system does not enter a deep C-state. The greatest power savings occur at idle in deeper C-states) and the performance governor will basically never give you extra performance. Don't use them - therefore I am not happy that the performance governor is used by default in SliTaz. So you might choose between ondemand and conservative, which is a matter of taste.
81 The userspace governor is necessary for third party applications - like cpupowerd http://www.themaxer.com/index.php?option=com_content&view=article&id=86:undervolting-your-cpu&catid=41:nas&Itemid=81 - unfortunately it does not work in SliTaz, because the kernel config for CONFIG_X86_MSR is not set.
83 ==== Select the governor ====
85 At this point everything is prepared but no active governor selected - so no power saving yet.
87 Use the 'cpufreq-set' command to activate one of the governors - for example:
89 <code> # cpufreq-set -g ondemand</code>
91 Please note, if you have a dual-core or multiple-core CPU, you must explicitly specify the CPU. There are CPUs where each core can run with different settings! Example for a dual-core CPU:
93 <code> # cpufreq-set -c 0 -c 1 -g conservative</code>