[pve-devel] [PATCH V2 qemu-server 1/2] enable balloon free-page-reporting

Thomas Lamprecht t.lamprecht at proxmox.com
Wed Mar 16 18:48:08 CET 2022


On 06.03.22 13:46, Alexandre Derumier wrote:
> Allow balloon device  driver to report hints of guest free pages to the host,
> for auto memory reclaim
> 
> https://lwn.net/Articles/759413/
> https://events19.linuxfoundation.org/wp-content/uploads/2017/12/KVMForum2018.pdf
> Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
> ---
>  PVE/QemuServer.pm | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
> index 42f0fbd..a9e86b3 100644
> --- a/PVE/QemuServer.pm
> +++ b/PVE/QemuServer.pm
> @@ -3846,7 +3846,9 @@ sub config_to_command {
>      # enable balloon by default, unless explicitly disabled
>      if (!defined($conf->{balloon}) || $conf->{balloon}) {
>  	my $pciaddr = print_pci_addr("balloon0", $bridges, $arch, $machine_type);
> -	push @$devices, '-device', "virtio-balloon-pci,id=balloon0$pciaddr";
> +	my $ballooncmd = "virtio-balloon-pci,id=balloon0$pciaddr";
> +	$ballooncmd .= ",free-page-reporting=on" if min_version($machine_version, 6, 2);

do we even need to guard this behind 6.2 machine version, as I tried to add it
on a running host and migrations in both directions went just fine with a windows
10 VM.

Asking mostly because we already have QEMU 6.2 available publicly on pvetest and
use it also for some infrastructure of ours, so if it really would be breaking
we'd need to use our separate qemu-version independent machine bump mechanism
(+pve1).

But it seems that its not required, or did you find that it can indeed break live
migration? fwiw, for us is really only forward migration, from vm without reporting
enabled to vm with reporting enabled, relevant.

> +	push @$devices, '-device', $ballooncmd;
>      }
>  
>      if ($conf->{watchdog}) {






More information about the pve-devel mailing list