From 5c1170fc4a7e6d119295a33c3e75a63f1503e1f0 Mon Sep 17 00:00:00 2001 From: Amit Shah Date: Tue, 2 Aug 2016 11:31:50 +0200 Subject: [PATCH 87/99] migration: Promote improved autoconverge commands out of experimental state RH-Author: Amit Shah Message-id: <9563330ef1ea0ff46d9b8d8d1f350d0a9faa1ae9.1470137268.git.amit.shah@redhat.com> Patchwork-id: 71727 O-Subject: [RHEL-7.3 qemu-kvm-rhev PATCH 1/1] migration: Promote improved autoconverge commands out of experimental state Bugzilla: 1358141 RH-Acked-by: Juan Quintela RH-Acked-by: Laszlo Ersek RH-Acked-by: Dr. David Alan Gilbert From: "Jason J. Herne" The new autoconverge throttling commands have been tested for a release now. It is time to move them out of the experimental state. Signed-off-by: Jason J. Herne Message-Id: <1461262038-8197-1-git-send-email-jjherne@linux.vnet.ibm.com> Signed-off-by: Amit Shah (cherry picked from commit d85a31d1f4d45462b7ca333190b5d14fad982f3e) Signed-off-by: Amit Shah Signed-off-by: Miroslav Rezanina --- hmp.c | 28 +++++++++++++------------- migration/migration.c | 56 +++++++++++++++++++++++++-------------------------- migration/ram.c | 4 ++-- qapi-schema.json | 54 ++++++++++++++++++++++++------------------------- qmp-commands.hx | 22 ++++++++++---------- 5 files changed, 82 insertions(+), 82 deletions(-) diff --git a/hmp.c b/hmp.c index cf1e1eb..7ae90ba 100644 --- a/hmp.c +++ b/hmp.c @@ -239,9 +239,9 @@ void hmp_info_migrate(Monitor *mon, const QDict *qdict) info->xbzrle_cache->overflow); } - if (info->has_x_cpu_throttle_percentage) { + if (info->has_cpu_throttle_percentage) { monitor_printf(mon, "cpu throttle percentage: %" PRIu64 "\n", - info->x_cpu_throttle_percentage); + info->cpu_throttle_percentage); } qapi_free_MigrationInfo(info); @@ -285,11 +285,11 @@ void hmp_info_migrate_parameters(Monitor *mon, const QDict *qdict) MigrationParameter_lookup[MIGRATION_PARAMETER_DECOMPRESS_THREADS], params->decompress_threads); monitor_printf(mon, " %s: %" PRId64, - MigrationParameter_lookup[MIGRATION_PARAMETER_X_CPU_THROTTLE_INITIAL], - params->x_cpu_throttle_initial); + MigrationParameter_lookup[MIGRATION_PARAMETER_CPU_THROTTLE_INITIAL], + params->cpu_throttle_initial); monitor_printf(mon, " %s: %" PRId64, - MigrationParameter_lookup[MIGRATION_PARAMETER_X_CPU_THROTTLE_INCREMENT], - params->x_cpu_throttle_increment); + MigrationParameter_lookup[MIGRATION_PARAMETER_CPU_THROTTLE_INCREMENT], + params->cpu_throttle_increment); monitor_printf(mon, "\n"); } @@ -1244,8 +1244,8 @@ void hmp_migrate_set_parameter(Monitor *mon, const QDict *qdict) bool has_compress_level = false; bool has_compress_threads = false; bool has_decompress_threads = false; - bool has_x_cpu_throttle_initial = false; - bool has_x_cpu_throttle_increment = false; + bool has_cpu_throttle_initial = false; + bool has_cpu_throttle_increment = false; int i; for (i = 0; i < MIGRATION_PARAMETER__MAX; i++) { @@ -1260,18 +1260,18 @@ void hmp_migrate_set_parameter(Monitor *mon, const QDict *qdict) case MIGRATION_PARAMETER_DECOMPRESS_THREADS: has_decompress_threads = true; break; - case MIGRATION_PARAMETER_X_CPU_THROTTLE_INITIAL: - has_x_cpu_throttle_initial = true; + case MIGRATION_PARAMETER_CPU_THROTTLE_INITIAL: + has_cpu_throttle_initial = true; break; - case MIGRATION_PARAMETER_X_CPU_THROTTLE_INCREMENT: - has_x_cpu_throttle_increment = true; + case MIGRATION_PARAMETER_CPU_THROTTLE_INCREMENT: + has_cpu_throttle_increment = true; break; } qmp_migrate_set_parameters(has_compress_level, value, has_compress_threads, value, has_decompress_threads, value, - has_x_cpu_throttle_initial, value, - has_x_cpu_throttle_increment, value, + has_cpu_throttle_initial, value, + has_cpu_throttle_increment, value, &err); break; } diff --git a/migration/migration.c b/migration/migration.c index d8c6477..9fba3a8 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -50,8 +50,8 @@ /*0: means nocompress, 1: best speed, ... 9: best compress ratio */ #define DEFAULT_MIGRATE_COMPRESS_LEVEL 1 /* Define default autoconverge cpu throttle migration parameters */ -#define DEFAULT_MIGRATE_X_CPU_THROTTLE_INITIAL 20 -#define DEFAULT_MIGRATE_X_CPU_THROTTLE_INCREMENT 10 +#define DEFAULT_MIGRATE_CPU_THROTTLE_INITIAL 20 +#define DEFAULT_MIGRATE_CPU_THROTTLE_INCREMENT 10 /* Migration XBZRLE default cache size */ #define DEFAULT_MIGRATE_CACHE_SIZE (64 * 1024 * 1024) @@ -88,10 +88,10 @@ MigrationState *migrate_get_current(void) DEFAULT_MIGRATE_COMPRESS_THREAD_COUNT, .parameters[MIGRATION_PARAMETER_DECOMPRESS_THREADS] = DEFAULT_MIGRATE_DECOMPRESS_THREAD_COUNT, - .parameters[MIGRATION_PARAMETER_X_CPU_THROTTLE_INITIAL] = - DEFAULT_MIGRATE_X_CPU_THROTTLE_INITIAL, - .parameters[MIGRATION_PARAMETER_X_CPU_THROTTLE_INCREMENT] = - DEFAULT_MIGRATE_X_CPU_THROTTLE_INCREMENT, + .parameters[MIGRATION_PARAMETER_CPU_THROTTLE_INITIAL] = + DEFAULT_MIGRATE_CPU_THROTTLE_INITIAL, + .parameters[MIGRATION_PARAMETER_CPU_THROTTLE_INCREMENT] = + DEFAULT_MIGRATE_CPU_THROTTLE_INCREMENT, }; if (!once) { @@ -522,10 +522,10 @@ MigrationParameters *qmp_query_migrate_parameters(Error **errp) s->parameters[MIGRATION_PARAMETER_COMPRESS_THREADS]; params->decompress_threads = s->parameters[MIGRATION_PARAMETER_DECOMPRESS_THREADS]; - params->x_cpu_throttle_initial = - s->parameters[MIGRATION_PARAMETER_X_CPU_THROTTLE_INITIAL]; - params->x_cpu_throttle_increment = - s->parameters[MIGRATION_PARAMETER_X_CPU_THROTTLE_INCREMENT]; + params->cpu_throttle_initial = + s->parameters[MIGRATION_PARAMETER_CPU_THROTTLE_INITIAL]; + params->cpu_throttle_increment = + s->parameters[MIGRATION_PARAMETER_CPU_THROTTLE_INCREMENT]; return params; } @@ -617,8 +617,8 @@ MigrationInfo *qmp_query_migrate(Error **errp) } if (cpu_throttle_active()) { - info->has_x_cpu_throttle_percentage = true; - info->x_cpu_throttle_percentage = cpu_throttle_get_percentage(); + info->has_cpu_throttle_percentage = true; + info->cpu_throttle_percentage = cpu_throttle_get_percentage(); } get_xbzrle_cache_stats(info); @@ -721,10 +721,10 @@ void qmp_migrate_set_parameters(bool has_compress_level, int64_t compress_threads, bool has_decompress_threads, int64_t decompress_threads, - bool has_x_cpu_throttle_initial, - int64_t x_cpu_throttle_initial, - bool has_x_cpu_throttle_increment, - int64_t x_cpu_throttle_increment, Error **errp) + bool has_cpu_throttle_initial, + int64_t cpu_throttle_initial, + bool has_cpu_throttle_increment, + int64_t cpu_throttle_increment, Error **errp) { MigrationState *s = migrate_get_current(); @@ -747,16 +747,16 @@ void qmp_migrate_set_parameters(bool has_compress_level, "is invalid, it should be in the range of 1 to 255"); return; } - if (has_x_cpu_throttle_initial && - (x_cpu_throttle_initial < 1 || x_cpu_throttle_initial > 99)) { + if (has_cpu_throttle_initial && + (cpu_throttle_initial < 1 || cpu_throttle_initial > 99)) { error_setg(errp, QERR_INVALID_PARAMETER_VALUE, - "x_cpu_throttle_initial", + "cpu_throttle_initial", "an integer in the range of 1 to 99"); } - if (has_x_cpu_throttle_increment && - (x_cpu_throttle_increment < 1 || x_cpu_throttle_increment > 99)) { + if (has_cpu_throttle_increment && + (cpu_throttle_increment < 1 || cpu_throttle_increment > 99)) { error_setg(errp, QERR_INVALID_PARAMETER_VALUE, - "x_cpu_throttle_increment", + "cpu_throttle_increment", "an integer in the range of 1 to 99"); } @@ -770,14 +770,14 @@ void qmp_migrate_set_parameters(bool has_compress_level, s->parameters[MIGRATION_PARAMETER_DECOMPRESS_THREADS] = decompress_threads; } - if (has_x_cpu_throttle_initial) { - s->parameters[MIGRATION_PARAMETER_X_CPU_THROTTLE_INITIAL] = - x_cpu_throttle_initial; + if (has_cpu_throttle_initial) { + s->parameters[MIGRATION_PARAMETER_CPU_THROTTLE_INITIAL] = + cpu_throttle_initial; } - if (has_x_cpu_throttle_increment) { - s->parameters[MIGRATION_PARAMETER_X_CPU_THROTTLE_INCREMENT] = - x_cpu_throttle_increment; + if (has_cpu_throttle_increment) { + s->parameters[MIGRATION_PARAMETER_CPU_THROTTLE_INCREMENT] = + cpu_throttle_increment; } } diff --git a/migration/ram.c b/migration/ram.c index eeb1902..96faa74 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -428,9 +428,9 @@ static void mig_throttle_guest_down(void) { MigrationState *s = migrate_get_current(); uint64_t pct_initial = - s->parameters[MIGRATION_PARAMETER_X_CPU_THROTTLE_INITIAL]; + s->parameters[MIGRATION_PARAMETER_CPU_THROTTLE_INITIAL]; uint64_t pct_icrement = - s->parameters[MIGRATION_PARAMETER_X_CPU_THROTTLE_INCREMENT]; + s->parameters[MIGRATION_PARAMETER_CPU_THROTTLE_INCREMENT]; /* We have not started throttling yet. Let's start it. */ if (!cpu_throttle_active()) { diff --git a/qapi-schema.json b/qapi-schema.json index 602510f..01c3e9e 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -484,9 +484,9 @@ # may be expensive, but do not actually occur during the iterative # migration rounds themselves. (since 1.6) # -# @x-cpu-throttle-percentage: #optional percentage of time guest cpus are being -# throttled during auto-converge. This is only present when auto-converge -# has started throttling guest cpus. (Since 2.5) +# @cpu-throttle-percentage: #optional percentage of time guest cpus are being +# throttled during auto-converge. This is only present when auto-converge +# has started throttling guest cpus. (Since 2.7) # # Since: 0.14.0 ## @@ -498,7 +498,7 @@ '*expected-downtime': 'int', '*downtime': 'int', '*setup-time': 'int', - '*x-cpu-throttle-percentage': 'int'} } + '*cpu-throttle-percentage': 'int'} } ## # @query-migrate @@ -609,18 +609,18 @@ # compression, so set the decompress-threads to the number about 1/4 # of compress-threads is adequate. # -# @x-cpu-throttle-initial: Initial percentage of time guest cpus are throttled -# when migration auto-converge is activated. The -# default value is 20. (Since 2.5) +# @cpu-throttle-initial: Initial percentage of time guest cpus are throttled +# when migration auto-converge is activated. The +# default value is 20. (Since 2.7) # -# @x-cpu-throttle-increment: throttle percentage increase each time -# auto-converge detects that migration is not making -# progress. The default value is 10. (Since 2.5) +# @cpu-throttle-increment: throttle percentage increase each time +# auto-converge detects that migration is not making +# progress. The default value is 10. (Since 2.7) # Since: 2.4 ## { 'enum': 'MigrationParameter', 'data': ['compress-level', 'compress-threads', 'decompress-threads', - 'x-cpu-throttle-initial', 'x-cpu-throttle-increment'] } + 'cpu-throttle-initial', 'cpu-throttle-increment'] } # # @migrate-set-parameters @@ -633,21 +633,21 @@ # # @decompress-threads: decompression thread count # -# @x-cpu-throttle-initial: Initial percentage of time guest cpus are throttled -# when migration auto-converge is activated. The -# default value is 20. (Since 2.5) +# @cpu-throttle-initial: Initial percentage of time guest cpus are throttled +# when migration auto-converge is activated. The +# default value is 20. (Since 2.7) # -# @x-cpu-throttle-increment: throttle percentage increase each time -# auto-converge detects that migration is not making -# progress. The default value is 10. (Since 2.5) +# @cpu-throttle-increment: throttle percentage increase each time +# auto-converge detects that migration is not making +# progress. The default value is 10. (Since 2.7) # Since: 2.4 ## { 'command': 'migrate-set-parameters', 'data': { '*compress-level': 'int', '*compress-threads': 'int', '*decompress-threads': 'int', - '*x-cpu-throttle-initial': 'int', - '*x-cpu-throttle-increment': 'int'} } + '*cpu-throttle-initial': 'int', + '*cpu-throttle-increment': 'int'} } # # @MigrationParameters @@ -658,13 +658,13 @@ # # @decompress-threads: decompression thread count # -# @x-cpu-throttle-initial: Initial percentage of time guest cpus are throttled -# when migration auto-converge is activated. The -# default value is 20. (Since 2.5) +# @cpu-throttle-initial: Initial percentage of time guest cpus are throttled +# when migration auto-converge is activated. The +# default value is 20. (Since 2.7) # -# @x-cpu-throttle-increment: throttle percentage increase each time -# auto-converge detects that migration is not making -# progress. The default value is 10. (Since 2.5) +# @cpu-throttle-increment: throttle percentage increase each time +# auto-converge detects that migration is not making +# progress. The default value is 10. (Since 2.7) # # Since: 2.4 ## @@ -672,8 +672,8 @@ 'data': { 'compress-level': 'int', 'compress-threads': 'int', 'decompress-threads': 'int', - 'x-cpu-throttle-initial': 'int', - 'x-cpu-throttle-increment': 'int'} } + 'cpu-throttle-initial': 'int', + 'cpu-throttle-increment': 'int'} } ## # @query-migrate-parameters # diff --git a/qmp-commands.hx b/qmp-commands.hx index df52c5d..5d86ca8 100644 --- a/qmp-commands.hx +++ b/qmp-commands.hx @@ -3836,10 +3836,10 @@ Set migration parameters - "compress-level": set compression level during migration (json-int) - "compress-threads": set compression thread count for migration (json-int) - "decompress-threads": set decompression thread count for migration (json-int) -- "x-cpu-throttle-initial": set initial percentage of time guest cpus are - throttled for auto-converge (json-int) -- "x-cpu-throttle-increment": set throttle increasing percentage for - auto-converge (json-int) +- "cpu-throttle-initial": set initial percentage of time guest cpus are + throttled for auto-converge (json-int) +- "cpu-throttle-increment": set throttle increasing percentage for + auto-converge (json-int) Arguments: @@ -3853,7 +3853,7 @@ EQMP { .name = "migrate-set-parameters", .args_type = - "compress-level:i?,compress-threads:i?,decompress-threads:i?,x-cpu-throttle-initial:i?,x-cpu-throttle-increment:i?", + "compress-level:i?,compress-threads:i?,decompress-threads:i?,cpu-throttle-initial:i?,cpu-throttle-increment:i?", .mhandler.cmd_new = qmp_marshal_migrate_set_parameters, }, SQMP @@ -3866,10 +3866,10 @@ Query current migration parameters - "compress-level" : compression level value (json-int) - "compress-threads" : compression thread count value (json-int) - "decompress-threads" : decompression thread count value (json-int) - - "x-cpu-throttle-initial" : initial percentage of time guest cpus are - throttled (json-int) - - "x-cpu-throttle-increment" : throttle increasing percentage for - auto-converge (json-int) + - "cpu-throttle-initial" : initial percentage of time guest cpus are + throttled (json-int) + - "cpu-throttle-increment" : throttle increasing percentage for + auto-converge (json-int) Arguments: @@ -3879,10 +3879,10 @@ Example: <- { "return": { "decompress-threads": 2, - "x-cpu-throttle-increment": 10, + "cpu-throttle-increment": 10, "compress-threads": 8, "compress-level": 1, - "x-cpu-throttle-initial": 20 + "cpu-throttle-initial": 20 } } -- 1.8.3.1