我有一台配备英特尔 13980HX 的笔记本电脑,它的 p 核最大升压频率应该为 5.6 GHZ。
但是 Linux 目前报告的最大速度为 5.4 GHZ,有什么线索可以解释原因吗?我正在运行 OEM 内核 6.5.0。
cat /proc/version
Linux version 6.5.0-1008-oem (buildd@lcy02-amd64-111) (x86_64-linux-gnu-gcc-12 (Ubuntu 12.3.0-1ubuntu1~22.04) 12.3.0, GNU ld (GNU Binutils for Ubuntu) 2.38) #8-Ubuntu SMP PREEMPT_DYNAMIC Fri Nov 10 13:08:33 UTC 2023
cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 183
model name : 13th Gen Intel(R) Core(TM) i9-13980HX
stepping : 1
microcode : 0x11d
cpu MHz : 1612.499
cache size : 36864 KB
physical id : 0
siblings : 32
core id : 0
cpu cores : 24
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 32
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid rdseed adx smap clflushopt clwb intel_pt sha_ni xsaveopt xsavec xgetbv1 xsaves split_lock_detect avx_vnni dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp hwp_pkg_req hfi vnmi umip pku ospke waitpkg gfni vaes vpclmulqdq rdpid movdiri movdir64b fsrm md_clear serialize arch_lbr ibt flush_l1d arch_capabilities
vmx flags : vnmi preemption_timer posted_intr invvpid ept_x_only ept_ad ept_1gb flexpriority apicv tsc_offset vtpr mtf vapic ept vpid unrestricted_guest vapic_reg vid ple shadow_vmcs ept_mode_based_exec tsc_scaling usr_wait_pause
bugs : spectre_v1 spectre_v2 spec_store_bypass swapgs eibrs_pbrsb
bogomips : 4838.40
clflush size : 64
cache_alignment : 64
address sizes : 39 bits physical, 48 bits virtual
power management:
cat cpu*/cpufreq/scaling_max_freq
5400000
5400000
5400000
5400000
5400000
5400000
5400000
4000000
4000000
4000000
4000000
5400000
4000000
4000000
4000000
4000000
4000000
4000000
4000000
4000000
4000000
4000000
5400000
4000000
4000000
5400000
5400000
5400000
5400000
5400000
5400000
5400000
答案1
我找到了问题所在。这实际上是由于我使用了 cpupower-gui 造成的。重新启动机器会恢复每个核心的正确值。显然,对于此 CPU,并非所有 P 核心都可以达到 5.6 GHz,有些仍然限制在 5.4 GHz。
$ find /sys/devices -name scaling_max_freq | sort -V | xargs -I {} sh -c 'echo {} && cat {}'
/sys/devices/system/cpu/cpufreq/policy0/scaling_max_freq
5400000
/sys/devices/system/cpu/cpufreq/policy1/scaling_max_freq
5400000
/sys/devices/system/cpu/cpufreq/policy2/scaling_max_freq
5400000
/sys/devices/system/cpu/cpufreq/policy3/scaling_max_freq
5400000
/sys/devices/system/cpu/cpufreq/policy4/scaling_max_freq
5400000
/sys/devices/system/cpu/cpufreq/policy5/scaling_max_freq
5400000
/sys/devices/system/cpu/cpufreq/policy6/scaling_max_freq
5400000
/sys/devices/system/cpu/cpufreq/policy7/scaling_max_freq
5400000
/sys/devices/system/cpu/cpufreq/policy8/scaling_max_freq
5600000
/sys/devices/system/cpu/cpufreq/policy9/scaling_max_freq
5600000
/sys/devices/system/cpu/cpufreq/policy10/scaling_max_freq
5600000
/sys/devices/system/cpu/cpufreq/policy11/scaling_max_freq
5600000
/sys/devices/system/cpu/cpufreq/policy12/scaling_max_freq
5400000
/sys/devices/system/cpu/cpufreq/policy13/scaling_max_freq
5400000
/sys/devices/system/cpu/cpufreq/policy14/scaling_max_freq
5400000
/sys/devices/system/cpu/cpufreq/policy15/scaling_max_freq
5400000
/sys/devices/system/cpu/cpufreq/policy16/scaling_max_freq
4000000
/sys/devices/system/cpu/cpufreq/policy17/scaling_max_freq
4000000
/sys/devices/system/cpu/cpufreq/policy18/scaling_max_freq
4000000
/sys/devices/system/cpu/cpufreq/policy19/scaling_max_freq
4000000
/sys/devices/system/cpu/cpufreq/policy20/scaling_max_freq
4000000
/sys/devices/system/cpu/cpufreq/policy21/scaling_max_freq
4000000
/sys/devices/system/cpu/cpufreq/policy22/scaling_max_freq
4000000
/sys/devices/system/cpu/cpufreq/policy23/scaling_max_freq
4000000
/sys/devices/system/cpu/cpufreq/policy24/scaling_max_freq
4000000
/sys/devices/system/cpu/cpufreq/policy25/scaling_max_freq
4000000
/sys/devices/system/cpu/cpufreq/policy26/scaling_max_freq
4000000
/sys/devices/system/cpu/cpufreq/policy27/scaling_max_freq
4000000
/sys/devices/system/cpu/cpufreq/policy28/scaling_max_freq
4000000
/sys/devices/system/cpu/cpufreq/policy29/scaling_max_freq
4000000
/sys/devices/system/cpu/cpufreq/policy30/scaling_max_freq
4000000
/sys/devices/system/cpu/cpufreq/policy31/scaling_max_freq
4000000
因此,当我使用 cpupower-gui 工具更改调节器或最大 CPU 频率并选择“所有 CPU”选项时,它将修改所有 CPU 的频率,但基于所选 CPU 核心(默认情况下为第一个核心)的限制。在这种情况下,第一个核心的最大频率为 5.4 GHz,因此最终将所有核心设置为最大频率 5.4 GHz,e 核心最终被限制为 4 GHz,而 5.6 GHz p 核心被强制降至 5.4 GHz。解决方案是首先选择核心 8 或其他能够以 5.6 GHz 运行的核心之一,然后使用 GUI 中的所有 CPU 选项来修改调节器或调整/恢复最大速度。