[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v9 09/10] Add set_cachesize command
From: |
Juan Quintela |
Subject: |
Re: [Qemu-devel] [PATCH v9 09/10] Add set_cachesize command |
Date: |
Wed, 18 Apr 2012 19:07:37 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.93 (gnu/linux) |
Orit Wasserman <address@hidden> wrote:
> Change XBZRLE cache size in bytes (the size should be a power of 2).
> If XBZRLE cache size is too small there will be many cache miss.
> + .name = "migrate_set_cachesize",
> + .args_type = "value:o",
This mean that we can assign values like 256M, right? i.e. no way to
pass negative values?
> index 7578163..071a1b9 100644
> --- a/migration.c
> +++ b/migration.c
> @@ -167,7 +167,7 @@ MigrationCapList *qmp_query_migration_caps(Error **errp)
> MigrationCapList *caps_list = g_malloc0(sizeof(*caps_list));
>
> caps_list->value = g_malloc(sizeof(*caps_list->value));
> - caps_list->value->name = g_strdup("uleb");
> + caps_list->value->name = g_strdup("xbzrle");
> caps_list->next = NULL;
>
Shouldn't this go in the previous patche?
> +void qmp_migrate_set_cachesize(int64_t value, Error **errp)
> +{
> + MigrationState *s;
> +
> + /* Check for truncation */
> + if (value != (size_t)value) {
> + error_set(errp, QERR_INVALID_PARAMETER_VALUE, "cache size",
> + "exceeding address space");
> + return;
> + }
> +
> + /* power of 2 */
> + if (value != 1 && (value & (value - 1))) {
> + error_set(errp, QERR_INVALID_PARAMETER_VALUE, "cache size",
> + "needs to be power of 2");
> + return;
> + }
Don't we have a function to calculate if a value is a power of 2 in
qemu? I guess we need one _now_.
> +
> + value = MIN(UINT64_MAX, value);
> + if (value == migrate_cache_size) {
> + return;
> + }
> +
> + migrate_cache_size = value;
Can't we just remove the migrate_cache_size as a new field of
migration_state. bandwidth_limit is the example on how to do it.
Thanks, Juan.
- Re: [Qemu-devel] [PATCH v9 06/10] Add XBZRLE to ram_save_block and ram_save_live, (continued)
- [Qemu-devel] [PATCH v9 08/10] Add migration capabilites, Orit Wasserman, 2012/04/11
- [Qemu-devel] [PATCH v9 07/10] Add XBZRLE option to migrate command, Orit Wasserman, 2012/04/11
- [Qemu-devel] [PATCH v9 09/10] Add set_cachesize command, Orit Wasserman, 2012/04/11
- [Qemu-devel] [PATCH v9 10/10] Add XBZRLE statistics, Orit Wasserman, 2012/04/11
- Re: [Qemu-devel] [PATCH v9 00/10] XBZRLE delta for live migration of large memory app, Anthony Liguori, 2012/04/18