CPU 的最低可能频率是多少(我使用的是 Intel® Core™ i7-8750H CPU @ 2.20GHz × 12)
答案1
此答案使用原始命令。其他人可能会添加有关 tlp 或其他更高级实用程序的另一个答案。
最低 CPU 频率并不总是意味着最长的电池寿命。有时,以更高的 CPU 频率更快地完成任务会导致深度低功耗空闲状态的额外时间增加,从而节省了能源。这种情况的术语是“竞速空闲”。性能/功率曲线的高度非线性部分位于“涡轮”区域。因此,通常只需禁用涡轮就足够了。
默认情况下,您的计算机应使用 intel_pstate CPU 频率调节驱动程序和 powersave 调节器。通过以下方式检查,例如:
doug@s18:~$ grep . /sys/devices/system/cpu/cpufreq/policy*/scaling_driver
/sys/devices/system/cpu/cpufreq/policy0/scaling_driver:intel_pstate
/sys/devices/system/cpu/cpufreq/policy1/scaling_driver:intel_pstate
/sys/devices/system/cpu/cpufreq/policy2/scaling_driver:intel_pstate
/sys/devices/system/cpu/cpufreq/policy3/scaling_driver:intel_pstate
/sys/devices/system/cpu/cpufreq/policy4/scaling_driver:intel_pstate
/sys/devices/system/cpu/cpufreq/policy5/scaling_driver:intel_pstate
doug@s18:~$ grep . /sys/devices/system/cpu/cpufreq/policy*/scaling_governor
/sys/devices/system/cpu/cpufreq/policy0/scaling_governor:performance
/sys/devices/system/cpu/cpufreq/policy1/scaling_governor:performance
/sys/devices/system/cpu/cpufreq/policy2/scaling_governor:performance
/sys/devices/system/cpu/cpufreq/policy3/scaling_governor:performance
/sys/devices/system/cpu/cpufreq/policy4/scaling_governor:performance
/sys/devices/system/cpu/cpufreq/policy5/scaling_governor:performance
哦,那我们来解决这个问题:
doug@s18:~$ echo powersave | sudo tee /sys/devices/system/cpu/cpufreq/policy*/scaling_governor
powersave
doug@s18:~$ grep . /sys/devices/system/cpu/cpufreq/policy*/scaling_governor
/sys/devices/system/cpu/cpufreq/policy0/scaling_governor:powersave
/sys/devices/system/cpu/cpufreq/policy1/scaling_governor:powersave
/sys/devices/system/cpu/cpufreq/policy2/scaling_governor:powersave
/sys/devices/system/cpu/cpufreq/policy3/scaling_governor:powersave
/sys/devices/system/cpu/cpufreq/policy4/scaling_governor:powersave
/sys/devices/system/cpu/cpufreq/policy5/scaling_governor:powersave
现在,如果 BIOS 中没有禁用 turbo,它将默认为启用,因此请禁用它:
grep . /sys/devices/system/cpu/intel_pstate/no_turbo
doug@s18:~$ grep . /sys/devices/system/cpu/intel_pstate/no_turbo
0
doug@s18:~$ echo 1 | sudo tee /sys/devices/system/cpu/intel_pstate/no_turbo
1
doug@s18:~$ grep . /sys/devices/system/cpu/intel_pstate/no_turbo
1
默认情况下,您的计算机应启用 HWP(硬件 Pstate),因此您也可以告诉它优先考虑省电而不是性能:
doug@s18:~$ grep . /sys/devices/system/cpu/cpufreq/policy*/energy_performance*
/sys/devices/system/cpu/cpufreq/policy0/energy_performance_available_preferences:default performance balance_performance balance_power power
/sys/devices/system/cpu/cpufreq/policy0/energy_performance_preference:balance_performance
/sys/devices/system/cpu/cpufreq/policy1/energy_performance_available_preferences:default performance balance_performance balance_power power
/sys/devices/system/cpu/cpufreq/policy1/energy_performance_preference:balance_performance
/sys/devices/system/cpu/cpufreq/policy2/energy_performance_available_preferences:default performance balance_performance balance_power power
/sys/devices/system/cpu/cpufreq/policy2/energy_performance_preference:balance_performance
/sys/devices/system/cpu/cpufreq/policy3/energy_performance_available_preferences:default performance balance_performance balance_power power
/sys/devices/system/cpu/cpufreq/policy3/energy_performance_preference:balance_performance
/sys/devices/system/cpu/cpufreq/policy4/energy_performance_available_preferences:default performance balance_performance balance_power power
/sys/devices/system/cpu/cpufreq/policy4/energy_performance_preference:balance_performance
/sys/devices/system/cpu/cpufreq/policy5/energy_performance_available_preferences:default performance balance_performance balance_power power
/sys/devices/system/cpu/cpufreq/policy5/energy_performance_preference:balance_performance
和:
doug@s18:~$ echo power | sudo tee /sys/devices/system/cpu/cpufreq/policy*/energy_performance_preference
power
doug@s18:~$ grep . /sys/devices/system/cpu/cpufreq/policy*/energy_performance_preference
/sys/devices/system/cpu/cpufreq/policy0/energy_performance_preference:power
/sys/devices/system/cpu/cpufreq/policy1/energy_performance_preference:power
/sys/devices/system/cpu/cpufreq/policy2/energy_performance_preference:power
/sys/devices/system/cpu/cpufreq/policy3/energy_performance_preference:power
/sys/devices/system/cpu/cpufreq/policy4/energy_performance_preference:power
/sys/devices/system/cpu/cpufreq/policy5/energy_performance_preference:power
现在,如果您仍然想降低最大 CPU 频率,您可以通过两种方法来实现:
doug@s18:~$ grep . /sys/devices/system/cpu/intel_pstate/*perf_pct
/sys/devices/system/cpu/intel_pstate/max_perf_pct:100
/sys/devices/system/cpu/intel_pstate/min_perf_pct:17
doug@s18:~$ echo 17 | sudo tee /sys/devices/system/cpu/intel_pstate/max_perf_pct
17
或者:
doug@s18:~$ grep . /sys/devices/system/cpu/cpufreq/policy*/scaling_m??_freq
/sys/devices/system/cpu/cpufreq/policy0/scaling_max_freq:3700000
/sys/devices/system/cpu/cpufreq/policy0/scaling_min_freq:800000
/sys/devices/system/cpu/cpufreq/policy1/scaling_max_freq:3700000
/sys/devices/system/cpu/cpufreq/policy1/scaling_min_freq:800000
/sys/devices/system/cpu/cpufreq/policy2/scaling_max_freq:3700000
/sys/devices/system/cpu/cpufreq/policy2/scaling_min_freq:800000
/sys/devices/system/cpu/cpufreq/policy3/scaling_max_freq:3700000
/sys/devices/system/cpu/cpufreq/policy3/scaling_min_freq:800000
/sys/devices/system/cpu/cpufreq/policy4/scaling_max_freq:3700000
/sys/devices/system/cpu/cpufreq/policy4/scaling_min_freq:800000
/sys/devices/system/cpu/cpufreq/policy5/scaling_max_freq:3700000
/sys/devices/system/cpu/cpufreq/policy5/scaling_min_freq:800000
doug@s18:~$ echo 800000 | sudo tee /sys/devices/system/cpu/cpufreq/policy*/scaling_max_freq
800000
doug@s18:~$ grep . /sys/devices/system/cpu/cpufreq/policy*/scaling_max_freq
/sys/devices/system/cpu/cpufreq/policy0/scaling_max_freq:800000
/sys/devices/system/cpu/cpufreq/policy1/scaling_max_freq:800000
/sys/devices/system/cpu/cpufreq/policy2/scaling_max_freq:800000
/sys/devices/system/cpu/cpufreq/policy3/scaling_max_freq:800000
/sys/devices/system/cpu/cpufreq/policy4/scaling_max_freq:800000
/sys/devices/system/cpu/cpufreq/policy5/scaling_max_freq:800000
现在,让我们使用 turbostat 来观察这些条件下的功率,使用 prime95 折磨测试,这是我所知道的最残酷的 CPU 压力程序:
$ sudo ./turbostat --Summary --quiet --show Busy%,Bzy_MHz,IRQ,PkgWatt,PkgTmp,RAMWatt --interval 6
Busy% Bzy_MHz IRQ PkgTmp PkgWatt RAMWatt
0.28 800 320 32 2.07 1.89
2.17 800 1136 33 2.10 1.89
99.36 4088 36118 67 105.53 1.96 <<< level 2 power throttle alrady active
99.32 4131 36077 62 108.98 1.96
100.12 4071 36076 64 99.94 1.96 <<< level 1 power throttle, 100 watts.
100.12 4070 36074 65 99.92 1.96
100.12 4069 36078 65 99.94 1.96
100.11 4067 36106 65 99.92 1.96
100.11 4066 36077 65 99.91 1.96
100.11 4065 36091 65 99.93 1.96
100.11 4063 36177 65 99.92 1.93
100.10 4061 36072 65 99.93 1.90
100.10 4059 36083 65 99.92 1.90
100.14 3966 36254 58 93.05 1.90
100.26 3700 36109 58 72.93 1.90 <<< turbo disabled
100.26 3700 36073 58 72.94 1.90
100.26 3700 36087 59 73.19 1.89
100.26 3369 36298 49 60.96 1.89
100.26 2800 36081 49 39.78 1.89 <<< start reducing max CPU freq more.
100.26 2800 36076 48 39.82 1.89
100.26 2800 36202 48 39.76 1.89
100.26 2371 36128 45 30.00 1.89
100.26 2300 36168 45 28.30 1.89
100.26 2300 36262 45 28.20 1.90
100.26 1976 36122 43 22.39 1.90
100.26 1900 36072 43 20.99 1.90
100.26 1900 36071 43 20.95 1.90
100.26 1900 36205 43 20.96 1.90
100.26 1486 36122 40 14.81 1.90
100.26 1400 36100 40 13.55 1.90
100.26 1400 36073 40 13.54 1.90
100.26 1400 36205 40 13.60 1.90
100.26 1082 36116 39 9.83 1.90
100.26 1000 36076 39 8.89 1.90
100.26 1000 36195 38 8.88 1.90
100.26 878 36131 38 7.84 1.89
100.26 800 36075 38 7.19 1.89 <<< until lowest possible
100.26 800 36070 38 7.22 1.89
100.26 800 36086 38 7.26 1.89