linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/4] track memory used by balloon drivers
@ 2025-03-14 21:37 Nico Pache
  2025-03-14 21:37 ` [PATCH v2 1/4] meminfo: add a per node counter for " Nico Pache
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Nico Pache @ 2025-03-14 21:37 UTC (permalink / raw)
  To: linux-hyperv, linux-kernel, xen-devel, linux-fsdevel, linux-mm,
	virtualization
  Cc: alexander.atanasov, muchun.song, roman.gushchin, mhocko, kys,
	haiyangz, wei.liu, decui, jgross, sstabellini,
	oleksandr_tyshchenko, akpm, mst, david, yosry.ahmed, hannes,
	nphamcs, chengming.zhou, kanchana.p.sridhar, llong, shakeel.butt

This series introduces a way to track memory used by balloon drivers.

Add a NR_BALLOON_PAGES counter to track how many pages are reclaimed by the
balloon drivers. First add the accounting, then updates the balloon drivers
(virtio, Hyper-V, VMware, Pseries-cmm, and Xen) to maintain this counter. The
virtio, Vmware, and pseries-cmm balloon drivers utilize the balloon_compaction
interface to allocate and free balloon pages. Other balloon drivers will have to
maintain this counter manually.

This makes the information visible in memory reporting interfaces like
/proc/meminfo, show_mem, and OOM reporting.

This provides admins visibility into their VM balloon sizes without
requiring different virtualization tooling. Furthermore, this information
is helpful when debugging an OOM inside a VM.

V2 changes:
- Add counter to the balloon_compaction interface
- Dropped patches for virtio and VMware as they use balloon_compaction interface

Tested: virtio_balloon, run stress-ng, inflate balloon, oom prints
Signed-off-by: Nico Pache <npache@redhat.com>

Nico Pache (4):
  meminfo: add a per node counter for balloon drivers
  balloon_compaction: update the NR_BALLOON_PAGES state
  hv_balloon: update the NR_BALLOON_PAGES state
  xen: balloon: update the NR_BALLOON_PAGES state

 drivers/hv/hv_balloon.c | 2 ++
 drivers/xen/balloon.c   | 4 ++++
 fs/proc/meminfo.c       | 2 ++
 include/linux/mmzone.h  | 1 +
 mm/balloon_compaction.c | 2 ++
 mm/show_mem.c           | 4 +++-
 mm/vmstat.c             | 1 +
 7 files changed, 15 insertions(+), 1 deletion(-)

-- 
2.48.1



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

end of thread, other threads:[~2025-03-18 10:16 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-03-14 21:37 [PATCH v2 0/4] track memory used by balloon drivers Nico Pache
2025-03-14 21:37 ` [PATCH v2 1/4] meminfo: add a per node counter for " Nico Pache
2025-03-15  1:06   ` Andrew Morton
2025-03-17 22:37     ` Nico Pache
2025-03-14 21:37 ` [PATCH v2 2/4] balloon_compaction: update the NR_BALLOON_PAGES state Nico Pache
2025-03-14 21:37 ` [PATCH v2 3/4] hv_balloon: " Nico Pache
2025-03-15  4:09   ` Michael Kelley
2025-03-14 21:37 ` [PATCH v2 4/4] xen: balloon: " Nico Pache
2025-03-18 10:16   ` Jürgen Groß

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