Skip to content

KVM: Split huge pages mapped by the TDP MMU on fault

David Matlack kvm 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest2 patches 4 repliesIn review
  2. v22 patches 1 replySuperseded
  3. v13 patches 8 repliesSuperseded

Changes in v3 from the cover letter

- Rebased on top of latest kvm/queue.
- R-b from Mingwei.
- Add comment about sp initialization [Mingwei]

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2KVM: selftests: Introduce a selftest to measure execution performancetools/testing/selftests/kvm/.gitignore tools/testing/selftests/kvm/Makefile tools/testing/selftests/kvm/execute_perf_test.c +2 more+212 -20 replies
2/2KVM: x86/mmu: Split huge pages mapped by the TDP MMU on faultarch/x86/kvm/mmu/tdp_mmu.c+35 -384 replies

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchMingwei ZhangBen Gardon
1/2
2/2R-b R-b

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

Read the v3 thread

Cover letter [PATCH v3 0/2] KVM: Split huge pages mapped by the TDP MMU on fault

Now that the TDP MMU has a mechanism to split huge pages, it is trivial to use it in the fault path whenever a huge page needs to be replaced with a mapping at a lower level.

The main beneficiary of this change is NX HugePages, which now no longer unmaps huge pages when instructions are fetched from them. This means that the VM does not have to take faults when accessing other parts of the huge page (for whatever reason). The other beneficiary of this change is workloads that set eage_page_split=N, which can be desirable for read-heavy workloads. The performance impacts are discussed in more detail in PATCH 3.

To validate the performance impact on NX HugePages, this series introduces a new selftest that leverages perf_test_util.c to execute from a given region of memory across a variable number of vCPUS.

This new selftest is short but contains a lot of duplicate code with access_tracking_perf_test.c, and the changes to perf_test_util.c to support execution are a bit gross. I'd be fine with deferring this test to a later series, but I want to include it here to demonstrate how I tested the TDP MMU patch.

Tested: Ran all kvm-unit-tests and KVM selftests.

Cc Mingwei Zhang <[email protected]>

v3:
- Rebased on top of latest kvm/queue.
- R-b from Mingwei.
- Add comment about sp initialization [Mingwei]

v2: https://lore.kernel.org/kvm/[email protected]/
- Rebased on top of Sean's precise NX series
(https://lore.kernel.org/kvm/[email protected]/)

David Matlack (2):
KVM: selftests: Introduce a selftest to measure execution performance
KVM: x86/mmu: Split huge pages mapped by the TDP MMU on fault

 arch/x86/kvm/mmu/tdp_mmu.c                    |  73 ++++---
 tools/testing/selftests/kvm/.gitignore        |   1 +
 tools/testing/selftests/kvm/Makefile          |   1 +
 .../testing/selftests/kvm/execute_perf_test.c | 185 ++++++++++++++++++
 .../selftests/kvm/include/perf_test_util.h    |   2 +
 .../selftests/kvm/lib/perf_test_util.c        |  25 ++-
 6 files changed, 247 insertions(+), 40 deletions(-)
 create mode 100644 tools/testing/selftests/kvm/execute_perf_test.c

base-commit: d663b8a285986072428a6a145e5994bc275df994

Signature · 1 line
2.38.1.431.g37b22c650d-goog