Chinaunix首页 | 论坛 | 博客
  • 博客访问: 712518
  • 博文数量: 96
  • 博客积分: 2110
  • 博客等级: 大尉
  • 技术积分: 1018
  • 用 户 组: 普通用户
  • 注册时间: 2010-03-23 19:36
文章分类

全部博文(96)

文章存档

2013年(2)

2012年(17)

2011年(77)

分类: LINUX

2011-11-04 22:18:11

 
還可以參考:
 
 

I thought I would write a little howto on how to get cpu frequency scaling to work directly with the kernel modules. These modules are generally more efficient for performance computing and battery life.

Prerequisites
kernel >= 2.6.9

Step 1: Enable BIOS Support
Enter your BIOS at boot and make sure Cool'n'Quiet (AMD) or SpeedStep (Intel) is enable for you CPU. Some BIOS may not have option at all. If that is the case it is probably enabled by default. Other BIOS may have the option but it is listed as another name altogether. If that is the case check your BIOS manual for more info.

Step 2: Remove Userspace Scaling Software
powernowd

Code:
sudo apt-get remove powernowd

cpudyn

Code:
sudo apt-get remove cpudyn

Step 3: Install CPU Module
Identify your cpu type by runnig the command

Code:
cat /proc/cpuinfo

You can also Check the following links
AMD CPU Chart -
Intel CPU Chart -

AMD Sempron/Athlon/MP ( K7 )
Socket Types: A, Slot A

Code:
sudo modprobe powernow-k7

AMD Duron/Sempron/Athlon/Opteron 64 ( K8 )
Socket Types: 754, 939, 940, S1 ( 638 ), AM2 ( 940 ), F ( 1207 )

Code:
sudo modprobe powernow-k8

Intel Core Duo

Code:
sudo modprobe speedstep-centrino

Intel Pentium M

Code:
sudo modprobe speedstep-centrino

Others (Unknown)
I'm not entirely sure which cpus are supported using this module. If your cpu doesn't work with one of the above methods try this one.

Code:
sudo modprobe acpi-cpufreq

Step 4: Scaling Modules

Code:
sudo modprobe cpufreq_conservative sudo modprobe cpufreq_ondemand sudo modprobe cpufreq_powersave sudo modprobe cpufreq_stats sudo modprobe cpufreq_userspace

Step 5: Testing/Configuration
Show Available Governors

Code:
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors

You should see output similar to

Code:
powersave conservative ondemand performance

conservative
Description: CPU frequency is scaled based on load in incremental steps up and down.

Code:
sudo -s echo conservative > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

Advanced Configuration Options

Code:
cd /sys/devices/system/cpu/cpu0/cpufreq/conservative

ondemand
Description: CPU frequency is scaled based on load.

Code:
sudo -s echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

Advanced Configuration Options

Code:
cd /sys/devices/system/cpu/cpu0/cpufreq/ondemand

performance
Description: CPU only runs at max frequency regardless of load.
Configuration Dir: N/A

Code:
sudo -s echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

powersave
Description: CPU only runs at min frequency regardless of load.
Configuration Dir: N/A

Code:
sudo -s echo powersave > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

Step 6: Load Modules at Boot
Add the following lines to the end of /etc/modules

Code:
cpufreq_conservative cpufreq_ondemand cpufreq_powersave cpufreq_stats cpufreq_userspace [Module from Step 3]

Step 7: Configure Modules at Boot
This step needs to be done in order for the modules to retain your settings.
Make sure you have sysfsutils installed

Code:
sudo apt-get install sysfsutils

Then add the following lines to /etc/sysfs.conf

Code:
devices/system/cpu/cpu0/cpufreq/scaling_governor=ondemand

Where ondemand can be changed to another governor type (i.e. conservative, powersave, etc.). You can also add other configuration options that are specific to the governor selected.

Useful Links



阅读(2215) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~