qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Maciej S. Szmigiero" <mail@maciej.szmigiero.name>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Richard Henderson <richard.henderson@linaro.org>,
	Eduardo Habkost <eduardo@habkost.net>
Cc: "Michael S . Tsirkin" <mst@redhat.com>,
	"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Thomas Huth" <thuth@redhat.com>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Eric Blake" <eblake@redhat.com>,
	"Markus Armbruster" <armbru@redhat.com>,
	"David Hildenbrand" <david@redhat.com>,
	qemu-devel@nongnu.org
Subject: [PATCH v4 0/3] Hyper-V Dynamic Memory Protocol driver (hv-balloon 🎈️)
Date: Thu, 27 Apr 2023 11:08:30 +0200	[thread overview]
Message-ID: <cover.1682584770.git.maciej.szmigiero@oracle.com> (raw)

From: "Maciej S. Szmigiero" <maciej.szmigiero@oracle.com>

This is a continuation of v3 patch series located here:
https://lore.kernel.org/qemu-devel/cover.1677274611.git.maciej.szmigiero@oracle.com/

Since v3 was just a rebase a more detailed description of this driver is
available in the cover letter of v2:
https://lore.kernel.org/qemu-devel/cover.1672878904.git.maciej.szmigiero@oracle.com/

Changes from v3:
* Convert the driver to directly take just a single memory backend,

* Remove virtual DIMMs support, make the driver directly implement
TYPE_MEMORY_DEVICE interface,

* Allow hot-adding just parts of that single memory backend instead of
always adding the whole backend,

* Integrate the hot-add functionality transparently into the ballooning
interface instead of having a dedicated QMP hot-add command,

* Additional comments and minor cleanups.


Updated example usage:
* Add "-device vmbus-bridge,id=vmbus-bridge \
  -object memory-backend-ram,id=mem1,size=256G \
  -device hv-balloon,id=hvb,memdev=mem1"
  to the QEMU command line and set "maxmem" value to something large,
  like 1T.

The examples below assume that the guest boot memory size was 4 GiB.

* Use QEMU HMP "balloon" command to resize guest up to 8 GiB:
  balloon 8192
  This will cause the driver to hot-add the first 4 GiB of the memory
  backend.

* Use the ballooning interface to ask the guest to give out as much
  memory as possible:
  balloon 1

* Use the ballooning interface to resize the guest up again to 10 GiB:
  balloon 10240
  This will cause the driver to first return all ballooned out pages
  to the guest and then hot-add next 2 GiB of the memory backend.

* Further ballooning interface monitor commands can be used to resize
  the guest up and down appropriately.

* The current guest size can be queried by issuing the "info balloon" command.
  This is useful to know what is happening, since large ballooning or
  unballooning operations take some time to complete.

 Kconfig.host                     |    3 +
 configure                        |   36 +
 hw/hyperv/Kconfig                |    5 +
 hw/hyperv/hv-balloon.c           | 2040 ++++++++++++++++++++++++++++++
 hw/hyperv/meson.build            |    1 +
 hw/hyperv/trace-events           |   16 +
 include/hw/hyperv/dynmem-proto.h |  423 +++++++
 include/qapi/error.h             |    2 +
 meson.build                      |    4 +-
 qapi/machine.json                |   25 +
 10 files changed, 2554 insertions(+), 1 deletion(-)
 create mode 100644 hw/hyperv/hv-balloon.c
 create mode 100644 include/hw/hyperv/dynmem-proto.h



             reply	other threads:[~2023-04-27  9:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-27  9:08 Maciej S. Szmigiero [this message]
2023-04-27  9:08 ` [PATCH v4 1/3] error: define g_autoptr() cleanup function for the Error type Maciej S. Szmigiero
2023-04-27  9:08 ` [PATCH v4 2/3] Add Hyper-V Dynamic Memory Protocol definitions Maciej S. Szmigiero
2023-04-27  9:08 ` [PATCH v4 3/3] Add a Hyper-V Dynamic Memory Protocol driver (hv-balloon) Maciej S. Szmigiero
2023-04-28 22:59   ` Philippe Mathieu-Daudé
2023-04-29 17:15     ` Maciej S. Szmigiero

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=cover.1682584770.git.maciej.szmigiero@oracle.com \
    --to=mail@maciej.szmigiero.name \
    --cc=alex.bennee@linaro.org \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=david@redhat.com \
    --cc=eblake@redhat.com \
    --cc=eduardo@habkost.net \
    --cc=marcandre.lureau@redhat.com \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=thuth@redhat.com \
    /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).