[pve-devel] [PATCH qemu-server 1/1] migrate cache-size : power of 2

Fabian Grünbichler f.gruenbichler at proxmox.com
Mon Feb 12 09:03:42 CET 2018


On Fri, Feb 09, 2018 at 07:29:35PM +0100, Alexandre Derumier wrote:
> qemu 2.11 need a power of 2 cache size.
> 
> "
> Parameter 'xbzrle_cache_size' expects is invalid,
> it should be bigger than target page size and a power of two
> "
> 
> Divide the memory size by 8 instead 10
> ---
>  PVE/QemuMigrate.pm | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/PVE/QemuMigrate.pm b/PVE/QemuMigrate.pm
> index 937a855..a61e34b 100644
> --- a/PVE/QemuMigrate.pm
> +++ b/PVE/QemuMigrate.pm
> @@ -688,9 +688,9 @@ sub phase2 {
>      };
>      warn $@ if $@;
>  
> -    # set cachesize to 10% of the total memory
> +    # set cachesize to 12,5% of the total memory
>      my $memory =  $conf->{memory} || $defaults->{memory};
> -    my $cachesize = int($memory * 1048576 / 10);
> +    my $cachesize = int($memory * 1048576 / 8);

that is wrong though unless $memory is already a power of 2, which is
not guarantueed at all. we need to round to the nearest power of 2 (and
then we can also keep the 10% ;))

>      $self->log('info', "set cachesize: $cachesize");
>      eval {
>  	PVE::QemuServer::vm_mon_cmd_nocheck($vmid, "migrate-set-cache-size", value => int($cachesize));
> -- 
> 2.11.0
> 
> _______________________________________________
> pve-devel mailing list
> pve-devel at pve.proxmox.com
> https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel




More information about the pve-devel mailing list