mbox series

[v3,0/1] Remove KVM MMU shrinker

Message ID 20241101201437.1604321-1-vipinsh@google.com (mailing list archive)
Headers show
Series Remove KVM MMU shrinker | expand

Message

Vipin Sharma Nov. 1, 2024, 8:14 p.m. UTC
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@google.com/

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

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

v1: https://lore.kernel.org/kvm/20240913214316.1945951-1-vipinsh@google.com/
- 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@google.com/

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

Comments

Sean Christopherson Nov. 5, 2024, 5:56 a.m. UTC | #1
On Fri, 01 Nov 2024 13:14:36 -0700, Vipin Sharma wrote:
> 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.
> 
> [...]

Applied to kvm-x86 mmu, with the massaging and splitting.  Definitely feel free
to propose changes/object.  I wanted to get this queued asap to get coverage in
-next, but I don't anticipate any more MMU commits, i.e. I can fix these up
without too much fuss.  Thanks!

[1/2] KVM: x86/mmu: Remove KVM's MMU shrinker
      https://github.com/kvm-x86/linux/commit/fe140e611d34
[2/2] KVM: x86/mmu: Drop per-VM zapped_obsolete_pages list
      https://github.com/kvm-x86/linux/commit/4cf20d42543c

--
https://github.com/kvm-x86/linux/tree/next
Vipin Sharma Nov. 5, 2024, 5:24 p.m. UTC | #2
On Mon, Nov 4, 2024 at 10:01 PM Sean Christopherson <seanjc@google.com> wrote:
>
> On Fri, 01 Nov 2024 13:14:36 -0700, Vipin Sharma wrote:
> > 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.
> >
> > [...]
>
> Applied to kvm-x86 mmu, with the massaging and splitting.  Definitely feel free
> to propose changes/object.  I wanted to get this queued asap to get coverage in
> -next, but I don't anticipate any more MMU commits, i.e. I can fix these up
> without too much fuss.  Thanks!
>
> [1/2] KVM: x86/mmu: Remove KVM's MMU shrinker
>       https://github.com/kvm-x86/linux/commit/fe140e611d34
> [2/2] KVM: x86/mmu: Drop per-VM zapped_obsolete_pages list
>       https://github.com/kvm-x86/linux/commit/4cf20d42543c
>
> --
> https://github.com/kvm-x86/linux/tree/next

Thanks for doing it. Looks good to me.