kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Patch v4 00/18] NUMA aware page table allocation
@ 2023-03-06 22:41 Vipin Sharma
  2023-03-06 22:41 ` [Patch v4 01/18] KVM: x86/mmu: Change KVM mmu shrinker to no-op Vipin Sharma
                   ` (18 more replies)
  0 siblings, 19 replies; 65+ messages in thread
From: Vipin Sharma @ 2023-03-06 22:41 UTC (permalink / raw)
  To: seanjc, pbonzini, bgardon, dmatlack
  Cc: jmattson, mizhang, kvm, linux-kernel, Vipin Sharma

Hi,

This series build up based on the feedback on v3.

Biggest change in features is to enable NUMA aware page table per VM
basis instead of using a module parameter for all VMs on a host. This
was decided based on an internal discussion to avoid forcing all VMs to
be NUMA aware on a host. We need to collect more data to see how much
performance degradation a VM can get in negative testing, where vCPUs in
VM are always accessing remote NUMA nodes memory instead of staying
local compared to a VM which is not NUMA aware.

There are other changes which are mentioned in the change log below for
v4.

Thanks
Vipin

v4:
- Removed module parameter for enabling NUMA aware page table.
- Added new capability KVM_CAP_NUMA_AWARE_PAGE_TABLE to enable this
  feature per VM.
- Added documentation for the new capability.
- Holding mutex just before the top up and releasing it after the
  fault/split is addressed. Previous version were using spinlocks two
  times, first time for topup and second time fetching the page from
  cache.
- Using the existing slots_lock for split_shadow_page_cache operations.
- KVM MMU shrinker will also shrink mm_shadow_info_cache besides
  split_shadow_page_cache and mmu_shadow_page_cache.
- Reduced cache default size to 4.
- Split patches into smaller ones.

v3: https://lore.kernel.org/lkml/20221222023457.1764-1-vipinsh@google.com/
- 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 (18):
  KVM: x86/mmu: Change KVM mmu shrinker to no-op
  KVM: x86/mmu: Remove zapped_obsolete_pages from struct kvm_arch{}
  KVM: x86/mmu: Track count of pages in KVM MMU page caches globally
  KVM: x86/mmu: Shrink shadow page caches via MMU shrinker
  KVM: x86/mmu: Add split_shadow_page_cache pages to global count of MMU
    cache pages
  KVM: x86/mmu: Shrink split_shadow_page_cache via MMU shrinker
  KVM: x86/mmu: Unconditionally count allocations from MMU page caches
  KVM: x86/mmu: Track unused mmu_shadowed_info_cache pages count via
    global counter
  KVM: x86/mmu: Shrink mmu_shadowed_info_cache via MMU shrinker
  KVM: x86/mmu: Add per VM NUMA aware page table capability
  KVM: x86/mmu: Add documentation of NUMA aware page table capability
  KVM: x86/mmu: Allocate NUMA aware page tables on TDP huge page splits
  KVM: mmu: Add common initialization logic for struct
    kvm_mmu_memory_cache{}
  KVM: mmu: Initialize kvm_mmu_memory_cache.gfp_zero to __GFP_ZERO by
    default
  KVM: mmu: Add NUMA node support in struct kvm_mmu_memory_cache{}
  KVM: x86/mmu: Allocate numa aware page tables during page fault
  KVM: x86/mmu: Allocate shadow mmu page table on huge page split on the
    same NUMA node
  KVM: x86/mmu: Reduce default mmu memory cache size

 Documentation/virt/kvm/api.rst   |  29 +++
 arch/arm64/kvm/arm.c             |   2 +-
 arch/arm64/kvm/mmu.c             |   2 +-
 arch/mips/kvm/mips.c             |   3 +
 arch/riscv/kvm/mmu.c             |   8 +-
 arch/riscv/kvm/vcpu.c            |   2 +-
 arch/x86/include/asm/kvm_host.h  |  17 +-
 arch/x86/include/asm/kvm_types.h |   6 +-
 arch/x86/kvm/mmu/mmu.c           | 319 +++++++++++++++++++------------
 arch/x86/kvm/mmu/mmu_internal.h  |  38 ++++
 arch/x86/kvm/mmu/paging_tmpl.h   |  29 +--
 arch/x86/kvm/mmu/tdp_mmu.c       |  23 ++-
 arch/x86/kvm/x86.c               |  18 +-
 include/linux/kvm_host.h         |   2 +
 include/linux/kvm_types.h        |  21 ++
 include/uapi/linux/kvm.h         |   1 +
 virt/kvm/kvm_main.c              |  24 ++-
 17 files changed, 386 insertions(+), 158 deletions(-)

-- 
2.40.0.rc0.216.gc4246ad0f0-goog


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

end of thread, other threads:[~2023-04-03 23:03 UTC | newest]

Thread overview: 65+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-06 22:41 [Patch v4 00/18] NUMA aware page table allocation Vipin Sharma
2023-03-06 22:41 ` [Patch v4 01/18] KVM: x86/mmu: Change KVM mmu shrinker to no-op Vipin Sharma
2023-03-06 22:41 ` [Patch v4 02/18] KVM: x86/mmu: Remove zapped_obsolete_pages from struct kvm_arch{} Vipin Sharma
2023-03-06 22:41 ` [Patch v4 03/18] KVM: x86/mmu: Track count of pages in KVM MMU page caches globally Vipin Sharma
2023-03-07 11:32   ` kernel test robot
2023-03-07 19:13     ` Vipin Sharma
2023-03-07 20:18       ` Sean Christopherson
2023-03-07 12:13   ` kernel test robot
2023-03-08 20:33   ` Zhi Wang
2023-03-08 22:16     ` Vipin Sharma
2023-03-09  5:18       ` Mingwei Zhang
2023-03-09 12:52         ` Zhi Wang
2023-03-09 19:52           ` Vipin Sharma
2023-03-09 15:37   ` Zhi Wang
2023-03-09 18:19     ` Vipin Sharma
2023-03-09 23:53   ` David Matlack
2023-03-10  0:28     ` Vipin Sharma
2023-03-10  0:55       ` David Matlack
2023-03-10  1:09         ` Vipin Sharma
2023-03-10  0:22   ` David Matlack
2023-03-10  0:36     ` Vipin Sharma
2023-03-06 22:41 ` [Patch v4 04/18] KVM: x86/mmu: Shrink shadow page caches via MMU shrinker Vipin Sharma
2023-03-06 22:41 ` [Patch v4 05/18] KVM: x86/mmu: Add split_shadow_page_cache pages to global count of MMU cache pages Vipin Sharma
2023-03-09 15:58   ` Zhi Wang
2023-03-09 19:59     ` Vipin Sharma
2023-03-10  0:05       ` David Matlack
2023-03-10  0:06         ` David Matlack
2023-03-06 22:41 ` [Patch v4 06/18] KVM: x86/mmu: Shrink split_shadow_page_cache via MMU shrinker Vipin Sharma
2023-03-09 16:01   ` Zhi Wang
2023-03-09 19:59     ` Vipin Sharma
2023-03-06 22:41 ` [Patch v4 07/18] KVM: x86/mmu: Unconditionally count allocations from MMU page caches Vipin Sharma
2023-03-09 16:03   ` Zhi Wang
2023-03-06 22:41 ` [Patch v4 08/18] KVM: x86/mmu: Track unused mmu_shadowed_info_cache pages count via global counter Vipin Sharma
2023-03-30  4:53   ` Yang, Weijiang
2023-04-03 23:02     ` Vipin Sharma
2023-03-06 22:41 ` [Patch v4 09/18] KVM: x86/mmu: Shrink mmu_shadowed_info_cache via MMU shrinker Vipin Sharma
2023-03-06 22:41 ` [Patch v4 10/18] KVM: x86/mmu: Add per VM NUMA aware page table capability Vipin Sharma
2023-03-06 22:41 ` [Patch v4 11/18] KVM: x86/mmu: Add documentation of " Vipin Sharma
2023-03-23 21:59   ` David Matlack
2023-03-28 16:47     ` Vipin Sharma
2023-03-06 22:41 ` [Patch v4 12/18] KVM: x86/mmu: Allocate NUMA aware page tables on TDP huge page splits Vipin Sharma
2023-03-23 22:15   ` David Matlack
2023-03-28 17:12     ` Vipin Sharma
2023-03-06 22:41 ` [Patch v4 13/18] KVM: mmu: Add common initialization logic for struct kvm_mmu_memory_cache{} Vipin Sharma
2023-03-23 22:23   ` David Matlack
2023-03-28 17:16     ` Vipin Sharma
2023-03-06 22:41 ` [Patch v4 14/18] KVM: mmu: Initialize kvm_mmu_memory_cache.gfp_zero to __GFP_ZERO by default Vipin Sharma
2023-03-23 22:28   ` David Matlack
2023-03-28 17:31     ` Vipin Sharma
2023-03-28 23:13       ` David Matlack
2023-03-06 22:41 ` [Patch v4 15/18] KVM: mmu: Add NUMA node support in struct kvm_mmu_memory_cache{} Vipin Sharma
2023-03-23 22:30   ` David Matlack
2023-03-28 17:50     ` Vipin Sharma
2023-03-28 23:24       ` David Matlack
2023-04-03 22:57         ` Vipin Sharma
2023-03-06 22:41 ` [Patch v4 16/18] KVM: x86/mmu: Allocate numa aware page tables during page fault Vipin Sharma
2023-03-29  0:21   ` David Matlack
2023-03-29  0:28     ` David Matlack
2023-03-29 19:03     ` David Matlack
2023-04-03 22:54       ` Vipin Sharma
2023-04-03 22:50     ` Vipin Sharma
2023-03-06 22:41 ` [Patch v4 17/18] KVM: x86/mmu: Allocate shadow mmu page table on huge page split on the same NUMA node Vipin Sharma
2023-03-06 22:41 ` [Patch v4 18/18] KVM: x86/mmu: Reduce default mmu memory cache size Vipin Sharma
2023-03-07 18:19 ` [Patch v4 00/18] NUMA aware page table allocation Mingwei Zhang
2023-03-07 18:33   ` Vipin Sharma

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).