On Wed, 26 Apr 2023 17:23:18 +0000, Ricardo Koller wrote: > Eager Page Splitting improves the performance of dirty-logging (used > in live migrations) when guest memory is backed by huge-pages. It's > an optimization used in Google Cloud since 2016 on x86, and for the > last couple of months on ARM. > > Background and motivation > ========================= > Dirty logging is typically used for live-migration iterative copying. > KVM implements dirty-logging at the PAGE_SIZE granularity (will refer > to 4K pages from now on). It does it by faulting on write-protected > 4K pages. Therefore, enabling dirty-logging on a huge-page requires > breaking it into 4K pages in the first place. KVM does this breaking > on fault, and because it's in the critical path it only maps the 4K > page that faulted; every other 4K page is left unmapped. This is not > great for performance on ARM for a couple of reasons: > > [...] Picking these patches up early, as I'd like to get some mileage on the patches well in advance of 6.5. Applied to kvmarm/next, thanks! [01/12] KVM: arm64: Rename free_removed to free_unlinked https://git.kernel.org/kvmarm/kvmarm/c/c14d08c5adb2 [02/12] KVM: arm64: Add KVM_PGTABLE_WALK flags for skipping CMOs and BBM TLBIs https://git.kernel.org/kvmarm/kvmarm/c/02f10845f435 [03/12] KVM: arm64: Add helper for creating unlinked stage2 subtrees https://git.kernel.org/kvmarm/kvmarm/c/e7c05540c694 [04/12] KVM: arm64: Export kvm_are_all_memslots_empty() https://git.kernel.org/kvmarm/kvmarm/c/26f457142d7e [05/12] KVM: arm64: Add KVM_CAP_ARM_EAGER_SPLIT_CHUNK_SIZE https://git.kernel.org/kvmarm/kvmarm/c/2f440b72e852 [06/12] KVM: arm64: Add kvm_pgtable_stage2_split() https://git.kernel.org/kvmarm/kvmarm/c/8f5a3eb7513f [07/12] KVM: arm64: Refactor kvm_arch_commit_memory_region() https://git.kernel.org/kvmarm/kvmarm/c/6bd92b9d8b02 [08/12] KVM: arm64: Add kvm_uninit_stage2_mmu() https://git.kernel.org/kvmarm/kvmarm/c/ce2b60223800 [09/12] KVM: arm64: Split huge pages when dirty logging is enabled https://git.kernel.org/kvmarm/kvmarm/c/e7bf7a490c68 [10/12] KVM: arm64: Open-code kvm_mmu_write_protect_pt_masked() https://git.kernel.org/kvmarm/kvmarm/c/3005f6f29447 [11/12] KVM: arm64: Split huge pages during KVM_CLEAR_DIRTY_LOG https://git.kernel.org/kvmarm/kvmarm/c/6acf51666d03 [12/12] KVM: arm64: Use local TLBI on permission relaxation https://git.kernel.org/kvmarm/kvmarm/c/a12ab1378a88 -- Best, Oliver