[PATCH v2 0/2] KVM: selftests: Reduce PMC test runtime by ~17x
Sean Christopherson <[email protected]> Tue, 4 Aug 2026 13:40:45 -0700
| Newsgroups | org.kernel.vger.kvm,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
Reduce the runtime of the PMU counters test on an Emerald Rapids system from ~85 seconds to ~5 seconds by (a) testing one random GP counter in the arch events test instead of every GP counter and (b) creating one large VM per "major" test and then running each subtest with a different vCPUs, versus creating a new single-vCPU VM for every subtest. AFAICT, there aren't any bugs anywhere in the VM creation flow, there's just a lot of work to be done. And VM creation isn't even that slow, but creating something like 1000+ VMs for the test adds up. v2: - Allocate an array of vCPU pointers, not an array of vCPUs. [Sashiko] - Fix a copy+paste goof that caused the GP counters test to always run with the maximum number of GP counters. [Sashiko] v1: https://lore.kernel.org/all/[email protected] Sean Christopherson (2): KVM: selftests: Test one random GP counter in PMU arch events testcase KVM: selftests: Create one VM with many vCPUs for each major PMU counters test .../testing/selftests/kvm/include/test_util.h | 4 +- tools/testing/selftests/kvm/lib/test_util.c | 22 +- .../selftests/kvm/x86/pmu_counters_test.c | 230 ++++++++++-------- 3 files changed, 150 insertions(+), 106 deletions(-) base-commit: 2dfab80a305700a45bd947350dae253ba4e30c41 -- 2.55.0.571.g244d577d93-goog