- lsmod | grep "acpi_cpufreq"
执行上面的命令检查是否加载acpi_cpufreq模块,若是没有加载则可以使用yum去安装此模块
查看当前CPU工作频率和状态:
- yum install -y cpufreq-utils.x86_64
modprobe acpi_cpufreq #经过试验此模块不支持intel xeon处理器,只有只有P4-clockmod这个模块支持xeon处理器,但是前提要自己动手编译内核。。。
- 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: acpi-cpufreq
CPUs which need to switch frequency at the same time: 0
hardware limits: 1.60 GHz - 2.60 GHz
available frequency steps: 2.60 GHz, 2.50 GHz, 2.40 GHz, 2.30 GHz, 2.20 GHz, 2.10 GHz, 2.00 GHz, 1.90 GHz, 1.80 GHz, 1.70 GHz, 1.60 GHz
available cpufreq governors: ondemand, userspace, performance
current policy: frequency should be within 1.60 GHz and 2.60 GHz.
The governor "ondemand" may decide which speed to use
within this range.
current CPU frequency is 1.60 GHz (asserted by call to hardware).
The governor "ondemand" 表示CPU频率的策略。CPU有三种策略,onemand(表示系统可以通过动态调整频率,降低功耗,具体的调整策略和内核的功耗管理算法有关),userspace(表示用户可以自己设定cpu的频率),performance(表示CPU总是在最高主频下工作)。
current CPU frequency is 1.60 GHz 表示当前正在运行的主频。
调整CPU工作模式:
1、调整整体工作模式
- cpufreq-set -g performance
2、手工0号核心的指定最大频率和最小频率
- cpufreq-set -c 0 -g userspace -d 180000 -u 240000