我刚刚在 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 [email protected], 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)
答案1
我在最新版本的 Mint 上遇到了同样的问题,将缩放比例设置为保守似乎最接近按需模式的工作方式。
然后我发现问题出在哪里,up_threshold 太高了,它被设置为 95% 的负载,现在这对于持续负载来说没问题,但在大多数情况下,CPU 活动会小幅爆发,而您希望 CPU 能够更快地扩展到 100% 的速度。我通过将 up_threshold 设置得更低来解决这个问题(在我的情况下,75 似乎可以做到)。您可以通过将所需值回显到 来更改它/sys/devices/system/cpu/cpufreq/ondemand/up_threshold
。
答案2
我建议你应该使用是否有类似 Jupiter 的省电应用程序?
并使用 indicator-cpufreq,这样你就应该知道你处于什么频率。检查我粘贴的链接如何安装/配置 indicator-cpufreq
是否有类似 Jupiter 的省电应用程序?第 3 节)处理器和频率调节
ondemand Dynamically switch between CPU(s) available if at 95% cpu load
保持 CPU 处于低位,只有当 CPU 负载达到 95% 时才会超过
performance Run the cpu at max frequency
conservative Dynamically switch between CPU(s) available if at 75% load
保持 CPU 处于低位,只有当 CPU 负载达到 75% 时才会超过
powersave Run the cpu at the minimum frequency
答案3
我在 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 中,以便它们在每次启动时执行。
Ninja 编辑:将上面的 2900000 替换为以下值:
cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq