diff options
author | Sean Christopherson <seanjc@google.com> | 2024-10-10 19:10:49 -0700 |
---|---|---|
committer | Sean Christopherson <seanjc@google.com> | 2024-10-30 15:25:40 -0700 |
commit | 2ebbe0308c29287914eeabe6ed83a6e21f9962bc (patch) | |
tree | afdbaf2f641a0ae230a1fee6b0b22ef327f02833 /virt/kvm/Kconfig | |
parent | 85649117511ddf9971e4759fe8ac9fbb69ad5064 (diff) | |
download | linux-2ebbe0308c29287914eeabe6ed83a6e21f9962bc.tar.gz linux-2ebbe0308c29287914eeabe6ed83a6e21f9962bc.tar.bz2 linux-2ebbe0308c29287914eeabe6ed83a6e21f9962bc.zip |
KVM: Allow arch code to elide TLB flushes when aging a young page
Add a Kconfig to allow architectures to opt-out of a TLB flush when a
young page is aged, as invalidating TLB entries is not functionally
required on most KVM-supported architectures. Stale TLB entries can
result in false negatives and theoretically lead to suboptimal reclaim,
but in practice all observations have been that the performance gained by
skipping TLB flushes outweighs any performance lost by reclaiming hot
pages.
E.g. the primary MMUs for x86 RISC-V, s390, and PPC Book3S elide the TLB
flush for ptep_clear_flush_young(), and arm64's MMU skips the trailing DSB
that's required for ordering (presumably because there are optimizations
related to eliding other TLB flushes when doing make-before-break).
Link: https://lore.kernel.org/r/20241011021051.1557902-18-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
Diffstat (limited to 'virt/kvm/Kconfig')
-rw-r--r-- | virt/kvm/Kconfig | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/virt/kvm/Kconfig b/virt/kvm/Kconfig index fd6a3010afa8..54e959e7d68f 100644 --- a/virt/kvm/Kconfig +++ b/virt/kvm/Kconfig @@ -100,6 +100,10 @@ config KVM_GENERIC_MMU_NOTIFIER select MMU_NOTIFIER bool +config KVM_ELIDE_TLB_FLUSH_IF_YOUNG + depends on KVM_GENERIC_MMU_NOTIFIER + bool + config KVM_GENERIC_MEMORY_ATTRIBUTES depends on KVM_GENERIC_MMU_NOTIFIER bool |