mbox series

[v8,0/3] KVM: Dirty quota-based throttling

Message ID 20230225204758.17726-1-shivam.kumar1@nutanix.com (mailing list archive)
Headers show
Series KVM: Dirty quota-based throttling | expand

Message

Shivam Kumar Feb. 25, 2023, 8:47 p.m. UTC
This is v8 of the dirty quota series, with the following changes over
v7:

1. Removed pages_dirtied stat. Now, a single variable
dirty_quota_bytes is being used for throttling.
2. IOCTL to enable/disable dirty quota throttling. Enabling/disabling
can be done dynamically, e.g. we can enable dirty quota just before a
live migration and disable it just after the live migration.
3. Decoupled dirty quota from dirty logging. Introduced a new function
update_dirty_quota that decreases dirty_quota_bytes by by the
appropriate architecture-specific granule or page size. It also raises
a KVM request if dirty quota is exhausted.
4. Each arch that wants to use dirty quota throttling feature needs
to call update_dirty_quota at each time a page is dirtied. Also, it
needs to process the KVM request raised by update_dirty_quota and
facilitate exit to userspace. Added support for x86 and arm64.
5. Code refactoring and minor nits.

v1:
https://lore.kernel.org/kvm/20211114145721.209219-1-shivam.kumar1@nutanix.com/
v2: https://lore.kernel.org/kvm/Ydx2EW6U3fpJoJF0@google.com/T/
v3: https://lore.kernel.org/kvm/YkT1kzWidaRFdQQh@google.com/T/
v4:
https://lore.kernel.org/all/20220521202937.184189-1-shivam.kumar1@nutanix.com/
v5: https://lore.kernel.org/all/202209130532.2BJwW65L-lkp@intel.com/T/
v6:
https://lore.kernel.org/all/20220915101049.187325-1-shivam.kumar1@nutanix.com/
v7:
https://lore.kernel.org/all/a64d9818-c68d-1e33-5783-414e9a9bdbd1@nutanix.com/t/

Thanks,
Shivam

Shivam Kumar (3):
  KVM: Implement dirty quota-based throttling of vcpus
  KVM: x86: Dirty quota-based throttling of vcpus
  KVM: arm64: Dirty quota-based throttling of vcpus

 Documentation/virt/kvm/api.rst | 17 +++++++++++++++++
 arch/arm64/kvm/Kconfig         |  1 +
 arch/arm64/kvm/arm.c           |  7 +++++++
 arch/arm64/kvm/mmu.c           |  3 +++
 arch/x86/kvm/Kconfig           |  1 +
 arch/x86/kvm/mmu/mmu.c         |  8 +++++++-
 arch/x86/kvm/mmu/spte.c        |  3 +++
 arch/x86/kvm/mmu/tdp_mmu.c     |  3 +++
 arch/x86/kvm/vmx/vmx.c         |  5 +++++
 arch/x86/kvm/x86.c             | 16 ++++++++++++++++
 arch/x86/kvm/xen.c             | 12 +++++++++++-
 include/linux/kvm_host.h       |  5 +++++
 include/uapi/linux/kvm.h       |  8 ++++++++
 tools/include/uapi/linux/kvm.h |  1 +
 virt/kvm/Kconfig               |  3 +++
 virt/kvm/kvm_main.c            | 31 +++++++++++++++++++++++++++++++
 16 files changed, 122 insertions(+), 2 deletions(-)