qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v8 09/10] Add set_cachesize command


From: Avi Kivity
Subject: Re: [Qemu-devel] [PATCH v8 09/10] Add set_cachesize command
Date: Thu, 05 Apr 2012 15:15:52 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120316 Thunderbird/11.0

On 04/05/2012 01:47 PM, Orit Wasserman wrote:
> Change XBZRLE cache size in MB (the size should be a power of 2).

In bytes

>  
> +void xbzrle_cache_resize(int64_t new_size)
> +{
> +    if (page_cache) {
> +        cache_fini();
> +        cache_init(new_size);
> +    }
> +}

A little sad to drop the cache, especially if we're enlarging it.  But
this can be improved later.

> +
> +ETEXI
> +
> +    {
> +        .name       = "migrate_set_cachesize",
> +        .args_type  = "value:o",
> +        .params     = "value",
> +        .help       = "set cache size (in MB) for XBZRLE migrations",

In bytes.

> +        .mhandler.cmd = hmp_migrate_set_cachesize,
> +    },
> +
> +STEXI
> address@hidden migrate_set_cachesize @var{value}
> address@hidden migrate_set_cache
> +Set cache size to @var{value} (in MB) for xbzrle migrations.

Need to document the constraints, and say something about how a larger
cache size can reduce the needed bandwidth.

We need to either document the default or (better) add a command to get
the current cache size (perhaps with some statistics about hit rate and
average data reduction).

>  
> +void qmp_migrate_set_cachesize(int64_t value, Error **errp)
> +{
> +    MigrationState *s;
> +
> +    /* On 32-bit hosts, QEMU is limited by virtual address space */
> +    if (value > (2047 << 20) && HOST_LONG_BITS == 32) {

Could be made clearer by using

   /* Check for truncation */
   if (value != (size_t)value)) {
      ...

(assumes value is in bytes)

>  ##
> +# @migrate_set_cachesize
> +#
> +# Set XBZRLE cache size
> +#
> +# @value: cache size in bytes

Here it's in bytes, good.

For the human monitor we can use MB as the unit, or allow suffixes as we
do for -m <memory>.

-- 
error compiling committee.c: too many arguments to function




reply via email to

[Prev in Thread] Current Thread [Next in Thread]