vineri, 29 aprilie 2011

[arch] Configure CPU frequency scaling

You don't usually use your CPU at it's maximum frequency. When you install Arch, being such a malleable distribution, you don't get a CPU frequency scaler by default.

Modern CPU have frequency scaling, which means that you can configure the OS to speed up the CPU only when it needs to. This saves power and your CPU won't produce unnecessary heat.

In this article I will show you how to configure CPU Frequency scaling as a daemon, so that it starts at boot time. Note that you won't have GUI controls like gnome applets. For those please consult the link at the end of the article.

To enable frequency scaling in Arch you need to install cpufreq-utils
pacman -S cpufrequtils
After that you need to load the appropriate driver for you hardware:

  • acpi-cpufreq for Intel CPU's 
  • powernow-k10 for AMD
If these don't work for you (probably older hardware, please consult the Arch wiki for further details).

So as root:
modprobe acpi-cpufreq
Now CPU frequency scaling is enabled in you system.

Next you need to select a scaling governor. Most people go for ondemand and this is the one I will use:
modprobe cpufreq_ondemand

Just loading the kernel module isn't enough. You need to activate it in the cpufreq daemon's configuration. For this edit /etc/conf.d/cpufreq and enable your desired CPU scaling governor.

After this start the cpu scaling daemon with:
/etc/rc.d/cpufreq start

CPU scaling is now configured.

To retain these settings after a reboot edit your
/etc/rc.conf and add your  CPU scaling driver and governor to MODULES so it looks like this:

MODULES=(acpi-cpufreq cpufreq_ondemand fuse [other kernel modules])

and activate the cpufreq daemon:

DAEMONS(dbus networkmanager [other daemons] @cpufreq )

Hope this helped !

CPU Frequency Scaling [Arch Wiki]

Niciun comentariu: