Skip to content

Instantly share code, notes, and snippets.

@yorickvP
Last active September 20, 2020 10:32
Show Gist options
  • Save yorickvP/f6165d4284749bc6cd2a0648e152ca68 to your computer and use it in GitHub Desktop.
Save yorickvP/f6165d4284749bc6cd2a0648e152ca68 to your computer and use it in GitHub Desktop.
[nix-shell:~]$ seq 1000 | perf stat -e r002c:u,r0225:u,r0425:u,r0825:u,r0e25:u sort > /dev/null
Performance counter stats for 'sort':
1 r002c:u
2 r0225:u
43 r0425:u
84 r0825:u
129 r0e25:u
0.001226514 seconds time elapsed
0.000638000 seconds user
0.000638000 seconds sys
[nix-shell:~]$ lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
Address sizes: 43 bits physical, 48 bits virtual
CPU(s): 24
On-line CPU(s) list: 0-23
Thread(s) per core: 2
Core(s) per socket: 12
Socket(s): 1
NUMA node(s): 1
Vendor ID: AuthenticAMD
CPU family: 23
Model: 1
Model name: AMD Ryzen Threadripper 1920X 12-Core Processor
Stepping: 1
CPU MHz: 3064.454
CPU max MHz: 3500.0000
CPU min MHz: 2200.0000
BogoMIPS: 6999.15
Virtualization: AMD-V
L1d cache: 32K
L1i cache: 64K
L2 cache: 512K
L3 cache: 8192K
NUMA node0 CPU(s): 0-23
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 ssbd sev ibpb vmmcall fsgsbase bmi1 avx2 smep bmi2 rdseed adx smap clflushopt sha_ni xsaveopt xsavec xgetbv1 xsaves clzero irperf xsaveerptr arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif overflow_recov succor smca
❯ lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
Address sizes: 43 bits physical, 48 bits virtual
CPU(s): 32
On-line CPU(s) list: 0-31
Thread(s) per core: 2
Core(s) per socket: 16
Socket(s): 1
NUMA node(s): 1
Vendor ID: AuthenticAMD
CPU family: 23
Model: 113
Model name: AMD Ryzen 9 3950X 16-Core Processor
Stepping: 0
Frequency boost: enabled
CPU MHz: 3509.852
CPU max MHz: 3500.0000
CPU min MHz: 2200.0000
BogoMIPS: 7000.35
Virtualization: AMD-V
L1d cache: 512 KiB
L1i cache: 512 KiB
L2 cache: 8 MiB
L3 cache: 64 MiB
NUMA node0 CPU(s): 0-31
Vulnerability Itlb multihit: Not affected
Vulnerability L1tf: Not affected
Vulnerability Mds: Not affected
Vulnerability Meltdown: Not affected
Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl and seccomp
Vulnerability Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2: Mitigation; Full AMD retpoline, IBPB conditional, STIBP always-on, RSB filling
Vulnerability Tsx async abort: Not affected
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 fxs
r_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid aperfmperf pni pclmulqdq monitor ssse3 fm
a cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignss
e 3dnowprefetch osvw ibs skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb cat_l3 cdp_l3 hw_psta
te sme ssbd mba sev ibpb stibp vmmcall fsgsbase bmi1 avx2 smep bmi2 cqm rdt_a rdseed adx smap clflushopt clwb sha_ni xsave
opt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local clzero irperf xsaveerptr rdpru wbnoinvd arat n
pt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgi
f umip rdpid overflow_recov succor smca
❯ sudo wrmsr -a 0xc0011020 0x6404000000000
❯ seq 1000 | perf stat -e r002c:u,r0225:u,r0425:u,r0825:u,r0e25:u sort > /dev/null
Performance counter stats for 'sort':
1 r002c:u
3 r0225:u
40 r0425:u
86 r0825:u
129 r0e25:u
0.001304755 seconds time elapsed
0.001323000 seconds user
0.000000000 seconds sys
❯ sudo wrmsr -a 0xc0011020 0x6404000000100
❯ seq 1000 | perf stat -e r002c:u,r0225:u,r0425:u,r0825:u,r0e25:u sort > /dev/null
Performance counter stats for 'sort':
1 r002c:u
129 r0225:u
0 r0425:u
0 r0825:u
129 r0e25:u
0.001243876 seconds time elapsed
0.001274000 seconds user
0.000000000 seconds sys
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment