Ubuntu 13.04 CPU频率缩放“卡在”最低频率上

我刚刚在我的MacBook Air上安装了Ubuntu 13.04,经过一段时间的运转,机器感觉很慢,所以我检查了CPU的频率。 cpufreq-info,它在所有4个核心上报告800MHz(这是最低的设置)。 州长按需要求。 现在,当我在系统上加载一些负载(运行一个散列东西四次的小脚本)时,机器会暂停,但cpufreq-info仍然报告800MHz。 我可以手动将频率设置为2GHz,这解决了性能问题,但是我的电池耗费了我。

这是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 1 2 3 CPUs which need to have their frequency coordinated by software: 0 maximum transition latency: 10.0 us. hardware limits: 800 MHz - 2.00 GHz available frequency steps: 2.00 GHz, 2.00 GHz, 1.90 GHz, 1.80 GHz, 1.70 GHz, 1.60 GHz, 1.50 GHz, 1.40 GHz, 1.30 GHz, 1.20 GHz, 1.10 GHz, 1000 MHz, 900 MHz, 800 MHz available cpufreq governors: conservative, ondemand, userspace, powersave, performance current policy: frequency should be within 800 MHz and 2.00 GHz. The governor "ondemand" may decide which speed to use within this range. current CPU frequency is 800 MHz (asserted by call to hardware). cpufreq stats: 2.00 GHz:5,75%, 2.00 GHz:0,47%, 1.90 GHz:0,00%, 1.80 GHz:0,01%, 1.70 GHz:0,01%, 1.60 GHz:0,01%, 1.50 GHz:0,01%, 1.40 GHz:0,01%, 1.30 GHz:0,01%, 1.20 GHz:0,02%, 1.10 GHz:0,01%, 1000 MHz:0,02%, 900 MHz:0,02%, 800 MHz:93,67% (1388) analyzing CPU 1: driver: acpi-cpufreq CPUs which run at the same hardware frequency: 0 1 2 3 CPUs which need to have their frequency coordinated by software: 1 maximum transition latency: 10.0 us. hardware limits: 800 MHz - 2.00 GHz available frequency steps: 2.00 GHz, 2.00 GHz, 1.90 GHz, 1.80 GHz, 1.70 GHz, 1.60 GHz, 1.50 GHz, 1.40 GHz, 1.30 GHz, 1.20 GHz, 1.10 GHz, 1000 MHz, 900 MHz, 800 MHz available cpufreq governors: conservative, ondemand, userspace, powersave, performance current policy: frequency should be within 800 MHz and 2.00 GHz. The governor "ondemand" may decide which speed to use within this range. current CPU frequency is 800 MHz (asserted by call to hardware). cpufreq stats: 2.00 GHz:3,17%, 2.00 GHz:0,01%, 1.90 GHz:0,01%, 1.80 GHz:0,00%, 1.70 GHz:0,00%, 1.60 GHz:0,01%, 1.50 GHz:0,01%, 1.40 GHz:0,01%, 1.30 GHz:0,01%, 1.20 GHz:0,01%, 1.10 GHz:0,01%, 1000 MHz:0,02%, 900 MHz:0,02%, 800 MHz:96,71% (1433) analyzing CPU 2: driver: acpi-cpufreq CPUs which run at the same hardware frequency: 0 1 2 3 CPUs which need to have their frequency coordinated by software: 2 maximum transition latency: 10.0 us. hardware limits: 800 MHz - 2.00 GHz available frequency steps: 2.00 GHz, 2.00 GHz, 1.90 GHz, 1.80 GHz, 1.70 GHz, 1.60 GHz, 1.50 GHz, 1.40 GHz, 1.30 GHz, 1.20 GHz, 1.10 GHz, 1000 MHz, 900 MHz, 800 MHz available cpufreq governors: conservative, ondemand, userspace, powersave, performance current policy: frequency should be within 800 MHz and 2.00 GHz. The governor "ondemand" may decide which speed to use within this range. current CPU frequency is 800 MHz (asserted by call to hardware). cpufreq stats: 2.00 GHz:2,69%, 2.00 GHz:0,00%, 1.90 GHz:0,01%, 1.80 GHz:0,01%, 1.70 GHz:0,01%, 1.60 GHz:0,02%, 1.50 GHz:0,01%, 1.40 GHz:0,01%, 1.30 GHz:0,02%, 1.20 GHz:0,02%, 1.10 GHz:0,01%, 1000 MHz:0,02%, 900 MHz:0,02%, 800 MHz:97,16% (1194) analyzing CPU 3: driver: acpi-cpufreq CPUs which run at the same hardware frequency: 0 1 2 3 CPUs which need to have their frequency coordinated by software: 3 maximum transition latency: 10.0 us. hardware limits: 800 MHz - 2.00 GHz available frequency steps: 2.00 GHz, 2.00 GHz, 1.90 GHz, 1.80 GHz, 1.70 GHz, 1.60 GHz, 1.50 GHz, 1.40 GHz, 1.30 GHz, 1.20 GHz, 1.10 GHz, 1000 MHz, 900 MHz, 800 MHz available cpufreq governors: conservative, ondemand, userspace, powersave, performance current policy: frequency should be within 800 MHz and 2.00 GHz. The governor "ondemand" may decide which speed to use within this range. current CPU frequency is 800 MHz (asserted by call to hardware). cpufreq stats: 2.00 GHz:3,07%, 2.00 GHz:0,02%, 1.90 GHz:0,01%, 1.80 GHz:0,00%, 1.70 GHz:0,01%, 1.60 GHz:0,01%, 1.50 GHz:0,01%, 1.40 GHz:0,01%, 1.30 GHz:0,01%, 1.20 GHz:0,01%, 1.10 GHz:0,03%, 1000 MHz:0,03%, 900 MHz:0,01%, 800 MHz:96,77% (1004) 

我在最新版本的Mint上遇到了同样的问题,将缩放设置为保守似乎最接近于按需使用的方式。

然后我发现问题是什么,up_threshold太高了,它设置为95%负载,现在这对于持续负载是好的,但是在大多数情况下有一小部分CPU活动,你想要CPU以更快的速度扩展到100%的速度。 我通过设置较低的up_threshold来解决这个问题(在我的情况下,75似乎没问题)。 您可以通过将所需的值回显到/sys/devices/system/cpu/cpufreq/ondemand/up_threshold来更改它。

我建议您应该使用是否存在类似于木星的省电应用程序?

并使用indicator-cpufreq,这样你就应该知道你所处的频率。 检查我已粘贴的链接如何安装/配置indicator-cpufreq

有没有类似于木星的省电应用程序? 第3节) 处理器和频率调整

 ondemand Dynamically switch between CPU(s) available if at 95% cpu load 

保持Cpu低,只有在95%cpu负载时才超过

 performance Run the cpu at max frequency conservative Dynamically switch between CPU(s) available if at 75% load 

保持Cpu低,只有在75%cpu负载时才超过

 powersave Run the cpu at the minimum frequency 

我在14.04 – 16.04(截至今天)遇到了这个问题。 为了解决这个问题,我不得不强迫Ubuntu忽略bios限制。 以下对我有用:

打开grub:

 sudo vim /etc/default/grub 

替换GRUB_CMDLINE_LINUX_DEFAULT行:

 - GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" + GRUB_CMDLINE_LINUX_DEFAULT="quiet splash intel_pstate=disable processor.ignore_ppc=1" 

更新grub:

 sudo update-grub 

然后重新启动:

 echo 1 | sudo dd of=/sys/module/processor/parameters/ignore_ppc echo 2900000 | sudo dd of=/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq echo 2900000 | sudo dd of=/sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq echo 2900000 | sudo dd of=/sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq echo 2900000 | sudo dd of=/sys/devices/system/cpu/cpu3/cpufreq/scaling_max_freq 

为我工作。 检查cpu内核的数量并相应地更新所有内容。 您可能希望将这些额外的行放在/etc/rc.local中,以便它们在每次启动时执行。

忍者编辑:将上面的2900000替换为以下值:

 cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq