1. Ubuntu 16.04 cpu 工作为powersave 并且更改了重启之后会恢复powersave
刚安装完有时候CPU频率设置得非常低(powersave模式),用cpufrequtils更改为performance之后重启恢复,使用sysftutils更改启动参数为performance之后仍然会变为powersave
2. 常用命令
2.1. 查看cpu当前工作的频率模式
cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
2.2. 查看cpu支持的频率模式
cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_available_governors
2.3. 查看cpu当前频率
cat /proc/cpuinfo | grep MHz
3. CPU默认powersave的原因分析
本方法只支持用intel_pstate驱动调节的intel cpu
其实是由于ondemand这个服务的原因
ondemand, userspace, performance 分别是linux系统中三种CPU频率调节方式。
ondemand指的是平时以低速方式运行,当系统负载提高时候自动提高频率。以这种模式运行不会因为降频造成性能降低,同时也能节约电能和降低温度。
以下为ondemand服务启动执行的动作:
cat /etc/init.d/ondemand
#! /bin/sh
### BEGIN INIT INFO
# Provides: ondemand
# Required-Start: $remote_fs $all
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop:
# Short-Description: Set the CPU Frequency Scaling governor to "ondemand"
### END INIT INFO
# Don't run if we're going to start an Android LXC container:
[ ! -f /etc/init/lxc-android-config.conf ]