kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/3] Randomize memory access of dirty_log_perf_test
@ 2022-09-01 19:52 Colton Lewis
  2022-09-01 19:52 ` [PATCH v3 1/3] KVM: selftests: Implement random number generation for guest code Colton Lewis
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Colton Lewis @ 2022-09-01 19:52 UTC (permalink / raw)
  To: kvm; +Cc: pbonzini, maz, dmatlack, seanjc, oupton, ricarkol, Colton Lewis

This patch adds the ability to randomize parts of dirty_log_perf_test,
specifically the order pages are accessed and whether pages are read
or written.

This version scraps the use of arrays to remove the memory management
concerns and implementes a well-known random number generator, the
Park-Miller Linear Congruential Generator, for the guest code to use
directly. From comments on v2, several others agree this is the right
approach. I came to the same conclusion and was already working on it.

Though I had this idea and ignored it previously over concerns about
introducing mysterious code, doing some research convinced me
Park-Miller is both extremely easy to understand and high enough
quality for this purpose. I also believe this approach better
preserves the integrity of the test as a couple math instructions are
definitely faster than fetching from memory.

Compiled and run on x86_64 and arm64 to test the new flags.
Based on v5.19 as tests on kvm/queue do not build

Colton Lewis (3):
  KVM: selftests: Implement random number generation for guest code.
  KVM: selftests: Randomize which pages are written vs read.
  KVM: selftests: Randomize page access order.

 .../selftests/kvm/access_tracking_perf_test.c |  2 +-
 .../selftests/kvm/dirty_log_perf_test.c       | 48 +++++++++++++------
 .../selftests/kvm/include/perf_test_util.h    |  8 +++-
 .../selftests/kvm/lib/perf_test_util.c        | 40 +++++++++++++---
 4 files changed, 74 insertions(+), 24 deletions(-)

--
2.37.2.672.g94769d06f0-goog

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2022-09-08 18:18 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-01 19:52 [PATCH v3 0/3] Randomize memory access of dirty_log_perf_test Colton Lewis
2022-09-01 19:52 ` [PATCH v3 1/3] KVM: selftests: Implement random number generation for guest code Colton Lewis
2022-09-06 19:01   ` Ricardo Koller
2022-09-06 23:53     ` Colton Lewis
2022-09-06 19:04   ` Ricardo Koller
2022-09-01 19:52 ` [PATCH v3 2/3] KVM: selftests: Randomize which pages are written vs read Colton Lewis
2022-09-08 16:40   ` Ricardo Koller
2022-09-08 18:18     ` Colton Lewis
2022-09-01 19:52 ` [PATCH v3 3/3] KVM: selftests: Randomize page access order Colton Lewis
2022-09-06 19:08   ` Ricardo Koller
2022-09-06 23:47     ` Colton Lewis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).