[PATCH v2] arm64: Avoid repeated AA64MMFR1_EL1 register read on pagefault path

Catalin Marinas catalin.marinas at arm.com
Fri Jan 20 08:59:19 PST 2023


On Mon, 09 Jan 2023 12:19:55 -0300, Gabriel Krisman Bertazi wrote:
> Accessing AA64MMFR1_EL1 is expensive in KVM guests, since it is emulated
> in the hypervisor.  In fact, ARM documentation mentions some feature
> registers are not supposed to be accessed frequently by the OS, and
> therefore should be emulated for guests [1].
> 
> Commit 0388f9c74330 ("arm64: mm: Implement
> arch_wants_old_prefaulted_pte()") introduced a read of this register in
> the page fault path.  But, even when the feature of setting faultaround
> pages with the old flag is disabled for a given cpu, we are still paying
> the cost of checking the register on every pagefault. This results in an
> explosion of vmexit events in KVM guests, which directly impacts the
> performance of virtualized workloads.  For instance, running kernbench
> yields a 15% increase in system time solely due to the increased vmexit
> cycles.
> 
> [...]

Applied to arm64 (for-next/misc), thanks!

[1/1] arm64: Avoid repeated AA64MMFR1_EL1 register read on pagefault path
      https://git.kernel.org/arm64/c/a89c6bcdac22

-- 
Catalin




More information about the linux-arm-kernel mailing list