[Top][All Lists]
[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
- [Qemu-devel] [PATCH v8 00/10] XBZRLE delta for live migration of large memory app, Orit Wasserman, 2012/04/05
- [Qemu-devel] [PATCH v8 01/10] Add cache handling functions, Orit Wasserman, 2012/04/05
- [Qemu-devel] [PATCH v8 02/10] Add uleb encoding/decoding functions, Orit Wasserman, 2012/04/05
- [Qemu-devel] [PATCH v8 03/10] Add save_block_hdr function, Orit Wasserman, 2012/04/05
- [Qemu-devel] [PATCH v8 05/10] Add MigrationParams structure, Orit Wasserman, 2012/04/05
- [Qemu-devel] [PATCH v8 09/10] Add set_cachesize command, Orit Wasserman, 2012/04/05
- Re: [Qemu-devel] [PATCH v8 09/10] Add set_cachesize command,
Avi Kivity <=
- [Qemu-devel] [PATCH v8 10/10] Add XBZRLE statstics information, Orit Wasserman, 2012/04/05
- [Qemu-devel] [PATCH v8 08/10] Add migration capabilites, Orit Wasserman, 2012/04/05
- [Qemu-devel] [PATCH v8 04/10] Add host_from_stream_offset_versioned function, Orit Wasserman, 2012/04/05
- [Qemu-devel] [PATCH v8 06/10] Add XBZRLE to ram_save_block and ram_save_live, Orit Wasserman, 2012/04/05
- [Qemu-devel] [PATCH v8 07/10] Add XBZRLE option to migrate command, Orit Wasserman, 2012/04/05