AMD Epyc CPU frequency on linux

alex_stief

Active Member
May 31, 2016
752
241
43
36
tl;dr: How to get AMD core performance boost on linux? Or how to read CPU frequency correctly?

My setup consists of two AMD Epyc 7301 (2.2GHz Base, 2.7GHz boost) on a Supermicro H11DSi.
I just installed Opensuse Tumbleweed which comes with Kernel version 4.14.2-1-default.
Code:
uname -a
Linux localhost 4.14.2-1-default #1 SMP PREEMPT Fri Nov 24 08:20:07 UTC 2017 (b0610fc) x86_64 x86_64 x86_64 GNU/Linux
lscpu shows 1.2GHz min and 2.2GHz max
Code:
lscpu
Architecture:        x86_64
CPU op-mode(s):      32-bit, 64-bit
Byte Order:          Little Endian
CPU(s):              64
On-line CPU(s) list: 0-63
Thread(s) per core:  2
Core(s) per socket:  16
Socket(s):           2
NUMA node(s):        8
Vendor ID:           AuthenticAMD
CPU family:          23
Model:               1
Model name:          AMD EPYC 7301 16-Core Processor
Stepping:            2
CPU MHz:             1200.000
CPU max MHz:         2200.0000
CPU min MHz:         1200.0000
BogoMIPS:            4399.41
Virtualization:      AMD-V
L1d cache:           32K
L1i cache:           64K
L2 cache:            512K
L3 cache:            8192K
NUMA node0 CPU(s):   0-3,32-35
NUMA node1 CPU(s):   4-7,36-39
NUMA node2 CPU(s):   8-11,40-43
NUMA node3 CPU(s):   12-15,44-47
NUMA node4 CPU(s):   16-19,48-51
NUMA node5 CPU(s):   20-23,52-55
NUMA node6 CPU(s):   24-27,56-59
NUMA node7 CPU(s):   28-31,60-63
Flags:               fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid amd_dcm aperfmperf pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb hw_pstate sme vmmcall fsgsbase bmi1 avx2 smep bmi2 rdseed adx smap clflushopt sha_ni xsaveopt xsavec xgetbv1 xsaves clzero irperf arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif overflow_recov succor smca

Loading one or more cores using "stress -c N" only yields a frequency of 2.2GHz for these cores. Read from cat /proc/cpuinfo | grep MHz
Code:
cat /proc/cpuinfo | grep MHz
cpu MHz         : 2200.000
cpu MHz         : 1200.000
cpu MHz         : 2200.000
cpu MHz         : 1200.000
cpu MHz         : 1200.000
cpu MHz         : 1200.000
cpu MHz         : 2200.000
cpu MHz         : 1200.000
cpu MHz         : 2200.000
cpu MHz         : 1200.000
cpu MHz         : 2200.000
cpu MHz         : 1200.000
cpu MHz         : 2200.000
cpu MHz         : 1200.000
cpu MHz         : 1200.000
cpu MHz         : 1200.000
cpu MHz         : 2200.000
cpu MHz         : 1200.000
cpu MHz         : 2200.000
cpu MHz         : 2200.000
cpu MHz         : 2200.000
cpu MHz         : 2200.000
cpu MHz         : 2200.000
cpu MHz         : 2200.000
cpu MHz         : 2200.000
cpu MHz         : 2200.000
cpu MHz         : 2200.000
cpu MHz         : 2200.000
cpu MHz         : 2200.000
cpu MHz         : 2200.000
cpu MHz         : 2200.000
cpu MHz         : 2200.000
cpu MHz         : 1200.000
cpu MHz         : 1200.000
cpu MHz         : 1200.000
cpu MHz         : 1200.000
cpu MHz         : 2200.000
cpu MHz         : 2200.000
cpu MHz         : 1200.000
cpu MHz         : 1200.000
cpu MHz         : 1200.000
cpu MHz         : 1200.000
cpu MHz         : 1200.000
cpu MHz         : 1200.000
cpu MHz         : 1200.000
cpu MHz         : 1200.000
cpu MHz         : 1200.000
cpu MHz         : 1200.000
cpu MHz         : 2200.000
cpu MHz         : 2200.000
cpu MHz         : 2200.000
cpu MHz         : 2200.000
cpu MHz         : 1200.000
cpu MHz         : 2200.000
cpu MHz         : 2200.000
cpu MHz         : 2200.000
cpu MHz         : 2200.000
cpu MHz         : 2200.000
cpu MHz         : 1200.000
cpu MHz         : 2200.000
cpu MHz         : 2200.000
cpu MHz         : 2200.000
cpu MHz         : 2200.000
cpu MHz         : 1200.000

Default CPU governor is obviously "ondemand". Changing it to "performance" for each core changes nothing. Still only 2.2GHz maximum. Well it changes something of course, frequency is always 2.2GHz with "performance".

Is this a wrong reading of the actual CPU frequency? How can I get the full 2.7GHz on a Linux system?
This is neither a thermal issue nor a TDP issue. Even loading a single core only yields 2.2GHz maximum.
And bios settings should not be a problem either. I achieved 2.7GHz all-core on a Windows Server 2016 install with the same bios settings. I had to use "high performance" preset though because "balanced" capped at 2.2GHz.
I never had such issues with my previous Intel setups ranging from ancient to Broadwell-E. lscpu and other system tools always showed the correct current and maximum frequency including CPU turbo.
 

alex_stief

Active Member
May 31, 2016
752
241
43
36
Never mind. Turbostat shows the real CPU frequency which is indeed 2.7GHz under load.