Answers:
经过ondemand
一段时间的努力后,我将分享如何在Ubuntu及其衍生版本中永久禁用它。
安装cpufrequtils
:
sudo apt-get install cpufrequtils
然后编辑以下文件(如果不存在,请创建它):
sudo nano /etc/default/cpufrequtils
并添加以下行:
GOVERNOR="performance"
保存并退出。
现在,您需要禁用ondemand
守护程序,否则,重新启动后,设置将被覆盖。
sudo update-rc.d ondemand disable
您完成了!
您可以使用以下方法检查设置:
cpufreq-info
它将显示处理器所具有的每个内核的信息块。只需检查所有功能是否都处于性能模式,并以处理器的最大速度即可。
更新:
Debian Wiki指出,sysfsutils
在重新启动期间维护设置是必要的,但这是不正确的。另外,启用sysfsutils
会使我的系统不稳定,因此不建议这样做。
对不起,我拼错了什么。:)
资料来源:
/etc/default/cpufrequtils/
在我的Ubuntu 14.04上不存在,看来正确的路径是/etc/init.d/cpufrequtils
/etc/default/cpufrequtils/
源自,/etc/init.d/cpufrequtils
因此也可以正常工作,并且如果在中进行配置,则可以通过软件包更新更轻松地维护自己的设置/etc/default/cpufrequtils/
。
/etc/init.d/ondemand
因此,sudo update-rc.d ondemand disable
我只需要重新启动即可。
我无法发表评论,因此我不得不求助于新答案。为了立即获得结果,请确保sudo /etc/init.d/cpufrequtils restart
您按照Dennie的所有步骤进行操作以使新频率生效。
cpufreq-set -g performance
尝试这个:
gksu gedit /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
替换ondemand
为performance
。对每个核心重复一次(增加cpu0:cpu1,cpu2)。
如果出现保存错误,请使用nano编辑器:
sudo nano /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
通过安装cpufrequtils by之后sudo apt-get install cpufrequtils
,查看命令给出的信息cpufreq-info
,然后创建一个文件sudo nano /etc/default/cpufrequtils
--并如下图所示将其写入。在您的情况下,max和min将是相同的值。
GOVERNOR="ondemand"
MIN_SPEED="800MHz"
MAX_SPEED="950MHz"
最后,使更改生效并永久生效的命令(即在启动时除外)sudo /etc/init.d/cpufrequtils restart
,导致以下输出cpufreq-info
:
peter@peter-HP-Compaq-2510p:~$ cpufreq-info
cpufrequtils 008: cpufreq-info (C) Dominik Brodowski 2004-2009
Report errors and bugs to cpufreq@vger.kernel.org, please.
analyzing CPU 0:
driver: acpi-cpufreq
CPUs which run at the same hardware frequency: 0
CPUs which need to have their frequency coordinated by software: 0
maximum transition latency: 10.0 us.
hardware limits: 800 MHz - 1.20 GHz
available frequency steps: 1.20 GHz, 1.07 GHz, 933 MHz, 800 MHz
available cpufreq governors: conservative, ondemand, userspace, powersave, performance
current policy: frequency should be within 800 MHz and 950 MHz.
The governor "ondemand" may decide which speed to use
within this range.
current CPU frequency is 933 MHz.
cpufreq stats: 1.20 GHz:1,27%, 1.07 GHz:0,01%, 933 MHz:95,97%, 800 MHz:2,75% (5975)
analyzing CPU 1:
driver: acpi-cpufreq
CPUs which run at the same hardware frequency: 1
CPUs which need to have their frequency coordinated by software: 1
maximum transition latency: 10.0 us.
hardware limits: 800 MHz - 1.20 GHz
available frequency steps: 1.20 GHz, 1.07 GHz, 933 MHz, 800 MHz
available cpufreq governors: conservative, ondemand, userspace, powersave, performance
current policy: frequency should be within 800 MHz and 950 MHz.
The governor "ondemand" may decide which speed to use
within this range.
current CPU frequency is 800 MHz.
cpufreq stats: 1.20 GHz:1,26%, 1.07 GHz:0,01%, 933 MHz:95,83%, 800 MHz:2,90% (7039)
peter@peter-HP-Compaq-2510p:~$
这对我适用于Xubuntu 18.04.2