From: Sean Christopherson <seanjc@google.com>
To: Sean Christopherson <seanjc@google.com>,
Paolo Bonzini <pbonzini@redhat.com>
Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v2 0/2] KVM: selftests: Reduce PMC test runtime by ~17x
Date: Tue, 4 Aug 2026 13:40:45 -0700 [thread overview]
Message-ID: <20260804204048.3401810-1-seanjc@google.com> (raw)
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/20260804173437.3339269-1-seanjc@google.com
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
next reply other threads:[~2026-08-04 20:40 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-04 20:40 Sean Christopherson [this message]
2026-08-04 20:40 ` [PATCH v2 1/2] KVM: selftests: Test one random GP counter in PMU arch events testcase Sean Christopherson
2026-08-04 20:40 ` [PATCH v2 2/2] KVM: selftests: Create one VM with many vCPUs for each major PMU counters test Sean Christopherson
2026-08-04 20:53 ` sashiko-bot
2026-08-04 20:55 ` Sean Christopherson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260804204048.3401810-1-seanjc@google.com \
--to=seanjc@google.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox