[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v5 7/8] multifd: Add multifd-zstd-level parameter
From: |
Dr. David Alan Gilbert |
Subject: |
Re: [PATCH v5 7/8] multifd: Add multifd-zstd-level parameter |
Date: |
Thu, 13 Feb 2020 14:28:41 +0000 |
User-agent: |
Mutt/1.13.3 (2020-01-12) |
* Markus Armbruster (address@hidden) wrote:
> "Dr. David Alan Gilbert" <address@hidden> writes:
>
> > * Juan Quintela (address@hidden) wrote:
> >> Signed-off-by: Juan Quintela <address@hidden>
> >> ---
> >> migration/migration.c | 15 +++++++++++++++
> >> monitor/hmp-cmds.c | 4 ++++
> >> qapi/migration.json | 29 ++++++++++++++++++++++++++---
> >> 3 files changed, 45 insertions(+), 3 deletions(-)
> >>
> >> diff --git a/migration/migration.c b/migration/migration.c
> >> index 3b081e8147..b690500545 100644
> >> --- a/migration/migration.c
> >> +++ b/migration/migration.c
> >> @@ -91,6 +91,8 @@
> >> #define DEFAULT_MIGRATE_MULTIFD_METHOD MULTIFD_METHOD_NONE
> >> /*0: means nocompress, 1: best speed, ... 9: best compress ratio */
> >> #define DEFAULT_MIGRATE_MULTIFD_ZLIB_LEVEL 1
> >> +/* 0: means nocompress, 1: best speed, ... 20: best compress ratio */
> >> +#define DEFAULT_MIGRATE_MULTIFD_ZSTD_LEVEL 1
> >>
> >> /* Background transfer rate for postcopy, 0 means unlimited, note
> >> * that page requests can still exceed this limit.
> >> @@ -805,6 +807,8 @@ MigrationParameters
> >> *qmp_query_migrate_parameters(Error **errp)
> >> params->multifd_method = s->parameters.multifd_method;
> >> params->has_multifd_zlib_level = true;
> >> params->multifd_zlib_level = s->parameters.multifd_zlib_level;
> >> + params->has_multifd_zstd_level = true;
> >> + params->multifd_zstd_level = s->parameters.multifd_zstd_level;
> >
> > Do we really want different 'multifd_...._level's or just one
> > 'multifd_compress_level' - or even just reuse the existing
> > 'compress-level' parameter.
>
> compress-level, multifd-zlib-level, and multifd-zstd-level apply
> "normal" live migration compression, multifd zlib live migration
> compression, and multifd zstd live migration compression, respectively.
>
> Any live migration can only use one of the three compressions.
>
> Correct?
Right.
> > The only tricky thing about combining them is how to handle
> > the difference in allowed ranges; When would the right time be
> > to check it?
> >
> > Markus/Eric: Any idea?
>
> To have an informed opinion, I'd have to dig through the migration
> code.
The tricky part I see is validating settings/parameters;
when someone tries to set a parameter migrate_params_check gets called
and has checks like:
if (params->has_compress_level &&
(params->compress_level > 9)) {
error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "compress_level",
"is invalid, it should be in the range of 0 to 9");
return false;
}
now that's nice because you error when you set the parameter rather
than later when you try and start a migration; the downside now
though is you get more complex interaction between parameters and
capabilities - so for example if you set the multifd-compression type
parameter to 'zstd' and *then* set the single compression level
it'll be fine taking '20' as a compresison level, but if you were
to set the compression level to 20 and then set the type to 'zstd'
it might error because with zlib you can't have 20.
> Documentation of admissible range will become a bit awkward, too.
>
> Too many migration parameters...
Nod; which why I was trying to make it 1.
Dave
--
Dr. David Alan Gilbert / address@hidden / Manchester, UK