linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: michael@ellerman.id.au, paulus@samba.org
Cc: linuxppc-dev@ozlabs.org, kvm@vger.kernel.org,
	David Gibson <david@gibson.dropbear.id.au>
Subject: [PATCH 0/6] powerpc: Hash Page Table resizing for PAPR guests
Date: Thu,  8 Dec 2016 16:13:15 +1100	[thread overview]
Message-ID: <20161208051321.31446-1-david@gibson.dropbear.id.au> (raw)

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

             reply	other threads:[~2016-12-08  5:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-08  5:13 David Gibson [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161208051321.31446-1-david@gibson.dropbear.id.au \
    --to=david@gibson.dropbear.id.au \
    --cc=kvm@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=michael@ellerman.id.au \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).