Posts Tagged management

CPU Frequency Scaling

Posted by on Friday, 22 May, 2009

CPU frequency management is one of the keys to power preservation. Ideal for boxes that sit idle a lot of the time, e.g. that file server out the back.

Results will vary with Desktop/GUI systems, I found the response on Xubuntu too slow to clock up when needed, so I would manually set it to performance when using the system and ondemand if I was going to leave it idle. I guess this could be automated, to switch to ondemand when the system has been idle for a while..

apt-get install cpufrequtils sysfsutils
modprobe p4_clockmod (see links at bottom for other CPU types)
modprobe cpufreq_ondemand
echo ondemand | tee /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

Verify whats happening:

cpufreq-info

Save config/apply at startup:

echo p4_clockmod | tee -a /etc/modules
echo cpufreq_ondemand | tee -a /etc/modules
echo devices/system/cpu/cpu0/cpufreq/scaling_governor = ondemand | tee -a /etc/sysfs.conf

Reboot and run cpufreq-info again to verify:

cpufrequtils 002: cpufreq-info (C) Dominik Brodowski 2004-2006
Report errors and bugs to linux@brodo.de, please.
analyzing CPU 0:
  driver: p4-clockmod
  CPUs which need to switch frequency at the same time: 0 1
  hardware limits: 350 MHz - 2.80 GHz
  available frequency steps: 350 MHz, 700 MHz, 1.05 GHz, 1.40 GHz, 1.75 GHz, 2.10 GHz, 2.45 GHz, 2.80 GHz
  available cpufreq governors: ondemand, userspace, powersave, conservative, performance
  current policy: frequency should be within 350 MHz and 2.80 GHz.
                  The governor "ondemand" may decide which speed to use
                  within this range.
  current CPU frequency is 350 MHz (asserted by call to hardware).
  analyzing CPU 1:
  driver: p4-clockmod
  CPUs which need to switch frequency at the same time: 0 1
  hardware limits: 350 MHz - 2.80 GHz
  available frequency steps: 350 MHz, 700 MHz, 1.05 GHz, 1.40 GHz, 1.75 GHz, 2.10 GHz, 2.45 GHz, 2.80 GHz
  available cpufreq governors: ondemand, userspace, powersave, conservative, performance
  current policy: frequency should be within 350 MHz and 2.80 GHz.
                  The governor "ondemand" may decide which speed to use
                  within this range.
  current CPU frequency is 350 MHz (asserted by call to hardware).

Debian HOW-TO : CPU power management

How to make use of Dynamic Frequency Scaling