KVM: selftests: Add an option to run vCPUs while disabling dirty logging
authorSean Christopherson <seanjc@google.com>
Fri, 15 Jul 2022 23:21:07 +0000 (23:21 +0000)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 28 Jul 2022 17:22:24 +0000 (13:22 -0400)
commitcfe12e64b0657142824819d939fcfe62f14104a1
treedf817493a9e77f4ed856e5ad934ffdda893c8dfb
parent85f44f8cc07b5f61bef30fe5343d629fd4263230
KVM: selftests: Add an option to run vCPUs while disabling dirty logging

Add a command line option to dirty_log_perf_test to run vCPUs for the
entire duration of disabling dirty logging.  By default, the test stops
running runs vCPUs before disabling dirty logging, which is faster but
less interesting as it doesn't stress KVM's handling of contention
between page faults and the zapping of collapsible SPTEs.  Enabling the
flag also lets the user verify that KVM is indeed rebuilding zapped SPTEs
as huge pages by checking KVM's pages_{1g,2m,4k} stats.  Without vCPUs to
fault in the zapped SPTEs, the stats will show that KVM is zapping pages,
but they never show whether or not KVM actually allows huge pages to be
recreated.

Note!  Enabling the flag can _significantly_ increase runtime, especially
if the thread that's disabling dirty logging doesn't have a dedicated
pCPU, e.g. if all pCPUs are used to run vCPUs.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220715232107.3775620-5-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
tools/testing/selftests/kvm/dirty_log_perf_test.c