public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [Patch v3 0/9] NUMA aware page table's pages allocation
@ 2022-12-22  2:34 Vipin Sharma
  2022-12-22  2:34 ` [Patch v3 1/9] KVM: x86/mmu: Repurpose KVM MMU shrinker to purge shadow page caches Vipin Sharma
                   ` (8 more replies)
  0 siblings, 9 replies; 46+ messages in thread
From: Vipin Sharma @ 2022-12-22  2:34 UTC (permalink / raw)
  To: seanjc, pbonzini, bgardon, dmatlack; +Cc: kvm, linux-kernel, Vipin Sharma

Hi,

This series has expanded from v2 based on the feedbacks. Main items happening in
this series are:

1. KVM MMU shrinker now shrinks KVM caches.
   MMU shrinker will free shadow page caches and split caches whenever shrinker
   is invoked.

2. Page table's pages are allocated on NUMA node during fault and split.
   Pages of page tables will be allocated based on the underlying physical page
   a page table entry is point to. Got performance improvement up to 150% in
   416 vCPUs VM during live migrations.

3. Cache size is reduced from 40 to 5.
   40 is current cache size for KVM memory caches. Reduced them to 5. I didn't
   see any negative performance impact while running perf and dirty_log_perf_test.
   I also saw lesser number of calls to get a free page.

Thanks
Vipin

v3:
- Split patches into smaller ones.
- Repurposed KVM MMU shrinker to free cache pages instead of oldest page table
  pages
- Reduced cache size from 40 to 5
- Removed __weak function and initializing node value in all architectures.
- Some name changes.

v2: https://lore.kernel.org/lkml/20221201195718.1409782-1-vipinsh@google.com/
- All page table pages will be allocated on underlying physical page's
  NUMA node.
- Introduced module parameter, numa_aware_pagetable, to disable this
  feature.
- Using kvm_pfn_to_refcounted_page to get page from a pfn.

v1: https://lore.kernel.org/all/20220801151928.270380-1-vipinsh@google.com/

Vipin Sharma (9):
  KVM: x86/mmu: Repurpose KVM MMU shrinker to purge shadow page caches
  KVM: x86/mmu: Remove zapped_obsolete_pages from struct kvm_arch{}
  KVM: x86/mmu: Shrink split_shadow_page_cache via KVM MMU shrinker
  KVM: Add module param to make page tables NUMA aware
  KVM: x86/mmu: Allocate TDP page table's page on correct NUMA node on
    split
  KVM: Provide NUMA node support to kvm_mmu_memory_cache{}
  KVM: x86/mmu: Allocate page table's pages on NUMA node of the
    underlying pages
  KVM: x86/mmu: Make split_shadow_page_cache NUMA aware
  KVM: x86/mmu: Reduce default cache size in KVM from 40 to
    PT64_ROOT_MAX_LEVEL

 arch/arm64/kvm/arm.c             |   2 +-
 arch/arm64/kvm/mmu.c             |   4 +-
 arch/mips/kvm/mips.c             |   2 +
 arch/riscv/kvm/mmu.c             |   2 +-
 arch/riscv/kvm/vcpu.c            |   2 +-
 arch/x86/include/asm/kvm_host.h  |  15 +-
 arch/x86/include/asm/kvm_types.h |   2 +-
 arch/x86/kvm/mmu/mmu.c           | 282 +++++++++++++++++++------------
 arch/x86/kvm/mmu/mmu_internal.h  |   2 +
 arch/x86/kvm/mmu/paging_tmpl.h   |   4 +-
 arch/x86/kvm/mmu/tdp_mmu.c       |  24 ++-
 include/linux/kvm_host.h         |  27 +++
 include/linux/kvm_types.h        |   2 +
 virt/kvm/kvm_main.c              |  35 +++-
 14 files changed, 277 insertions(+), 128 deletions(-)

-- 
2.39.0.314.g84b9a713c41-goog


^ permalink raw reply	[flat|nested] 46+ messages in thread

end of thread, other threads:[~2023-01-18 17:45 UTC | newest]

Thread overview: 46+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-22  2:34 [Patch v3 0/9] NUMA aware page table's pages allocation Vipin Sharma
2022-12-22  2:34 ` [Patch v3 1/9] KVM: x86/mmu: Repurpose KVM MMU shrinker to purge shadow page caches Vipin Sharma
2022-12-27 18:37   ` Ben Gardon
2022-12-28 22:07     ` Vipin Sharma
2022-12-29 21:15       ` David Matlack
2023-01-03 17:38         ` Vipin Sharma
2022-12-29 21:54   ` David Matlack
2023-01-03 18:01     ` Vipin Sharma
2023-01-04  0:25       ` Vipin Sharma
2023-01-18 17:43         ` Sean Christopherson
2023-01-03 19:32   ` Mingwei Zhang
2023-01-04  1:00     ` Vipin Sharma
2023-01-04  6:29       ` Mingwei Zhang
2023-01-04  6:57         ` Mingwei Zhang
2023-01-18 17:36         ` Sean Christopherson
2022-12-22  2:34 ` [Patch v3 2/9] KVM: x86/mmu: Remove zapped_obsolete_pages from struct kvm_arch{} Vipin Sharma
2022-12-29 21:59   ` David Matlack
2022-12-22  2:34 ` [Patch v3 3/9] KVM: x86/mmu: Shrink split_shadow_page_cache via KVM MMU shrinker Vipin Sharma
2022-12-22  2:34 ` [Patch v3 4/9] KVM: Add module param to make page tables NUMA aware Vipin Sharma
2022-12-29 22:05   ` David Matlack
2022-12-22  2:34 ` [Patch v3 5/9] KVM: x86/mmu: Allocate TDP page table's page on correct NUMA node on split Vipin Sharma
2022-12-27 19:02   ` Ben Gardon
2022-12-28 22:07     ` Vipin Sharma
2022-12-29 22:30   ` David Matlack
2023-01-03 18:26     ` Vipin Sharma
2022-12-22  2:34 ` [Patch v3 6/9] KVM: Provide NUMA node support to kvm_mmu_memory_cache{} Vipin Sharma
2022-12-27 19:09   ` Ben Gardon
2022-12-28 22:07     ` Vipin Sharma
2022-12-29 18:22       ` Ben Gardon
2023-01-03 17:36         ` Vipin Sharma
2022-12-29 23:08   ` David Matlack
2022-12-29 23:11     ` David Matlack
2023-01-03 18:45       ` Vipin Sharma
2023-01-03 18:55         ` David Matlack
2022-12-22  2:34 ` [Patch v3 7/9] KVM: x86/mmu: Allocate page table's pages on NUMA node of the underlying pages Vipin Sharma
2022-12-27 19:34   ` Ben Gardon
2022-12-28 22:08     ` Vipin Sharma
2022-12-29 18:20       ` Ben Gardon
2022-12-22  2:34 ` [Patch v3 8/9] KVM: x86/mmu: Make split_shadow_page_cache NUMA aware Vipin Sharma
2022-12-27 19:42   ` Ben Gardon
2022-12-28 22:08     ` Vipin Sharma
2022-12-29 23:18   ` David Matlack
2023-01-03 18:49     ` Vipin Sharma
2022-12-22  2:34 ` [Patch v3 9/9] KVM: x86/mmu: Reduce default cache size in KVM from 40 to PT64_ROOT_MAX_LEVEL Vipin Sharma
2022-12-27 19:52   ` Ben Gardon
2022-12-28 22:08     ` Vipin Sharma

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox