linux cpufreq 用法解析

ubuntu 安装

sudo apt-get install cpufrequtils

运行命令

cpufreq-info

显示:

cpufrequtils 008: cpufreq-info (C) Dominik Brodowski 2004-2009
Report errors and bugs to [email protected], please.
analyzing CPU 0:
driver: omap
CPUs which run at the same hardware frequency: 0
CPUs which need to have their frequency coordinated by software: 0
maximum transition latency: 300 us.
hardware limits: 300 MHz - 1000 MHz
available frequency steps: 300 MHz, 600 MHz, 720 MHz, 800 MHz, 1000 MHz
available cpufreq governors: conservative, ondemand, powersave, userspace, pee
current policy: frequency should be within 300 MHz and 1000 MHz.
The governor "ondemand" may decide which speed to use
within this range.
current CPU frequency is 300 MHz.
cpufreq stats: 300 MHz:nan%, 600 MHz:nan%, 720 MHz:nan%, 800 MHz:nan%, 1000 M%


suod cpufreq-set -g 《模式》
powersave,是无论如何都只会保持最低频率的所谓“省电”模式;
userspace,是自定义频率时的模式,这个是当你设定特定频率时自动转变的;
ondemand,默认模式。一有cpu计算量的任务,就会立即达到最大频率运行,等执行完 毕就立即回到最低频率;
conservative,翻译成保守(中庸)模 式,会自动在频率上下限调整,和ondemand的区别在于它会按需分配频率,而不是一味追求最高频率;
performance,顾名思义只注重效率,无论如何一直保持以最大频率运行。

假如你选择的是自定义模式的话可以通过
sudo cpufreq-set -f 你所需要的频率
注意,此处的频率必须是以KHz为单 位,并且是可以达到的频率(也就是用cpufreq-info查看到的各个频率),cpu频率=倍频x外频。以下凡是涉及频率的一律如此。


而在自动调节下,也可以设置其上限和下限

sudo cpufreq-set -d 频率下限
sudo cpufreq-set -u 频率上限




你可能感兴趣的:(linux)