Viewing CPU frequency scaling data on CentOS Linux hosts


I just built a new quad core AMD Opteron host, and was curious what frequency steppings were available for my processor. After a bit of poking around, I came across the cpufreq-utils package, which contains utilities to view and set processor frequency settings. To view the settings for the processors on a system, cpufreq-info can be run without any options (this assumes you installed the cpufreq-utils package):

$ cpufreq-info

cpufrequtils 005: cpufreq-info (C) Dominik Brodowski 2004-2006
Report errors and bugs to cpufreq@vger.kernel.org, please.
analyzing CPU 0:
driver: powernow-k8
CPUs which need to switch frequency at the same time: 0
hardware limits: 1.10 GHz - 2.20 GHz
available frequency steps: 2.20 GHz, 2.00 GHz, 1.70 GHz, 1.40 GHz, 1.10 GHz
available cpufreq governors: ondemand, userspace, performance
current policy: frequency should be within 1.10 GHz and 2.20 GHz.
The governor "ondemand" may decide which speed to use
within this range.
current CPU frequency is 1.10 GHz (asserted by call to hardware).
analyzing CPU 1:
driver: powernow-k8
CPUs which need to switch frequency at the same time: 1
hardware limits: 1.10 GHz - 2.20 GHz
available frequency steps: 2.20 GHz, 2.00 GHz, 1.70 GHz, 1.40 GHz, 1.10 GHz
available cpufreq governors: ondemand, userspace, performance
current policy: frequency should be within 1.10 GHz and 2.20 GHz.
The governor "ondemand" may decide which speed to use
within this range.
current CPU frequency is 1.10 GHz (asserted by call to hardware).
analyzing CPU 2:
driver: powernow-k8
CPUs which need to switch frequency at the same time: 2
hardware limits: 1.10 GHz - 2.20 GHz
available frequency steps: 2.20 GHz, 2.00 GHz, 1.70 GHz, 1.40 GHz, 1.10 GHz
available cpufreq governors: ondemand, userspace, performance
current policy: frequency should be within 1.10 GHz and 2.20 GHz.
The governor "ondemand" may decide which speed to use
within this range.
current CPU frequency is 1.10 GHz (asserted by call to hardware).
analyzing CPU 3:
driver: powernow-k8
CPUs which need to switch frequency at the same time: 3
hardware limits: 1.10 GHz - 2.20 GHz
available frequency steps: 2.20 GHz, 2.00 GHz, 1.70 GHz, 1.40 GHz, 1.10 GHz
available cpufreq governors: ondemand, userspace, performance
current policy: frequency should be within 1.10 GHz and 2.20 GHz.
The governor "ondemand" may decide which speed to use
within this range.
current CPU frequency is 1.10 GHz (asserted by call to hardware).

The output above contains the list of frequency steppings:

available frequency steps: 2.20 GHz, 2.00 GHz, 1.70 GHz, 1.40 GHz, 1.10 GHz

As well as the current operating frequency of each core:

current CPU frequency is 1.10 GHz (asserted by call to hardware).

If you want to change the frequency profile for a processor, you can use the cpufreq-set utility. I should use this as an opportunity to pick up a kilowatt, and see how much energy is being saved by running the CPUs at 1.1GHZ instead of 2.2GHZ.

This article was posted by Matty on 2009-04-25 11:15:00 -0400 -0400