Skip to content

KVM: selftests: Avoid mmap_sem contention during memory population

David Matlack kvm 1 version Applied

Status from this message: Queued, thanks.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 9 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/4KVM: selftests: Start at iteration 0 instead of -1tools/testing/selftests/kvm/access_tracking_perf_test.c+3 -50 replies
2/4KVM: selftests: Move vCPU thread creation and joining to common helperstools/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 +3 more+67 -902 replies
3/4KVM: selftests: Wait for all vCPU to be created before entering guest modetools/testing/selftests/kvm/lib/perf_test_util.c+26 -04 replies
4/4KVM: selftests: Use perf_test_destroy_vm in memslot_modification_stress_testtools/testing/selftests/kvm/memslot_modification_stress_test.c+1 -21 reply

Reviews trailers per patch

2 of 4 patches have a Reviewed-by or Acked-by.

PatchBen Gardon
1/4
2/4R-b
3/4
4/4R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/4] KVM: selftests: Avoid mmap_sem contention during memory population

This series fixes a performance issue in the KVM selftests, specifically those that use perf_test_util. These tests create vCPU threads which immediately enter guest mode and start faulting in memory. Creating vCPU threads while faulting in memory is a recipe for generating a lot of contention on the mmap_sem, as thread creation requires acquiring the mmap_sem in write mode.

This series fixes this issue by ensuring that all vCPUs threads are created before entering guest mode. As part of fixing this issue I consolidated the code to create and join vCPU threads across all users of perf_test_util.

The last commit is an unrelated perf_test_util cleanup.

Note: This series applies on top of
https://lore.kernel.org/kvm/[email protected]/,
although the dependency on the series is just cosmetic.

David Matlack (4):
KVM: selftests: Start at iteration 0 instead of -1
KVM: selftests: Move vCPU thread creation and joining to common
helpers
KVM: selftests: Wait for all vCPU to be created before entering guest
mode
KVM: selftests: Use perf_test_destroy_vm in
memslot_modification_stress_test

 .../selftests/kvm/access_tracking_perf_test.c | 46 +++---------
 .../selftests/kvm/demand_paging_test.c        | 25 +------
 .../selftests/kvm/dirty_log_perf_test.c       | 19 ++---
 .../selftests/kvm/include/perf_test_util.h    |  5 ++
 .../selftests/kvm/lib/perf_test_util.c        | 72 +++++++++++++++++++
 .../kvm/memslot_modification_stress_test.c    | 25 ++-----
 6 files changed, 96 insertions(+), 96 deletions(-)
Signature · 1 line
2.34.0.rc1.387.gb447b232ab-goog