Skip to content

RFC KVM: selftests: Improvements on dirty-ring

Leonardo Bras kvm linux-kselftest lkml sashiko-reviews 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 RFC Latest3 patches 1 replyIn review
  2. v3 RFC3 patches 1 replySuperseded
  3. v2 RFC3 patches 1 replySuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v1 RFC3 patches2 repliesSuperseded

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3KVM: selftests: memstress: Add option to enable dirty-ring on VM creationtools/testing/selftests/kvm/access_tracking_perf_test.c tools/testing/selftests/kvm/demand_paging_test.c tools/testing/selftests/kvm/dirty_log_perf_test.c +4 more+37 -100 replies
2/3KVM: selftests: Check dirty-ring size before enablingtools/testing/selftests/kvm/lib/kvm_util.c+17 -40 replies
3/3KVM: selftests: dirty_log_perf_test: Add dirty-ring supporttools/testing/selftests/kvm/dirty_log_perf_test.c+114 -141 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v4 yet.

Read the v4 thread

Cover letter [RFC PATCH v4 0/3] KVM: selftests: Improvements on dirty-ring

Add support to dirty-ring on dirty_log_perf_test, so we can measure performance differences when we change / improve the mechanism.

One major conflict I had in this set is that dirty-ring needs to be enabled after the VM was created, but before any cpu is created, so for that, I made a few changes on memstress so it can actually take dirty-ring size as a parameter for VM creation. (Patch #1) I honestly don't think it's pretty, but I could not think on a better way of doing this without messing too much in the code.

Also added some checks in dirty-ring enable, so an error message on ring size is more informative.

Please provide feedback :)

Thanks!
Leo

Changes since RFCv3:
- Using acquire/release barriers to make sure there is no reorder between incrementing iteration and summing the time spent on cleaning.
- Improved ring-size checks, although not perfect due to reserved entries affecting minimum size.
- Do not allocate bitmaps for dirty-ring tests, as they are unused.
- Improve help text
- Make sure ret==0 before going back to vcpu_run in dirty-ring case

Changes since RFCv2:
- Added mutex to make sure only a single vcpu is collecting/cleaning at a time. This gets us the ability to test return values, and not account for kvm.slot_lock waiting time.
- Stuff reported by Sashiko
- Return value always positive, so assert was pointless
- Concurrency inflating the time for dirty-ring cleaning

Changes since RFCv1:
- Stuff reported by Sashiko
- Fixed elements / byte size wrapping issue
- Removed element count due to concurrency
- Testing exit_reason instead of ioctl return value
- Some nits

Leonardo Bras (3):
KVM: selftests: memstress: Add option to enable dirty-ring on VM
creation
KVM: selftests: Check dirty-ring size before enabling
KVM: selftests: dirty_log_perf_test: Add dirty-ring support

 .../testing/selftests/kvm/include/memstress.h |   3 +-
 .../selftests/kvm/access_tracking_perf_test.c |   2 +-
 .../selftests/kvm/demand_paging_test.c        |   2 +-
 .../selftests/kvm/dirty_log_perf_test.c       | 128 ++++++++++++++++--
 tools/testing/selftests/kvm/lib/kvm_util.c    |  21 ++-
 tools/testing/selftests/kvm/lib/memstress.c   |  34 ++++-
 .../kvm/memslot_modification_stress_test.c    |   2 +-
 .../kvm/x86/dirty_log_page_splitting_test.c   |   2 +-
 8 files changed, 167 insertions(+), 27 deletions(-)

base-commit: f5098b6bae761e346ebcd9da7f95622c04733cff

Signature · 1 line
2.55.0