From: Peter Xu <peterx@redhat.com>
To: huangy81@chinatelecom.cn
Cc: qemu-devel <qemu-devel@nongnu.org>,
Markus Armbruster <armbru@redhat.com>,
"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Laurent Vivier <laurent@vivier.eu>,
Eric Blake <eblake@redhat.com>,
Juan Quintela <quintela@redhat.com>,
Thomas Huth <thuth@redhat.com>,
Peter Maydell <peter.maydell@linaro.org>,
Richard Henderson <richard.henderson@linaro.org>
Subject: Re: [PATCH v2 04/11] qapi/migration: Introduce x-vcpu-dirty-limit-period parameter
Date: Tue, 29 Nov 2022 17:49:02 -0500 [thread overview]
Message-ID: <Y4aMXtnH2G8bz+Am@x1n> (raw)
In-Reply-To: <9e6d5e0ab54c82c8b42a3b318249320fb20e3a44.1669047366.git.huangy81@chinatelecom.cn>
On Mon, Nov 21, 2022 at 11:26:36AM -0500, huangy81@chinatelecom.cn wrote:
> From: Hyman Huang(黄勇) <huangy81@chinatelecom.cn>
>
> Introduce "x-vcpu-dirty-limit-period" migration experimental
> parameter, which is in the range of 1 to 1000ms and used to
> make dirtyrate calculation period configurable.
>
> Signed-off-by: Hyman Huang(黄勇) <huangy81@chinatelecom.cn>
> ---
> migration/migration.c | 26 ++++++++++++++++++++++++++
> monitor/hmp-cmds.c | 8 ++++++++
> qapi/migration.json | 34 +++++++++++++++++++++++++++-------
> 3 files changed, 61 insertions(+), 7 deletions(-)
>
> diff --git a/migration/migration.c b/migration/migration.c
> index 739bb68..701267c 100644
> --- a/migration/migration.c
> +++ b/migration/migration.c
> @@ -116,6 +116,8 @@
> #define DEFAULT_MIGRATE_ANNOUNCE_ROUNDS 5
> #define DEFAULT_MIGRATE_ANNOUNCE_STEP 100
>
> +#define DEFAULT_MIGRATE_VCPU_DIRTY_LIMIT_PERIOD 500 /* ms */
> +
> static NotifierList migration_state_notifiers =
> NOTIFIER_LIST_INITIALIZER(migration_state_notifiers);
>
> @@ -963,6 +965,9 @@ MigrationParameters *qmp_query_migrate_parameters(Error **errp)
> s->parameters.block_bitmap_mapping);
> }
>
> + params->has_x_vcpu_dirty_limit_period = true;
> + params->x_vcpu_dirty_limit_period = s->parameters.x_vcpu_dirty_limit_period;
> +
> return params;
> }
>
> @@ -1564,6 +1569,15 @@ static bool migrate_params_check(MigrationParameters *params, Error **errp)
> }
> #endif
>
> + if (params->has_x_vcpu_dirty_limit_period &&
> + (params->x_vcpu_dirty_limit_period < 1 ||
> + params->x_vcpu_dirty_limit_period > 1000)) {
> + error_setg(errp, QERR_INVALID_PARAMETER_VALUE,
> + "x_vcpu_dirty_limit_period",
> + "is invalid, it must be in the range of 1 to 1000 ms");
> + return false;
> + }
> +
> return true;
> }
>
> @@ -1663,6 +1677,10 @@ static void migrate_params_test_apply(MigrateSetParameters *params,
> dest->has_block_bitmap_mapping = true;
> dest->block_bitmap_mapping = params->block_bitmap_mapping;
> }
> +
> + if (params->has_x_vcpu_dirty_limit_period) {
> + dest->x_vcpu_dirty_limit_period = params->x_vcpu_dirty_limit_period;
> + }
> }
>
> static void migrate_params_apply(MigrateSetParameters *params, Error **errp)
> @@ -1785,6 +1803,10 @@ static void migrate_params_apply(MigrateSetParameters *params, Error **errp)
> QAPI_CLONE(BitmapMigrationNodeAliasList,
> params->block_bitmap_mapping);
> }
> + if (params->has_x_vcpu_dirty_limit_period) {
> + s->parameters.x_vcpu_dirty_limit_period =
> + params->x_vcpu_dirty_limit_period;
> + }
> }
>
> void qmp_migrate_set_parameters(MigrateSetParameters *params, Error **errp)
> @@ -4386,6 +4408,9 @@ static Property migration_properties[] = {
> DEFINE_PROP_STRING("tls-creds", MigrationState, parameters.tls_creds),
> DEFINE_PROP_STRING("tls-hostname", MigrationState, parameters.tls_hostname),
> DEFINE_PROP_STRING("tls-authz", MigrationState, parameters.tls_authz),
> + DEFINE_PROP_UINT64("x-vcpu-dirty-limit-period", MigrationState,
> + parameters.x_vcpu_dirty_limit_period,
> + DEFAULT_MIGRATE_VCPU_DIRTY_LIMIT_PERIOD),
>
> /* Migration capabilities */
> DEFINE_PROP_MIG_CAP("x-xbzrle", MIGRATION_CAPABILITY_XBZRLE),
> @@ -4477,6 +4502,7 @@ static void migration_instance_init(Object *obj)
> params->has_tls_creds = true;
> params->has_tls_hostname = true;
> params->has_tls_authz = true;
> + params->has_x_vcpu_dirty_limit_period = true;
>
> qemu_sem_init(&ms->postcopy_pause_sem, 0);
> qemu_sem_init(&ms->postcopy_pause_rp_sem, 0);
> diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c
> index 01b789a..a3170ca 100644
> --- a/monitor/hmp-cmds.c
> +++ b/monitor/hmp-cmds.c
> @@ -513,6 +513,10 @@ void hmp_info_migrate_parameters(Monitor *mon, const QDict *qdict)
> }
> }
> }
> +
> + monitor_printf(mon, "%s: %" PRIu64 " ms\n",
> + MigrationParameter_str(MIGRATION_PARAMETER_X_VCPU_DIRTY_LIMIT_PERIOD),
> + params->x_vcpu_dirty_limit_period);
> }
>
> qapi_free_MigrationParameters(params);
> @@ -1332,6 +1336,10 @@ void hmp_migrate_set_parameter(Monitor *mon, const QDict *qdict)
> error_setg(&err, "The block-bitmap-mapping parameter can only be set "
> "through QMP");
> break;
> + case MIGRATION_PARAMETER_X_VCPU_DIRTY_LIMIT_PERIOD:
> + p->has_x_vcpu_dirty_limit_period = true;
> + visit_type_size(v, param, &p->x_vcpu_dirty_limit_period, &err);
> + break;
> default:
> assert(0);
> }
> diff --git a/qapi/migration.json b/qapi/migration.json
> index 88ecf86..5175779 100644
> --- a/qapi/migration.json
> +++ b/qapi/migration.json
> @@ -776,8 +776,13 @@
> # block device name if there is one, and to their node name
> # otherwise. (Since 5.2)
> #
> +# @x-vcpu-dirty-limit-period: Periodic time (ms) of dirty limit during live migration.
> +# Should be in the range 1 to 1000ms, defaults to 500ms.
> +# (Since 7.1)
Not 7.1 anymore but 7.3. Yeah a bit sad.
> +#
> # Features:
> -# @unstable: Member @x-checkpoint-delay is experimental.
> +# @unstable: Member @x-checkpoint-delay and @x-vcpu-dirty-limit-period
> +# are experimental.
> #
> # Since: 2.4
> ##
> @@ -795,8 +800,9 @@
> 'multifd-channels',
> 'xbzrle-cache-size', 'max-postcopy-bandwidth',
> 'max-cpu-throttle', 'multifd-compression',
> - 'multifd-zlib-level' ,'multifd-zstd-level',
> - 'block-bitmap-mapping' ] }
> + 'multifd-zlib-level', 'multifd-zstd-level',
> + 'block-bitmap-mapping',
> + { 'name': 'x-vcpu-dirty-limit-period', 'features': ['unstable'] } ] }
>
> ##
> # @MigrateSetParameters:
> @@ -941,8 +947,13 @@
> # block device name if there is one, and to their node name
> # otherwise. (Since 5.2)
> #
> +# @x-vcpu-dirty-limit-period: Periodic time (ms) of dirty limit during live migration.
> +# Should be in the range 1 to 1000ms, defaults to 500ms.
> +# (Since 7.1)
Same here.
> +#
> # Features:
> -# @unstable: Member @x-checkpoint-delay is experimental.
> +# @unstable: Member @x-checkpoint-delay and @x-vcpu-dirty-limit-period
> +# are experimental.
> #
> # Since: 2.4
> ##
> @@ -976,7 +987,9 @@
> '*multifd-compression': 'MultiFDCompression',
> '*multifd-zlib-level': 'uint8',
> '*multifd-zstd-level': 'uint8',
> - '*block-bitmap-mapping': [ 'BitmapMigrationNodeAlias' ] } }
> + '*block-bitmap-mapping': [ 'BitmapMigrationNodeAlias' ],
> + '*x-vcpu-dirty-limit-period': { 'type': 'uint64',
> + 'features': [ 'unstable' ] } } }
>
> ##
> # @migrate-set-parameters:
> @@ -1141,8 +1154,13 @@
> # block device name if there is one, and to their node name
> # otherwise. (Since 5.2)
> #
> +# @x-vcpu-dirty-limit-period: Periodic time (ms) of dirty limit during live migration.
> +# Should be in the range 1 to 1000ms, defaults to 500ms.
> +# (Since 7.1)
Same here.
> +#
> # Features:
> -# @unstable: Member @x-checkpoint-delay is experimental.
> +# @unstable: Member @x-checkpoint-delay and @x-vcpu-dirty-limit-period
> +# are experimental.
> #
> # Since: 2.4
> ##
> @@ -1174,7 +1192,9 @@
> '*multifd-compression': 'MultiFDCompression',
> '*multifd-zlib-level': 'uint8',
> '*multifd-zstd-level': 'uint8',
> - '*block-bitmap-mapping': [ 'BitmapMigrationNodeAlias' ] } }
> + '*block-bitmap-mapping': [ 'BitmapMigrationNodeAlias' ],
> + '*x-vcpu-dirty-limit-period': { 'type': 'uint64',
> + 'features': [ 'unstable' ] } } }
>
> ##
> # @query-migrate-parameters:
> --
> 1.8.3.1
>
>
--
Peter Xu
next prev parent reply other threads:[~2022-11-29 22:49 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-21 16:26 [PATCH v2 00/11] migration: introduce dirtylimit capability huangy81
2022-11-21 16:26 ` [PATCH v2 01/11] dirtylimit: Fix overflow when computing MB huangy81
2022-11-29 23:17 ` Peter Xu
2022-12-03 8:56 ` Markus Armbruster
2022-11-21 16:26 ` [PATCH v2 02/11] softmmu/dirtylimit: Add parameter check for hmp "set_vcpu_dirty_limit" huangy81
2022-11-29 23:17 ` Peter Xu
2022-12-03 9:01 ` Markus Armbruster
2022-11-21 16:26 ` [PATCH v2 03/11] kvm-all: Do not allow reap vcpu dirty ring buffer if not ready huangy81
2022-11-29 22:42 ` Peter Xu
2022-11-30 3:11 ` Hyman Huang
2022-11-21 16:26 ` [PATCH v2 04/11] qapi/migration: Introduce x-vcpu-dirty-limit-period parameter huangy81
2022-11-29 22:49 ` Peter Xu [this message]
2022-12-03 9:06 ` Markus Armbruster
2022-12-03 9:11 ` Markus Armbruster
2022-11-21 16:26 ` [PATCH v2 05/11] qapi/migration: Introduce vcpu-dirty-limit parameters huangy81
2022-11-29 23:58 ` Peter Xu
2022-12-03 9:13 ` Markus Armbruster
2022-12-03 9:21 ` Markus Armbruster
2022-11-21 16:26 ` [PATCH v2 06/11] migration: Introduce dirty-limit capability huangy81
2022-11-29 23:58 ` Peter Xu
2022-12-03 9:24 ` Markus Armbruster
2022-11-21 16:26 ` [PATCH v2 07/11] migration: Implement dirty-limit convergence algo huangy81
2022-11-29 23:17 ` Peter Xu
2022-12-01 1:13 ` Hyman
2022-11-21 16:26 ` [PATCH v2 08/11] migration: Export dirty-limit time info huangy81
2022-11-30 0:09 ` Peter Xu
2022-12-01 2:09 ` Hyman
2022-12-03 9:14 ` Hyman
2022-12-03 9:42 ` Markus Armbruster
2022-12-03 9:28 ` Markus Armbruster
2022-11-21 16:26 ` [PATCH v2 09/11] tests: Add migration dirty-limit capability test huangy81
2022-11-21 16:26 ` [PATCH v2 10/11] tests/migration: Introduce dirty-ring-size option into guestperf huangy81
2022-11-21 16:26 ` [PATCH v2 11/11] tests/migration: Introduce dirty-limit " huangy81
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y4aMXtnH2G8bz+Am@x1n \
--to=peterx@redhat.com \
--cc=armbru@redhat.com \
--cc=dgilbert@redhat.com \
--cc=eblake@redhat.com \
--cc=huangy81@chinatelecom.cn \
--cc=laurent@vivier.eu \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
--cc=richard.henderson@linaro.org \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.