Linux virtualization list
 help / color / mirror / Atom feed
* [PATCH v11 0/7] mm/virtio: skip redundant zeroing of host-zeroed reported pages
@ 2026-11-19 12:02 Michael S. Tsirkin
  2026-11-19 12:02 ` [PATCH v11 1/7] mm: add PG_zeroed page flag and buddy merge tracking Michael S. Tsirkin
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Michael S. Tsirkin @ 2026-11-19 12:02 UTC (permalink / raw)
  To: linux-kernel
  Cc: Andrew Morton, David Hildenbrand, Vlastimil Babka,
	Brendan Jackman, Michal Hocko, Suren Baghdasaryan, Jason Wang,
	Andrea Arcangeli, Dev Jain, Geert Uytterhoeven, Greg Ungerer,
	Gregory Price, Huang, Ying, Lance Yang, Lorenzo Stoakes,
	Magnus Lindholm, Matthew Wilcox, Miaohe Lin, Zi Yan, linux-mm,
	virtualization

Many hosts immediately discard each free page guest reports.
This means that re-zeroing them in the guest after allocation
is redundant.

This series lets a page reporting device advertise that its completed
reports guarantee zero contents. It tracks that state through the buddy
allocator and uses it to skip clearing freshly allocated user folios.

The series is based on Linux 7.4-rc3, commit 666539eecdf4d.

This is the first part of the project. Further hugepage support, along with
the init_on_free and FPI_ZEROED additions suggested by Matthew Wilcox,
is left for follow-up work if this series is merged.

Patches 1-2 add PG_zeroed tracking and the page reporting device's zeroing
guarantee.

Patches 3-5 skip redundant zeroing in the PMD THP, order-0 (including
x86), and mTHP anonymous allocation paths.

Patch 6 adds VIRTIO_BALLOON_F_DEVICE_INIT_REPORTED to negotiate this
with host.

Patch 7 adds a flush parameter with an approximate reporting budget for
deterministic testing.

For a 512 MiB anonymous allocation using MADV_POPULATE_WRITE in a 2 GiB,
one-vCPU KVM guest, ten samples per mode gave:

  task-clock              feature off          feature on
  PMD THP                 229.0 +/- 20.0 ms     74.7 +/- 35.8 ms
  order-0                 336.1 +/-  6.5 ms     99.2 +/- 19.3 ms

Assisted-by: LLM

Changes since v10:
- Rewritten along the lines suggested by Matthew Wilcox [1].

[1] https://lore.kernel.org/all/aiePVsiV-w-IZ8A4@casper.infradead.org/

Michael S. Tsirkin (7):
  mm: add PG_zeroed page flag and buddy merge tracking
  mm: page_reporting: support host-zeroed reported pages
  mm: skip zeroing in vma_alloc_anon_folio_pmd for pre-zeroed pages
  mm: skip zeroing of pre-zeroed order-0 user pages
  mm: skip zeroing in alloc_anon_folio for pre-zeroed pages
  virtio_balloon: add DEVICE_INIT_REPORTED feature
  mm: page_reporting: add flush parameter with page budget

 drivers/virtio/virtio_balloon.c     | 33 ++++++++++++++++++++--
 include/linux/highmem.h             | 29 +++++++++++++++++--
 include/linux/mm.h                  | 32 +++++++++++++++++----
 include/linux/page-flags.h          | 15 +++++++++-
 include/linux/page_reporting.h      |  8 ++++++
 include/uapi/linux/virtio_balloon.h |  1 +
 mm/huge_memory.c                    | 11 ++------
 mm/memory.c                         | 10 +------
 mm/page_alloc.c                     | 43 ++++++++++++++++++++++++-----
 mm/page_reporting.c                 | 43 +++++++++++++++++++++++++++++
 10 files changed, 189 insertions(+), 36 deletions(-)


base-commit: 666539eecdf4db623f5e3c3e55cf9f2dfad24aa4
-- 
MST


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

end of thread, other threads:[~2026-11-19 12:03 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-19 12:02 [PATCH v11 0/7] mm/virtio: skip redundant zeroing of host-zeroed reported pages Michael S. Tsirkin
2026-11-19 12:02 ` [PATCH v11 1/7] mm: add PG_zeroed page flag and buddy merge tracking Michael S. Tsirkin
2026-11-19 12:02 ` [PATCH v11 2/7] mm: page_reporting: support host-zeroed reported pages Michael S. Tsirkin
2026-11-19 12:02 ` [PATCH v11 3/7] mm: skip zeroing in vma_alloc_anon_folio_pmd for pre-zeroed pages Michael S. Tsirkin
2026-11-19 12:02 ` [PATCH v11 4/7] mm: skip zeroing of pre-zeroed order-0 user pages Michael S. Tsirkin
2026-11-19 12:02 ` [PATCH v11 5/7] mm: skip zeroing in alloc_anon_folio for pre-zeroed pages Michael S. Tsirkin
2026-11-19 12:02 ` [PATCH v11 6/7] virtio_balloon: add DEVICE_INIT_REPORTED feature Michael S. Tsirkin
2026-11-19 12:03 ` [PATCH v11 7/7] mm: page_reporting: add flush parameter with page budget 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