代码: 全选
sudo apt-get install cpufrequtils cpufreqd
代码: 全选
cpufreq-info
cpufrequtils 007: cpufreq-info (C) Dominik Brodowski 2004-2009
Report errors and bugs to [email protected], please.
analyzing CPU 0:
driver: acpi-cpufreq
CPUs which run at the same hardware frequency: 0 1
CPUs which need to have their frequency coordinated by software: 0
maximum transition latency: 10.0 us.
hardware limits: 1.20 GHz - 2.30 GHz
available frequency steps: 2.30 GHz, 1.60 GHz, 1.20 GHz
available cpufreq governors: conservative, ondemand, userspace, powersave, performance
current policy: frequency should be within 1.20 GHz and 2.30 GHz.
The governor "ondemand" may decide which speed to use
within this range.
current CPU frequency is 1.20 GHz.
cpufreq stats: 2.30 GHz:4.94%, 1.60 GHz:0.36%, 1.20 GHz:94.70% (2117)
注意我用粗体标注的部分,cpu所支持的模式的解释如下:
代码: 全选
powersave,是无论如何都只会保持最低频率的所谓“省电”模式;
userspace,是自定义频率时的模式,这个是当你设定特定频率时自动转变的;
ondemand,默认模式。一有cpu计算量的任务,就会立即达到最大频率运行,等执行完毕就立即回到最低频率;
conservative,翻译成保守(中庸)模式,会自动在频率上下限调整,和ondemand的区别在于它会按需分配频率,而不是一味追求最高频率;
performance,顾名思义只注重效率,无论如何一直保持以最大频率运行。
3.编辑cpufreqd配置文件
代码: 全选
sudo gedit /etc/cpufreqd.conf
代码: 全选
[Profile]
name=Ondemand
minfreq=1200000
maxfreq=2300000
policy=ondemand
[/Profile]
代码: 全选
[Rule]
name=AC Rule
ac=on # (on/off)
profile=Performance High
[/Rule]
关于profile部分现解释如下:因为我的cpu可在1.2GHz,1.6GHz,2.3GHz工作(通过cpufreq-info可以看到),所以我将minfreq设为1200000,单位是KHz(配置文件要求这样),将maxfreq设为了2300000。原文件中cpu频率是用百分比定义的,我觉得还是按cpu本身的频率工作比较好。
4.由于本人水平有限不知如何重启cpufreqd服务,就重启电脑了,知道的请给我拍砖。因此和我一样的请重启电脑吧,重启后用cpufreq-info命令看看cpu工作方式改过来没有。