Hi,

Currently, if a guest vm allocate a memory page, and freed it later in the 
guest,
the memory is not freed on the host side.

Balloon device have a new option since qemu 5.1 "free-page-reporting" (and need 
host kernel 5.7)

https://events19.linuxfoundation.org/wp-content/uploads/2017/12/KVMForum2018.pdf
https://lwn.net/Articles/759413/

This is working like the discard option for disk, memory is freed async by the 
host when vm is freeing it.

I'm running it production since 1 month without any problem. With a lot of vms 
and spiky workload, the memory
freed is really huge.

Here an example of a host with 650GB+200GB ksm going down to 250GB memory
https://mutulin1.odiso.net/ballon-size.png
(around 400vms with 2GB max memory, previously always allocated)


This patch enabled it by default force machine version >= 6.2.


changelogv2:

- enabled it only for machine version > 6.2
- add test

Alexandre Derumier (2):
  enable balloon free-page-reporting
  add test for virtio-balloon free-page-reporting=on. (qemu 6.2)

 PVE/QemuServer.pm                             |  4 ++-
 test/cfg2cmd/q35-simple-7.0.conf.cmd          |  2 +-
 .../simple-balloon-free-page-reporting.conf   | 15 +++++++++
 ...imple-balloon-free-page-reporting.conf.cmd | 33 +++++++++++++++++++
 4 files changed, 52 insertions(+), 2 deletions(-)
 create mode 100644 test/cfg2cmd/simple-balloon-free-page-reporting.conf
 create mode 100644 test/cfg2cmd/simple-balloon-free-page-reporting.conf.cmd

-- 
2.30.2


_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to