AMD EPYC Milan CPU, libvirt/qemu incorrect L3 cache displayed using cpu-passthrough flag

Bug #1998032 reported by Zain M
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Invalid
Undecided
Unassigned

Bug Description

Description
===========

Train version of Openstack, deployed via Openstack-Ansible on Ubuntu 18.04. Deployment of a single guest VM on a AMD EPYC 7713P 64-Core Proc hypervisor.

Problem,

The cpu output on the guest VM is not showing the correct L3 cache information, only consuming half of the hypervisors respective L3 cache. This is not ideal for clients performance testing requirements and L3 cache utilization. Using nova/libvirt flag of cpu_mode = host-passthrough has been the most consistent for cpu performance then any of the other cpu_mode flags.

Questions:
1. Is there a possible known bug in any bionic versions of libvirt/qemu that may casue this discrepency?
2. Any missing cpu flags that could cause this issue, that may need to be added to the libvirt domain, via a nova config override?

Expected result
===============

lscpu output of guest VM should show L3 cache value of 32768K

Actual result
=============

lscpu on guest vm shows L3 cache value of 16384K

Environment
===========

OS details:

Distributor ID: Ubuntu
Description: Ubuntu 18.04.6 LTS
Release: 18.04
Codename: bionic

Openstack Version:

DISTRIB_ID="OSA"
DISTRIB_RELEASE="20.2.6"
DISTRIB_CODENAME="Train"
DISTRIB_DESCRIPTION="OpenStack-Ansible"

Hypervisor Libvirt/QEMU versions

qemu-system-x86 1:4.2-3ubuntu6.23~cloud0
libvirt-daemon 6.0.0-0ubuntu8.16~cloud0

Logs & Configs
==============

hypervisor nova libvirt config

[libvirt]
inject_partition = -2
inject_password = False
inject_key = False
virt_type = kvm
cpu_mode = host-passthrough
live_migration_uri = "qemu+ssh://nova@%s/system?no_verify=1&keyfile=/var/lib/nova/.ssh/id_rsa"
live_migration_tunnelled = True
hw_disk_discard = ignore
disk_cachemodes = file=directsync

**Just a note, reserved one core for the underlying hypervisor and pinned the other 63 cores to the guest VM**

Hypervisor CPU output

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: 1
Core(s) per socket: 64
Socket(s): 1
NUMA node(s): 1
Vendor ID: AuthenticAMD
CPU family: 25
Model: 1
Model name: AMD EPYC 7713P 64-Core Processor
Stepping: 1
CPU MHz: 1781.378
CPU max MHz: 2000.0000
CPU min MHz: 1500.0000
BogoMIPS: 4000.20
Virtualization: AMD-V
L1d cache: 32K
L1i cache: 32K
L2 cache: 512K
L3 cache: 32768K
NUMA node0 CPU(s): 0-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 aperfmperf pni pclmulqdq monitor ssse3 fma cx16 pcid sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb cat_l3 cdp_l3 invpcid_single hw_pstate ssbd mba ibrs ibpb stibp vmmcall fsgsbase bmi1 avx2 smep bmi2 invpcid cqm rdt_a rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local clzero irperf xsaveerptr wbnoinvd arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold v_vmsave_vmload vgif umip pku ospke vaes vpclmulqdq rdpid overflow_recov succor smca

Virtual Machine CPU output using host-passthrough libvirt flag

Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 63
On-line CPU(s) list: 0-62
Thread(s) per core: 1
Core(s) per socket: 63
Socket(s): 1
NUMA node(s): 1
Vendor ID: AuthenticAMD
CPU family: 25
Model: 1
Model name: AMD EPYC 7713P 64-Core Processor
Stepping: 1
CPU MHz: 1999.999
BogoMIPS: 3999.99
Virtualization: AMD-V
Hypervisor vendor: KVM
Virtualization type: full
L1d cache: 64K
L1i cache: 64K
L2 cache: 512K
L3 cache: 16384K
NUMA node0 CPU(s): 0-62
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 art rep_good nopl extd_apicid eagerfpu pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm cmp_legacy svm cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw perfctr_core retpoline_amd ssbd ibrs ibpb stibp vmmcall fsgsbase tsc_adjust bmi1 avx2 smep bmi2 rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 clzero xsaveerptr arat npt nrip_save umip vaes vpclmulqdq spec_ctrl intel_stibp arch_capabilities

Revision history for this message
Uggla (rene-ribaud) wrote :

Thanks for reporting the issue.
The improper L3 cache size reporting seems more linked to kernel/lscpu bug/version and not libvirt/nova.
Quickly looking at Ubuntu requirements for Epyc: https://ubuntu.com/blog/amd-epyc-rome-support-in-ubuntu-server, it seems a minimum kernel 4.18.0-1017 version is required.
So could you please ensure you have at least this kernel version ? Although I'll encourage you to upgrade to the latest available kernel for your distribution ?

Also, have a look at this thread, as the issue looks closer to what your are experiencing: https://github.com/util-linux/util-linux/issues/663

Feel free to comment and change this bug to new again if you disagree or want to provide more info.

Changed in nova:
status: New → Incomplete
Revision history for this message
Zain M (kernel53) wrote :

Thank you so much for the feedback we did see that the lscpu package version had an effect here. We tested the same on a Ubuntu 20 Focal host and it showed the correct info.

Changed in nova:
status: Incomplete → Confirmed
Revision history for this message
Uggla (rene-ribaud) wrote :

Hello, I set this bug to invalid as it looks like it is not a nova bug.
Feel free to set this bug to new if you disagree.

Changed in nova:
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.