Skip to content

RFC rework KVM mmu_shrink() code

Dave Hansen kvm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest9 patches 21 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9abstract kvm x86 mmu->n_free_mmu_pagesarch/x86/kvm/mmu.c arch/x86/kvm/mmu.h+9 -41 reply
2/9rename x86 kvm->arch.n_alloc_mmu_pagesarch/x86/include/asm/kvm_host.h arch/x86/kvm/mmu.c arch/x86/kvm/x86.c+6 -60 replies
3/9replace x86 kvm n_free_mmu_pages with n_used_mmu_pagesarch/x86/include/asm/kvm_host.h arch/x86/kvm/mmu.c arch/x86/kvm/mmu.h+13 -212 replies
4/9create aggregate kvm_total_used_mmu_pages valuearch/x86/kvm/mmu.c+23 -105 replies
5/9break out some mmu_skrink() codearch/x86/kvm/mmu.c+25 -100 replies
6/9remove kvm_freed variablearch/x86/kvm/mmu.c+5 -100 replies
7/9make kvm_get_kvm() more robustinclude/linux/kvm_host.h virt/kvm/kvm_main.c+30 -40 replies
8/9reduce kvm_lock hold times in mmu_skrink()arch/x86/kvm/mmu.c kernel/profile.c+40 -101 reply
9/9make kvm mmu shrinker more aggressivearch/x86/kvm/mmu.c+6 -59 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC][PATCH 0/9] rework KVM mmu_shrink() code

This is a big RFC for the moment. These need a bunch more runtime testing.

--

We've seen contention in the mmu_shrink() function. This patch set reworks it to hopefully be more scalable to large numbers of CPUs, as well as large numbers of running VMs.

The patches are ordered with increasing invasiveness.

These seem to boot and run fine. I'm running about 40 VMs at once, while doing "echo 3 > /proc/sys/vm/drop_caches", and killing/restarting VMs constantly.

Seems to be relatively stable, and seems to keep the numbers of kvm_mmu_page_header objects down.