linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/6] powerpc: Hash Page Table resizing for PAPR guests
@ 2016-12-08  5:13 David Gibson
  2016-12-08  5:13 ` [PATCH 1/6] kvm: Move KVM_PPC_PVINFO_FLAGS_EV_IDLE definition next to its structure David Gibson
                   ` (5 more replies)
  0 siblings, 6 replies; 8+ messages in thread
From: David Gibson @ 2016-12-08  5:13 UTC (permalink / raw)
  To: michael, paulus; +Cc: linuxppc-dev, kvm, David Gibson

This series implements the guest side of a PAPR ACR which allows a
POWER guest's Hashed Page Table (HPT) to be resized at runtime.  This
is useful when a guest has a very large theoretical maximum RAM, but
is likely to only ever be expanded to a modest amount of RAM in
practice.  Without resizing the HPT has to be sized for the maximum
possible guest RAM, which can be very wasteful if that maximum is
never reached.

To use this requires a hypervisor/host which also supports the PAPR
extension.  The only implementation so far is my qemu branch at
    https://github.com/dgibson/qemu/tree/upstream/hpt-resize
    
I expect to merge that code to upstream qemu for qemu-2.9.  Note that
HPT resizing will so far only work for TCG guests, KVM support is in
the works.  The guest side code here will not require changing for
KVM, however.

An HPT resize can be triggered in one of two ways:
    * /sys/kernel/debug/powerpc/pft-size

        This debugfs file contains the current size of the HPT (as
        encoded in the ibm,pft-size) device tree property.  Writing to
        it will cause the guest to attempt an HPT resize to the given
        value.  Note that the current qemu implementation will not
        allow the guest to resize the HPT to more than 1/64th of guest
        RAM size.

    * Automatically on memory hotplug / unplug

        With these patches applied, the guest will automatically
        attempt to resize its HPT when its RAM size changes due to
        hotplug events.  (When hot adding RAM qemu considers the new
        size for purposes of the limit mentioned above, so this method
        can lift the HPT size larger than the former).

David Gibson (6):
  kvm: Move KVM_PPC_PVINFO_FLAGS_EV_IDLE definition next to its
    structure
  powerpc/kvm: Corectly report KVM_CAP_PPC_ALLOC_HTAB
  pseries: Add hypercall wrappers for hash page table resizing
  pseries: Add support for hash table resizing
  pseries: Advertise HPT resizing support via CAS
  pseries: Automatically resize HPT for memory hot add/remove

 arch/powerpc/include/asm/book3s/64/mmu-hash.h |   1 +
 arch/powerpc/include/asm/firmware.h           |   5 +-
 arch/powerpc/include/asm/hvcall.h             |   4 +-
 arch/powerpc/include/asm/plpar_wrappers.h     |  12 +++
 arch/powerpc/include/asm/prom.h               |   1 +
 arch/powerpc/include/asm/sparsemem.h          |   1 +
 arch/powerpc/kernel/prom_init.c               |   2 +-
 arch/powerpc/kvm/powerpc.c                    |   5 +-
 arch/powerpc/mm/hash_utils_64.c               |  57 +++++++++++++
 arch/powerpc/mm/mem.c                         |   4 +
 arch/powerpc/platforms/pseries/firmware.c     |   1 +
 arch/powerpc/platforms/pseries/lpar.c         | 110 ++++++++++++++++++++++++++
 include/uapi/linux/kvm.h                      |   5 +-
 13 files changed, 201 insertions(+), 7 deletions(-)

-- 
2.9.3

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

end of thread, other threads:[~2016-12-08 19:04 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-08  5:13 [PATCH 0/6] powerpc: Hash Page Table resizing for PAPR guests David Gibson
2016-12-08  5:13 ` [PATCH 1/6] kvm: Move KVM_PPC_PVINFO_FLAGS_EV_IDLE definition next to its structure David Gibson
2016-12-08  5:13 ` [PATCH 2/6] powerpc/kvm: Corectly report KVM_CAP_PPC_ALLOC_HTAB David Gibson
2016-12-08  5:13 ` [PATCH 3/6] pseries: Add hypercall wrappers for hash page table resizing David Gibson
2016-12-08  5:13 ` [PATCH 4/6] pseries: Add support for hash " David Gibson
2016-12-08 19:04   ` kbuild test robot
2016-12-08  5:13 ` [PATCH 5/6] pseries: Advertise HPT resizing support via CAS David Gibson
2016-12-08  5:13 ` [PATCH 6/6] pseries: Automatically resize HPT for memory hot add/remove David Gibson

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).