Repository navigation
evetest: let a test ask for SMT sibling threads - #7130
Merged
Merged
Conversation
A test of SMT-aware behaviour, such as CPU placement that allocates whole physical cores, needs a node whose CPUs share cores. Every provider gives the EVE VM one thread per core: QEMU expands a bare "-smp N" with threads=1, the libvirt domain's topology is fixed at one thread per core, and Proxmox VE starts QEMU with "-smp N,sockets=1,cores=N". The device requirements gain ThreadsPerCore, carried to the broker in EVEDevice.threads_per_core. The QEMU, libvirt and Proxmox providers derive the sockets/cores/threads layout from the CPU count and that value through one shared helper, so a requirement means the same whichever provider runs the test. Proxmox VE has no threads-per-core setting; the layout reaches QEMU through the VM's args, as a second -smp that QEMU merges over the one PVE generates, key by key. Zero or one, the default, keeps the layout every provider uses today. The harness refuses a value that does not divide the device's CPU count, and reuses a device only for a test asking for the same value. Signed-off-by: Mikhail Malyshev <mike.malyshev@gmail.com>
milan-zededa
approved these changes
Nov 16, 2026
Contributor
|
It is not really worth waiting for EVE build, Eden or even evetest (it will run tests with whatever broker version is currently deployed, it will not pick up these changes). |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7130 +/- ##
==========================================
+ Coverage 29.29% 29.77% +0.48%
==========================================
Files 550 561 +11
Lines 99471 101066 +1595
==========================================
+ Hits 29137 30090 +953
- Misses 68037 68723 +686
+ Partials 2297 2253 -44 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
rene
approved these changes
Nov 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
evetest tests can ask for a device whose CPUs are SMT sibling threads:
RequireEdgeDevice.ThreadsPerCore, carried to the broker inEVEDevice.threads_per_core(field 9). Today every provider gives the EVE VM one thread per core: QEMU expands a bare-smp Nwiththreads=1, the libvirt domain's topology is fixed at one thread per core, and Proxmox VE starts QEMU with-smp N,sockets=1,cores=N.The QEMU, libvirt and Proxmox providers derive the sockets/cores/threads layout from the CPU count and the requested threads per core through one helper (
CPUTopology), so a requirement means the same whichever provider runs the test. Proxmox VE has no threads-per-core setting, so the layout reaches QEMU through the VM'sargsas a second-smp, which QEMU merges over the one PVE generates, key by key.Zero or one, the default, keeps the layout every provider uses today. The harness refuses a value that does not divide the device's CPU count, and reuses a device only for a test asking for the same value.
This is split out of #6335 (SMT-aware CPU placement), whose CPU placement tests ask for
ThreadsPerCore: 2. A broker without this change ignores the field and boots single-thread cores, so those tests cannot pass on CI until the broker runs this code. Merging this first lets the broker be updated ahead of #6335.How to test and validate this PR
cd evetest && go test ./broker/provider/ -run 'TestCPUTopology|TestSMPArg|TestBuildVMOptionsThreadsPerCore'. They cover the layout for 0, 1, 2 and 4 threads per core and for counts that do not divide, and check that the Proxmox VM'sargscarry-smp 8,sockets=1,cores=4,threads=2for an 8-CPU SMT device and no-smpwithout SMT.ThreadsPerCore: 2on 8 CPUs and fail unless the node's sysfs shows 4 cores with 2 siblings each. All eight passed with the QEMU provider (embedded broker). QEMU merging a second-smpover PVE's was checked with QEMU 8.2 directly; the tests have not yet run on a Proxmox broker with this change, nor on libvirt.Changelog notes
No user-facing changes (test framework only).
PR Backports
Checklist
I've provided a proper description
I've added the proper documentation
I've tested my PR on amd64 device
I've tested my PR on arm64 device
I've written the test verification instructions
I've set the proper labels to this PR
I've checked the boxes above, or I've provided a good reason why I didn't check them: the new requirement and proto field are documented where they are declared; arm64 not tested (the change is the same on every architecture).