Discussion of the VIRTIO specification
 help / color / mirror / Atom feed
* [PATCH v3 0/2] balloon: DEVICE_INIT_REPORTED and DEVICE_INIT_ON_INFLATE
@ 2026-05-05 16:08 Michael S. Tsirkin
  2026-05-05 16:08 ` [PATCH v3 1/2] balloon: add VIRTIO_BALLOON_F_DEVICE_INIT_REPORTED Michael S. Tsirkin
  2026-05-05 16:08 ` [PATCH v3 2/2] balloon: add VIRTIO_BALLOON_F_DEVICE_INIT_ON_INFLATE Michael S. Tsirkin
  0 siblings, 2 replies; 3+ messages in thread
From: Michael S. Tsirkin @ 2026-05-05 16:08 UTC (permalink / raw)
  To: virtio-comment

Once a page gets out of balloon (on deflate, or on access for
reporting) the Linux guest inits it before giving it to app.
It's a waste - the page is already inited by the host.

Add balloon support for skipping that, that provides significant
performance gains.

This adds two new feature bits for the balloon device that allow the
device to signal that it has initialized (zeroed or poison-filled) pages
on behalf of the driver.

The variant with poison does not really seem useful, so I am still
trying to figure out whether we should simply outlaw it.


Old implementations (new ones will be posted ASAP):
QEMU: https://lore.kernel.org/all/cover.1777824548.git.mst@redhat.com
Linux: https://lore.kernel.org/all/cover.1777803445.git.mst@redhat.com

Tested with QEMU + Linux guest: 232ms -> 51ms (-78%) for 256MB
page allocation in a 2GB VM.

Changes since v2:
- I realized we can't really avoid a new feature bit:
  poison is a promise from driver to initialize pages.
- lots of other changes

Changes v1->v2:
- reporting can actually just utilize used length to see what
  was initialized! so we do not need a bitmap for that.
- qemu really needs a way to skip init for some pages.
  Add that to inflate path.
  Add security considerations (for coco).

Michael S. Tsirkin (2):
  balloon: add VIRTIO_BALLOON_F_DEVICE_INIT_REPORTED
  balloon: add VIRTIO_BALLOON_F_DEVICE_INIT_ON_INFLATE

 device-types/balloon/description.tex | 147 ++++++++++++++++++++++++++-
 1 file changed, 145 insertions(+), 2 deletions(-)

--
MST


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

end of thread, other threads:[~2026-05-05 16:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-05 16:08 [PATCH v3 0/2] balloon: DEVICE_INIT_REPORTED and DEVICE_INIT_ON_INFLATE Michael S. Tsirkin
2026-05-05 16:08 ` [PATCH v3 1/2] balloon: add VIRTIO_BALLOON_F_DEVICE_INIT_REPORTED Michael S. Tsirkin
2026-05-05 16:08 ` [PATCH v3 2/2] balloon: add VIRTIO_BALLOON_F_DEVICE_INIT_ON_INFLATE Michael S. Tsirkin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox