我有一台带有 Xubuntu 18.04 LTS 的联想 T570。我目前的问题是我的 cpu 速度步进有点发疯,并且做了它认为最好的事情。
示例:当我运行我的 IDE 并且在构建期间 CPU 负载增加时,调控器会自动更改。我在编译我的项目期间通过以下调用抓住了这一刻:
martin@martin-ThinkPad-T570:~$ while cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor; do sleep 1; done
powersave
powersave
performance
performance
cpufreq-info 告诉我这个:
martin@martin-ThinkPad-T570:~$ cpufreq-info
cpufrequtils 008: cpufreq-info (C) Dominik Brodowski 2004-2009
Report errors and bugs to [email protected], please.
analyzing CPU 0:
driver: intel_pstate
CPUs which run at the same hardware frequency: 0
CPUs which need to have their frequency coordinated by software: 0
maximum transition latency: 4294.55 ms.
hardware limits: 400 MHz - 3.50 GHz
available cpufreq governors: performance, powersave
current policy: frequency should be within 3.50 GHz and 3.50 GHz.
The governor "performance" may decide which speed to use
within this range.
current CPU frequency is 3.25 GHz.
analyzing CPU 1:
driver: intel_pstate
CPUs which run at the same hardware frequency: 1
CPUs which need to have their frequency coordinated by software: 1
maximum transition latency: 4294.55 ms.
hardware limits: 400 MHz - 3.50 GHz
available cpufreq governors: performance, powersave
current policy: frequency should be within 3.50 GHz and 3.50 GHz.
The governor "performance" may decide which speed to use
within this range.
current CPU frequency is 3.36 GHz.
analyzing CPU 2:
driver: intel_pstate
CPUs which run at the same hardware frequency: 2
CPUs which need to have their frequency coordinated by software: 2
maximum transition latency: 4294.55 ms.
hardware limits: 400 MHz - 3.50 GHz
available cpufreq governors: performance, powersave
current policy: frequency should be within 3.50 GHz and 3.50 GHz.
The governor "performance" may decide which speed to use
within this range.
current CPU frequency is 3.26 GHz.
analyzing CPU 3:
driver: intel_pstate
CPUs which run at the same hardware frequency: 3
CPUs which need to have their frequency coordinated by software: 3
maximum transition latency: 4294.55 ms.
hardware limits: 400 MHz - 3.50 GHz
available cpufreq governors: performance, powersave
current policy: frequency should be within 3.50 GHz and 3.50 GHz.
The governor "performance" may decide which speed to use
within this range.
current CPU frequency is 3.36 GHz.
请看一下
当前政策:频率应在 3.50 GHz 和 3.50 GHz 之间。调速器“性能”可以决定使用哪种速度
之后回到 powersave 我使用我的小脚本:
martin@martin-ThinkPad-T570:~$ cat cpu_freq_save.sh
#!/bin/bash
sudo cpufreq-set -g powersave -c 0 --min 400MHz
sudo cpufreq-set -g powersave -c 1 --min 400MHz
sudo cpufreq-set -g powersave -c 2 --min 400MHz
sudo cpufreq-set -g powersave -c 3 --min 400MHz
这会重置最小频率和调速器,但只要我每次使用我的 IDE 再次编译调速器和最小频率再次更改时。
知道如何禁用该自动更改吗?
PS:如果您需要更多详细信息,请告诉我在哪里可以找到它们,我会提供