mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v1 0/3] KVM: selftests: Add support for dirty-ring on dirty_log_perf_test
@ 2026-09-29 11:37 Leonardo Bras
  2026-09-29 11:37 ` [PATCH v1 1/3] KVM: selftests: memstress: Add option to enable dirty-ring on VM creation Leonardo Bras
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Leonardo Bras @ 2026-09-29 11:37 UTC (permalink / raw)
  To: Paolo Bonzini, Sean Christopherson, Shuah Khan, David Matlack,
	Leonardo Bras, Ackerley Tng, Marc Zyngier, Josh Hilke,
	Oliver Upton, Wu Fei, Steffen Eiden, Claudio Imbrenda
  Cc: kvm, linux-kselftest, linux-kernel

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

One big change 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 RFCv4:
- Series title 
- Rebase on v7.3-rc5
Link: https://lore.kernel.org/all/20260729161519.3778839-2-leo.bras@arm.com/

- 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
Link: https://lore.kernel.org/all/20260708152232.2568907-1-leo.bras@arm.com/

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
Link: https://lore.kernel.org/all/20260629105950.1790259-1-leo.bras@arm.com/

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
Link: https://lore.kernel.org/all/20260624171656.1737580-1-leo.bras@arm.com/

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: 72d3fcf802c45d00b300f25b848a93c3a2bd7c7e
-- 
2.55.0


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

end of thread, other threads:[~2026-10-01 21:56 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-29 11:37 [PATCH v1 0/3] KVM: selftests: Add support for dirty-ring on dirty_log_perf_test Leonardo Bras
2026-09-29 11:37 ` [PATCH v1 1/3] KVM: selftests: memstress: Add option to enable dirty-ring on VM creation Leonardo Bras
2026-09-30 18:21   ` Sean Christopherson
2026-10-01 14:40     ` Leonardo Bras
2026-09-29 11:37 ` [PATCH v1 2/3] KVM: selftests: Check dirty-ring size before enabling Leonardo Bras
2026-09-30 20:31   ` Sean Christopherson
2026-10-01 14:46     ` Leonardo Bras
2026-10-01 17:02       ` Leonardo Bras
2026-10-01 21:56         ` Sean Christopherson
2026-09-29 11:37 ` [PATCH v1 3/3] KVM: selftests: dirty_log_perf_test: Add dirty-ring support Leonardo Bras

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®