This guide should work with Ubuntu Feisty or Gutsy 32 bit. Most of the guides that I have read on this subject way over complicate things and don't give information on how to change the scaling governor. So as requested by several other forum members here is a howto.
About CPU Frequency Scaling
You may have noticed the CPU Frequency Scaling Monitor that you can add to your Gnome panel. It gives you information about the speed of your processor if your processor has scaling abilities. Most notebook processors have this ability. To see which speeds your processor can run at, you can run this command:
The Pentium M in my laptop gives the following output:Code:cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies
The numbers are in Hz, so my CPU will scale between 800MHz and 2.13GHz.Code:2133000 1867000 1600000 1333000 1067000 800000
If you add the CPU Frequency Scaling Monitor applet to your panel, it will inform you of what speed your CPU is currently running at. But there is more that this applet can do.
The cpufreqd process is what controls the cpu scaling. There are several different methods (known as governors) that dictate the way scaling will work. You can find what governors are available by running this command:
You will see something like this:Code:cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors
Ubuntu uses ondemand as the default governor. This means that the CPU will idle at the lowest setting, then when usage increases, it will jump to the highest setting until usage decreases.Code:userspace ondemand powersave conservative performance
Conservative is similar to ondemand, except that instead of jumping to the highest setting when usage increases, it will go to the next highest setting and move up through the settings as necessary. For example, when using the conservative governor, my CPU will idle at 800MHz. If usage goes above 80% it will move up to 1.067GHz. If usage is still above 80% it will move up to 1.333GHz, and so on. This method will use less power then ondemand, but you may take a performance hit.
Powersave will keep your cpu constant at the lowest available setting, and performance will keep the CPU at the highest available setting. Userspace means that another program will control the CPU scaling.
Ubuntu uses ondemand by default and that will be fine for most people, but I found that my laptop runs much cooler and gets better battery life by using conservative.
Using the CPU Frequency Scaling Monitor to control scaling
As I said above the CPU Frequency Scaling Monitor can do more than just display which frequency the CPU is running at. It can control which governor the cpufreqd process will use. This feature is disabled by default in ubuntu, but you can enable it with this command:
Then selecting 'yes' to 'Install cpufreq-selector with SUID root.'Code:sudo dpkg-reconfigure gnome-applets
Now if you click on the CPU Frequency Scaling Monitor on your applet you can change which governor to use, or even set the CPU to a constant speed.
Setting new default governors
Now when you change settings using panel applet they will not 'stick'. They will change back to the default ondemand value when you reboot, switch to battery power, or switch to AC power.
To change these default values you need to open up the gconf-editor. To do that press Alt+F2 and type
gconf-editor into the run dialog. Now navigate to apps>gnome-power-manger>cpufreq. Here you can change the value of policy_ac and policy_battery to whichever governor you wish to be default for AC power and battery.
Now you should be set. When you remove the AC power and switch to battery it will automatically change to whichever governor you have set as the value of policy_battery. Likewise when you switch back to AC power.
Please let me know of any improvements or mistakes in this guide, or post any problems you might have. Some information was taken from this site: