[PATCH v3 0/2] KVM: arm64: Limit stage2_apply_range() batch size to largest block

Oliver Upton oliver.upton at linux.dev
Fri Oct 7 16:41:49 PDT 2022


Continuing with MMU patches to post, a small series fixing some soft
lockups caused by stage2_apply_range(). Depending on the paging setup,
we could walk a very large amount of memory before dropping the lock and
rescheduling.

Applies to kvmarm-6.1. Tested with KVM selftests and kvm-unit-tests with
all supported page sizes (4K, 16K, 64K). Additionally, I no longer saw
soft lockups with the following:

  ./dirty_log_perf_test -m -2 -s anonymous_thp -b 4G -v 48

v2: https://lore.kernel.org/kvmarm/20220926222146.661633-1-oliver.upton@linux.dev/

v2 -> v3:
 - Just use the largest block size as the batch size (Marc)

Oliver Upton (2):
  KVM: arm64: Work out supported block level at compile time
  KVM: arm64: Limit stage2_apply_range() batch size to largest block

 arch/arm64/include/asm/kvm_pgtable.h    | 18 +++++++++++++-----
 arch/arm64/include/asm/stage2_pgtable.h | 20 --------------------
 arch/arm64/kvm/mmu.c                    |  9 ++++++++-
 3 files changed, 21 insertions(+), 26 deletions(-)


base-commit: b302ca52ba8235ff0e18c0fa1fa92b51784aef6a
-- 
2.38.0.rc1.362.ged0d419d3c-goog




More information about the linux-arm-kernel mailing list