[PATCH v2 0/3] RISC-V: KVM: Huge page recovery during disable-dirty-log
wang.yechao255 at zte.com.cn
wang.yechao255 at zte.com.cn
Wed Apr 29 02:30:02 PDT 2026
From: Wang Yechao <wang.yechao255 at zte.com.cn>
When dirty logging is enabled, the gstage mappings are split into
4K pages to track dirty pages. If the migration fails or is canceled,
in order to keep the VM's performance consistent with that before
dirty logging was enabled, we need to recover the gstage huge page mappings
when dirty logging is disabled.
With this series, dirty_log_perf_test shows a decrease in the number of
vCPU faults:
$ perf stat -e kvm:kvm_page_fault \
/dirty_log_perf_test -s anonymous_hugetlb_1gb -v 1 -e -b 1G
Before: 524,819 kvm:kvm_page_fault
After : 263,211 kvm:kvm_page_fault
Changes in v2:
- Rebased on Linux v7.1-rc1.
- Skip recovering huge pte if the first child pte is not leaf.
- Link to v1:
https://lore.kernel.org/linux-riscv/20260407171052241tmZDFGusMP_wlEsBVVtJo@zte.com.cn/T/#t
Wang Yechao (3):
RISC-V: KVM: Refactor kvm_arch_commit_memory_region()
RISC-V: KVM: add tracepoints for guest page faults
RISC-V: KVM: Recover gstage huge page mappings during
disable-dirty-log
arch/riscv/include/asm/kvm_gstage.h | 4 ++
arch/riscv/kvm/gstage.c | 42 ++++++++++++++++++++
arch/riscv/kvm/mmu.c | 59 ++++++++++++++++++++++++++++-
arch/riscv/kvm/trace.h | 25 ++++++++++++
arch/riscv/kvm/vcpu_exit.c | 3 ++
5 files changed, 132 insertions(+), 1 deletion(-)
--
2.43.5
More information about the linux-riscv
mailing list