Skip to content

e2e: enforce virtual machine cache topology levels#716

Draft
askervin wants to merge 2 commits into
containers:mainfrom
askervin:5i4-e2e-force-cache-topology
Draft

e2e: enforce virtual machine cache topology levels#716
askervin wants to merge 2 commits into
containers:mainfrom
askervin:5i4-e2e-force-cache-topology

Conversation

@askervin

Copy link
Copy Markdown
Collaborator

On some host platforms, Qemu reports every virtual machine CPU hyperthread having its own L1d, L1i and L2 caches. Force virtual CPU cache topology where these caches are shared between thread siblings.

@askervin

askervin commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator Author

This does not seem to be enough, problem persists (and gets even worse, see L3...) at least on one host system:

[root@n4c16-fedora-43-containerd ~]# grep . /sys/devices/system/cpu/cpu0/cache/index*/*_list
/sys/devices/system/cpu/cpu0/cache/index0/shared_cpu_list:0
/sys/devices/system/cpu/cpu0/cache/index1/shared_cpu_list:0
/sys/devices/system/cpu/cpu0/cache/index2/shared_cpu_list:0
/sys/devices/system/cpu/cpu0/cache/index3/shared_cpu_list:0-3

[root@n4c16-fedora-43-containerd ~]# grep . /sys/devices/system/cpu/cpu0/topology/{thread_siblings_list,package_cpus_list}
/sys/devices/system/cpu/cpu0/topology/thread_siblings_list:0-1
/sys/devices/system/cpu/cpu0/topology/package_cpus_list:0-7

--> keeping the PR as Draft.


def qemuopts(numalist):
machineparam = "-machine q35,kernel-irqchip=split"
cpuparam = "-cpu host,x2apic=on"

@klihub klihub Jul 27, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this quite recent blog post suggests that in some cases we'd need the -machine q35,accel=kvm,kernel-irqchip=split -cpu host,+topoext with the +topoext cpu option explicitly given if -cpu host is also used.

@klihub klihub Jul 27, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With that extra option in place I get

[root@n4c16-fedora-43-containerd ~]# grep . /sys/devices/system/cpu/cpu0/cache/index*/*_list
/sys/devices/system/cpu/cpu0/cache/index0/shared_cpu_list:0-1
/sys/devices/system/cpu/cpu0/cache/index1/shared_cpu_list:0-1
/sys/devices/system/cpu/cpu0/cache/index2/shared_cpu_list:0-1
/sys/devices/system/cpu/cpu0/cache/index3/shared_cpu_list:0-7
[root@n4c16-fedora-43-containerd ~]# grep . /sys/devices/system/cpu/cpu0/topology/{thread_siblings_list,package_cpus_list}
/sys/devices/system/cpu/cpu0/topology/thread_siblings_list:0-1
/sys/devices/system/cpu/cpu0/topology/package_cpus_list:0-7

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@askervin: Can you test the updated PR on the host where you saw the failure earlier ?

@klihub
klihub force-pushed the 5i4-e2e-force-cache-topology branch 2 times, most recently from 9c2ee5e to b405bd8 Compare July 27, 2026 12:01
askervin and others added 2 commits July 27, 2026 15:03
On some host platforms, Qemu reports every virtual machine CPU
hyperthread having its own L1d, L1i and L2 caches. Force virtual CPU
cache topology where these caches are shared between thread siblings.

Signed-off-by: Antti Kervinen <antti.kervinen@intel.com>
Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com>
@klihub
klihub force-pushed the 5i4-e2e-force-cache-topology branch from b405bd8 to 718dd06 Compare July 27, 2026 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants