時悠帖・五差路

まだ若いつもりでいたがついに老いを隠せなくなった爺の 時悠生活雑記

cpufrequtils で CPU 周波数制御

cpufrequtils がインストールされているのを確認後、

$ cpufreq-info

cpufrequtils 002: cpufreq-info (C) Dominik Brodowski 2004-2006

Report errors and bugs to linux@brodo.de, please.

analyzing CPU 0:

no or unknown cpufreq driver is active on this CPU

そこで、

# modprobe speedstep-centrino

(/etc/modules に追加しておく)

設定できる MAX_SPEED, MIN_SPEED を確認後、cpufrequtils の設定を変更。

$ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies

1600000 1400000 1200000 1000000 800000 600000

# vi /etc/default/cpufrequtils

ENABLE="false"  ……> true

GOVERNOR="ondemand"  ……> conservative

MAX_SPEED=0  ……> 1600000

MIN_SPEED=0  ……> 600000

cpufrequtils を再起動後、再確認。

# /etc/init.d/cpufrequtils restart

CPUFreq Utilities: Setting conservative CPUFreq governor... CPU0 done.

$ cpufreq-info

cpufrequtils 002: cpufreq-info (C) Dominik Brodowski 2004-2006

Report errors and bugs to linux@brodo.de, please.

analyzing CPU 0:

driver: centrino

CPUs which need to switch frequency at the same time: 0

hardware limits: 600 MHz - 1.60 GHz

available frequency steps: 1.60 GHz, 1.40 GHz, 1.20 GHz, 1000 MHz, 800 MHz, 600 MHz

available cpufreq governors: conservative, performance

current policy: frequency should be within 600 MHz and 1.60 GHz.

The governor "conservative" may decide which speed to use

within this range.

current CPU frequency is 600 MHz.

これで、負荷に応じて CPU の速度が 600MHz〜1.6GHz で変化するようになった。

なお、governor には以下のものがある。

・ondemand:Dynamic cpufreq policy governor, changes frequency based on the processor load.

・conservative:Similar to ondemand, but increases frequency step by step if you need more power.

・powersave:Sets to the lowest frequency.

userspace:Allows you to set the frequency manually by editing /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed.

・performance:Sets to the highest frequency.