[PATCH v3 0/1] Remove KVM MMU shrinker

From: Vipin Sharma
Date: Fri Nov 01 2024 - 16:14:52 EST


Based on the feedback from v2, this patch is now completely removing KVM MMU
shrinker whereas earlier versions were repurposing KVM MMU shrinker
behavior to shrink vCPU caches. Now, there is no change to vCPU caches
behavior.

KVM MMU shrinker is not very effective in alleviating pain during memory
pressure. It frees up the pages actively being used which results in VM
degradation. VM will take fault and bring them again in page tables.
More discussions happened at [1]. Overall, consensus was to reprupose it
into the code which frees pages from KVM MMU page caches.

In the previous version of this patch series, it was decided to just
remove the shrinker and revisit feature to reduce vCPU cache size if
someone has a need.

[1] https://lore.kernel.org/lkml/Y45dldZnI6OIf+a5@xxxxxxxxxx/

v3:
- Remove KVM MMU shrinker.
- No repurposing for any other use.

v2: https://lore.kernel.org/kvm/20241004195540.210396-1-vipinsh@xxxxxxxxxx/
- Add a new selftest, mmu_shrinker_test.

v1: https://lore.kernel.org/kvm/20240913214316.1945951-1-vipinsh@xxxxxxxxxx/
- No global counting of pages in cache. As this number might not remain
same between calls of mmu_shrink_count() and mmu_shrink_scan().
- Count cache pages in mmu_shrink_count(). KVM can tolerate inaccuracy
here.
- Empty mmu_shadow_page_cache and mmu_shadowed_info_cache only. Don't
empty split_shadow_page_cache.

v0: Patches 1-9 from NUMA aware page table series.
https://lore.kernel.org/kvm/20230306224127.1689967-1-vipinsh@xxxxxxxxxx/

Vipin Sharma (1):
KVM: x86/mmu: Remove KVM mmu shrinker

arch/x86/include/asm/kvm_host.h | 1 -
arch/x86/kvm/mmu/mmu.c | 111 ++------------------------------
2 files changed, 5 insertions(+), 107 deletions(-)


base-commit: a27e0515592ec9ca28e0d027f42568c47b314784
--
2.47.0.163.g1226f6d8fa-goog