Guestperf: miscellaneous refinement and enrichment
cover Guestperf: miscellaneous refinement and enrichment
From: Hyman Huang <[email protected]>
The previous patchset:
https://lore.kernel.org/qemu-devel/[email protected]/
does not made the necessary changes and tests for the upstream version.
This patchset works for that:
1. Move the guestperf to scripts directory suggested by Fabiano Rosas
2. Make initrd-stress.img built by default suggested by Fabiano Rosas
3. Make the necessary changes to adapt the latest multifd behavior
4. A nitpick for multifd migration
5. Support multifd compression option
Please review,
Thanks
Yong
Hyman Huang (5):
tests/migration: Move the guestperf tool to scripts directory tests/migration: Make initrd-stress.img built by default
guestperf: Support deferred migration for multifd
guestperf: Nitpick the inconsistent parameters
guestperf: Introduce multifd compression option
MAINTAINERS | 5 ++++
{tests => scripts}/migration/guestperf-batch.py | 0
{tests => scripts}/migration/guestperf-plot.py | 0
{tests => scripts}/migration/guestperf.py | 0
{tests => scripts}/migration/guestperf/__init__.py | 0
.../migration/guestperf/comparison.py | 15 +++++++++-
{tests => scripts}/migration/guestperf/engine.py | 32 +++++++++++++++++++---
{tests => scripts}/migration/guestperf/hardware.py | 0
{tests => scripts}/migration/guestperf/plot.py | 0
{tests => scripts}/migration/guestperf/progress.py | 0
{tests => scripts}/migration/guestperf/report.py | 0
{tests => scripts}/migration/guestperf/scenario.py | 7 +++--
{tests => scripts}/migration/guestperf/shell.py | 3 ++
{tests => scripts}/migration/guestperf/timings.py | 0
tests/migration/meson.build | 5 ++--
15 files changed, 58 insertions(+), 9 deletions(-)
rename {tests => scripts}/migration/guestperf-batch.py (100%)
rename {tests => scripts}/migration/guestperf-plot.py (100%)
rename {tests => scripts}/migration/guestperf.py (100%)
rename {tests => scripts}/migration/guestperf/__init__.py (100%)
rename {tests => scripts}/migration/guestperf/comparison.py (89%)
rename {tests => scripts}/migration/guestperf/engine.py (93%)
rename {tests => scripts}/migration/guestperf/hardware.py (100%)
rename {tests => scripts}/migration/guestperf/plot.py (100%)
rename {tests => scripts}/migration/guestperf/progress.py (100%)
rename {tests => scripts}/migration/guestperf/report.py (100%)
rename {tests => scripts}/migration/guestperf/scenario.py (93%)
rename {tests => scripts}/migration/guestperf/shell.py (98%)
rename {tests => scripts}/migration/guestperf/timings.py (100%)Signature · 1 line
2.11.0
PATCH 1/5 tests/migration: Move the guestperf tool to scripts directory
From: Hyman Huang <[email protected]>
Guestperf was designed to test the performance of migration, with a loose connection to the fundamental test cases of QEMU.
To improve the repository's structure, move it to the scripts directory.
---
MAINTAINERS | 5 +++++
{tests => scripts}/migration/guestperf-batch.py | 0
{tests => scripts}/migration/guestperf-plot.py | 0
{tests => scripts}/migration/guestperf.py | 0
{tests => scripts}/migration/guestperf/__init__.py | 0
{tests => scripts}/migration/guestperf/comparison.py | 0
{tests => scripts}/migration/guestperf/engine.py | 0
{tests => scripts}/migration/guestperf/hardware.py | 0
{tests => scripts}/migration/guestperf/plot.py | 0
{tests => scripts}/migration/guestperf/progress.py | 0
{tests => scripts}/migration/guestperf/report.py | 0
{tests => scripts}/migration/guestperf/scenario.py | 0
{tests => scripts}/migration/guestperf/shell.py | 0
{tests => scripts}/migration/guestperf/timings.py | 0
14 files changed, 5 insertions(+)
rename {tests => scripts}/migration/guestperf-batch.py (100%)
rename {tests => scripts}/migration/guestperf-plot.py (100%)
rename {tests => scripts}/migration/guestperf.py (100%)
rename {tests => scripts}/migration/guestperf/__init__.py (100%)
rename {tests => scripts}/migration/guestperf/comparison.py (100%)
rename {tests => scripts}/migration/guestperf/engine.py (100%)
rename {tests => scripts}/migration/guestperf/hardware.py (100%)
rename {tests => scripts}/migration/guestperf/plot.py (100%)
rename {tests => scripts}/migration/guestperf/progress.py (100%)
rename {tests => scripts}/migration/guestperf/report.py (100%)
rename {tests => scripts}/migration/guestperf/scenario.py (100%)
rename {tests => scripts}/migration/guestperf/shell.py (100%)
rename {tests => scripts}/migration/guestperf/timings.py (100%)MAINTAINERS +5 -0
@@ -3449,6 +3449,11 @@ F: migration/dirtyrate.h F: include/sysemu/dirtyrate.h F: docs/devel/migration/dirty-limit.rst +Migration performance test tool +M: Hyman Huang <[email protected]> +S: Maintained +F: scripts/migration/ + Detached LUKS header M: Hyman Huang <[email protected]> S: Maintained
scripts/migration/guestperf-batch.py renamed from tests/migration/guestperf-batch.py +0 -0
scripts/migration/guestperf-plot.py renamed from tests/migration/guestperf-plot.py +0 -0
scripts/migration/guestperf.py renamed from tests/migration/guestperf.py +0 -0
scripts/migration/guestperf/__init__.py renamed from tests/migration/guestperf/__init__.py +0 -0
scripts/migration/guestperf/comparison.py renamed from tests/migration/guestperf/comparison.py +0 -0
scripts/migration/guestperf/engine.py renamed from tests/migration/guestperf/engine.py +0 -0
scripts/migration/guestperf/hardware.py renamed from tests/migration/guestperf/hardware.py +0 -0
scripts/migration/guestperf/plot.py renamed from tests/migration/guestperf/plot.py +0 -0
scripts/migration/guestperf/progress.py renamed from tests/migration/guestperf/progress.py +0 -0
scripts/migration/guestperf/report.py renamed from tests/migration/guestperf/report.py +0 -0
scripts/migration/guestperf/scenario.py renamed from tests/migration/guestperf/scenario.py +0 -0
scripts/migration/guestperf/shell.py renamed from tests/migration/guestperf/shell.py +0 -0
scripts/migration/guestperf/timings.py renamed from tests/migration/guestperf/timings.py +0 -0
Signature · 1 line
2.11.0
Re: [PATCH v1 1/5] tests/migration: Move the guestperf tool to scripts directory
Quoted 44 lines · [email protected] writes:
From: Hyman Huang <[email protected]>
Guestperf was designed to test the performance of migration, with a loose connection to the fundamental test cases of QEMU.
To improve the repository's structure, move it to the scripts directory.
Signed-off-by Hyman Huang <[email protected]>--- MAINTAINERS | 5 +++++ {tests => scripts}/migration/guestperf-batch.py | 0 {tests => scripts}/migration/guestperf-plot.py | 0 {tests => scripts}/migration/guestperf.py | 0 {tests => scripts}/migration/guestperf/__init__.py | 0 {tests => scripts}/migration/guestperf/comparison.py | 0 {tests => scripts}/migration/guestperf/engine.py | 0 {tests => scripts}/migration/guestperf/hardware.py | 0 {tests => scripts}/migration/guestperf/plot.py | 0 {tests => scripts}/migration/guestperf/progress.py | 0 {tests => scripts}/migration/guestperf/report.py | 0 {tests => scripts}/migration/guestperf/scenario.py | 0 {tests => scripts}/migration/guestperf/shell.py | 0 {tests => scripts}/migration/guestperf/timings.py | 0 14 files changed, 5 insertions(+) rename {tests => scripts}/migration/guestperf-batch.py (100%) rename {tests => scripts}/migration/guestperf-plot.py (100%) rename {tests => scripts}/migration/guestperf.py (100%) rename {tests => scripts}/migration/guestperf/__init__.py (100%) rename {tests => scripts}/migration/guestperf/comparison.py (100%) rename {tests => scripts}/migration/guestperf/engine.py (100%) rename {tests => scripts}/migration/guestperf/hardware.py (100%) rename {tests => scripts}/migration/guestperf/plot.py (100%) rename {tests => scripts}/migration/guestperf/progress.py (100%) rename {tests => scripts}/migration/guestperf/report.py (100%) rename {tests => scripts}/migration/guestperf/scenario.py (100%) rename {tests => scripts}/migration/guestperf/shell.py (100%) rename {tests => scripts}/migration/guestperf/timings.py (100%)MAINTAINERS +0
-0
MAINTAINERS F: migration/dirtyrate.h · line 3455
Quoted 7 lines
MAINTAINERS +4
-0@@ -3449,6 +3449,11 @@ F: migration/dirtyrate.h F: include/sysemu/dirtyrate.h F: docs/devel/migration/dirty-limit.rst +Migration performance test tool +M: Hyman Huang <[email protected]> +S: Maintained +F: scripts/migration/
This probably needs to be scripts/migration/guestperf* unless of course you intend to maintain all scripts that show up under scripts/migration/. We have analyze-migration.py and vmstate-static-checker.py which are candidates to be put in that same directory.
Quoted 56 lines
MAINTAINERS +1
-0+ Detached LUKS header M: Hyman Huang <[email protected]> S: Maintainedscripts/migration/guestperf-batch.py renamed from tests/migration/guestperf-batch.py +0
-0scripts/migration/guestperf-plot.py renamed from tests/migration/guestperf-plot.py +0
-0scripts/migration/guestperf.py renamed from tests/migration/guestperf.py +0
-0scripts/migration/guestperf/__init__.py renamed from tests/migration/guestperf/__init__.py +0
-0scripts/migration/guestperf/comparison.py renamed from tests/migration/guestperf/comparison.py +0
-0scripts/migration/guestperf/engine.py renamed from tests/migration/guestperf/engine.py +0
-0scripts/migration/guestperf/hardware.py renamed from tests/migration/guestperf/hardware.py +0
-0scripts/migration/guestperf/plot.py renamed from tests/migration/guestperf/plot.py +0
-0scripts/migration/guestperf/progress.py renamed from tests/migration/guestperf/progress.py +0
-0scripts/migration/guestperf/report.py renamed from tests/migration/guestperf/report.py +0
-0scripts/migration/guestperf/scenario.py renamed from tests/migration/guestperf/scenario.py +0
-0scripts/migration/guestperf/shell.py renamed from tests/migration/guestperf/shell.py +0
-0scripts/migration/guestperf/timings.py renamed from tests/migration/guestperf/timings.py +0
-0
Re: [PATCH v1 1/5] tests/migration: Move the guestperf tool to scripts directory
Quoted 49 lines · Fabiano Rosas
Quoted 47 lines · [email protected] writes:
From: Hyman Huang <[email protected]>
Guestperf was designed to test the performance of migration, with a loose connection to the fundamental test cases of QEMU.
To improve the repository's structure, move it to the scripts directory.
Signed-off-by Hyman Huang <[email protected]>--- MAINTAINERS | 5 +++++ {tests => scripts}/migration/guestperf-batch.py | 0 {tests => scripts}/migration/guestperf-plot.py | 0 {tests => scripts}/migration/guestperf.py | 0 {tests => scripts}/migration/guestperf/__init__.py | 0 {tests => scripts}/migration/guestperf/comparison.py | 0 {tests => scripts}/migration/guestperf/engine.py | 0 {tests => scripts}/migration/guestperf/hardware.py | 0 {tests => scripts}/migration/guestperf/plot.py | 0 {tests => scripts}/migration/guestperf/progress.py | 0 {tests => scripts}/migration/guestperf/report.py | 0 {tests => scripts}/migration/guestperf/scenario.py | 0 {tests => scripts}/migration/guestperf/shell.py | 0 {tests => scripts}/migration/guestperf/timings.py | 0 14 files changed, 5 insertions(+)rename {tests =>
scripts}/migration/guestperf-batch.py(100%) rename {tests =>scripts}/migration/guestperf-plot.py(100%) rename {tests =>scripts}/migration/guestperf.py(100%) rename {tests =>scripts}/migration/guestperf/__init__.py(100%) rename {tests =>scripts}/migration/guestperf/comparison.py(100%) rename {tests =>scripts}/migration/guestperf/engine.py(100%) rename {tests =>scripts}/migration/guestperf/hardware.py(100%) rename {tests =>scripts}/migration/guestperf/plot.py(100%) rename {tests =>scripts}/migration/guestperf/progress.py(100%) rename {tests =>scripts}/migration/guestperf/report.py(100%) rename {tests =>scripts}/migration/guestperf/scenario.py(100%) rename {tests =>scripts}/migration/guestperf/shell.py(100%) rename {tests =>scripts}/migration/guestperf/timings.py(100%)MAINTAINERS +0
-0@@ -3449,6 +3449,11 @@ F: migration/dirtyrate.h F: include/sysemu/dirtyrate.h F: docs/devel/migration/dirty-limit.rst
Quoted 9 lines
MAINTAINERS F: migration/dirtyrate.h · line 3455
Quoted 4 lines
MAINTAINERS +4
-0+Migration performance test tool +M: Hyman Huang <[email protected]> +S: Maintained +F: scripts/migration/This probably needs to be
scripts/migration/guestperf*unless of course you intend to maintain all scripts that show up underscripts/migration/. We haveanalyze-migration.pyandvmstate-static-checker.pywhich are candidates to be put in that same directory.
Ok, I'll update this section in the next version.
Quoted 57 lines
Quoted 57 lines
MAINTAINERS +1
-0+ Detached LUKS header M: Hyman Huang <[email protected]> S: Maintainedscripts/migration/guestperf-batch.py renamed from tests/migration/guestperf-batch.py +0
-0scripts/migration/guestperf-plot.py renamed from tests/migration/guestperf-plot.py +0
-0scripts/migration/guestperf.py renamed from tests/migration/guestperf.py +0
-0scripts/migration/guestperf/__init__.py renamed from tests/migration/guestperf/__init__.py +0
-0scripts/migration/guestperf/comparison.py renamed from tests/migration/guestperf/comparison.py +0
-0scripts/migration/guestperf/engine.py renamed from tests/migration/guestperf/engine.py +0
-0scripts/migration/guestperf/hardware.py renamed from tests/migration/guestperf/hardware.py +0
-0scripts/migration/guestperf/plot.py renamed from tests/migration/guestperf/plot.py +0
-0scripts/migration/guestperf/progress.py renamed from tests/migration/guestperf/progress.py +0
-0scripts/migration/guestperf/report.py renamed from tests/migration/guestperf/report.py +0
-0scripts/migration/guestperf/scenario.py renamed from tests/migration/guestperf/scenario.py +0
-0scripts/migration/guestperf/shell.py renamed from tests/migration/guestperf/shell.py +0
-0scripts/migration/guestperf/timings.py renamed from tests/migration/guestperf/timings.py +0
-0
PATCH 2/5 tests/migration: Make initrd-stress.img built by default
In reply to [email protected]From: Hyman Huang <[email protected]>
The initrd-stress.img was compiled by specifying the target, to make it easier for developers to play the guestperf tool, make it built by default.
--- tests/migration/meson.build | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
tests/migration/meson.build +3 -2
@@ -7,12 +7,13 @@ stress = executable( files('stress.c'), dependencies: [glib_static, sysprof], link_args: ['-static'], - build_by_default: false, + build_by_default: true, ) custom_target( 'initrd-stress.img', output: 'initrd-stress.img', input: stress, - command: [find_program('initrd-stress.sh'), '@OUTPUT@', '@INPUT@'] + command: [find_program('initrd-stress.sh'), '@OUTPUT@', '@INPUT@'], + build_by_default: true, )
Signature · 1 line
2.11.0
Re: [PATCH v1 2/5] tests/migration: Make initrd-stress.img built by default
Quoted 5 lines · On Fri, Aug 09, 2024 at 03:43:33PM +0800, [email protected] wrote:
From: Hyman Huang <[email protected]>
The initrd-stress.img was compiled by specifying the target, to make it easier for developers to play the guestperf tool, make it built by default.
If you're going to do this, then you will need to make sure it is only built on a Linux host, and when glib static & sysprof are found. eg
if host_os == 'linux' && glib_static.found() && sysprof.found()
Quoted 30 lines
Signed-off-by Hyman Huang <[email protected]>--- tests/migration/meson.build | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)tests/migration/meson.build +3
-2@@ -7,12 +7,13 @@ stress = executable( files('stress.c'), dependencies: [glib_static, sysprof], link_args: ['-static'], - build_by_default: false, + build_by_default: true, ) custom_target( 'initrd-stress.img', output: 'initrd-stress.img', input: stress, - command: [find_program('initrd-stress.sh'), '@OUTPUT@', '@INPUT@'] + command: [find_program('initrd-stress.sh'), '@OUTPUT@', '@INPUT@'], + build_by_default: true, )Signature · 1 line
2.11.0
With regards,
Daniel
Signature · 3 lines
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
Re: [PATCH v1 2/5] tests/migration: Make initrd-stress.img built by default
Quoted 11 lines · Daniel P. Berrangé
Quoted 5 lines · On Fri, Aug 09, 2024 at 03:43:33PM +0800, [email protected] wrote:
From: Hyman Huang <[email protected]>
The initrd-stress.img was compiled by specifying the target, to make it easier for developers to play the guestperf tool, make it built by default.
If you're going to do this, then you will need to make sure it is only built on a Linux host, and when glib static & sysprof are found. eg
if host_os == 'linux' && glib_static.found() && sysprof.found()
Ok, thanks for the comments, I'll add the check in the next version.
Quoted 44 lines
Quoted 29 lines
Signed-off-by Hyman Huang <[email protected]>--- tests/migration/meson.build | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)tests/migration/meson.build +3
-3@@ -7,12 +7,13 @@ stress = executable( files('stress.c'), dependencies: [glib_static, sysprof], link_args: ['-static'], - build_by_default: false, + build_by_default: true, ) custom_target( 'initrd-stress.img', output: 'initrd-stress.img', input: stress, - command: [find_program('initrd-stress.sh'), '@OUTPUT@', '@INPUT@'] + command: [find_program('initrd-stress.sh'), '@OUTPUT@', '@INPUT@'], + build_by_default: true, ) --Quoted 3 lines
2.11.0
With regards,
Daniel
--
|: https://berrange.com -o-
https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o-
https://fstop138.berrange.com :|
|: https://entangle-photo.org -o-
https://www.instagram.com/dberrange :|
Signature · 1 line
Best regards
Re: [PATCH v1 2/5] tests/migration: Make initrd-stress.img built by default
In reply to [email protected]Quoted 9 lines · [email protected] writes:
From: Hyman Huang <[email protected]>
The initrd-stress.img was compiled by specifying the target, to make it easier for developers to play the guestperf tool, make it built by default.
Signed-off-by Hyman Huang <[email protected]>--- tests/migration/meson.build | 5 +++--
This could have moved along with the rest of guestperf. There's already a scripts/meson.build where these could go.
PATCH 3/5 guestperf: Support deferred migration for multifd
In reply to [email protected]From: Hyman Huang <[email protected]>
The way to enable multifd migration has been changed by commit, 82137e6c8c (migration: enforce multifd and postcopy preempt to be set before incoming), and guestperf has not made the necessary changes. If multifd migration had been enabled in the previous manner, the following error would have occurred:
Multifd must be set before incoming starts
Supporting deferred migration will fix it.
--- scripts/migration/guestperf/engine.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-)
scripts/migration/guestperf/engine.py +14 -4
@@ -106,7 +106,8 @@ def _migrate_progress(self, vm): info.get("dirty-limit-ring-full-time", 0), ) - def _migrate(self, hardware, scenario, src, dst, connect_uri): + def _migrate(self, hardware, scenario, src, + dst, connect_uri, defer_migrate): src_qemu_time = [] src_vcpu_time = [] src_pid = src.get_pid()
@@ -220,6 +221,8 @@ def _migrate(self, hardware, scenario, src, dst, connect_uri): resp = src.cmd("migrate-set-parameters", vcpu_dirty_limit=scenario._vcpu_dirty_limit) + if defer_migrate: + resp = dst.cmd("migrate-incoming", uri=connect_uri) resp = src.cmd("migrate", uri=connect_uri) post_copy = False
@@ -373,11 +376,14 @@ def _get_common_args(self, hardware, tunnelled=False): def _get_src_args(self, hardware): return self._get_common_args(hardware) - def _get_dst_args(self, hardware, uri): + def _get_dst_args(self, hardware, uri, defer_migrate): tunnelled = False if self._dst_host != "localhost": tunnelled = True argv = self._get_common_args(hardware, tunnelled) + + if defer_migrate: + return argv + ["-incoming", "defer"] return argv + ["-incoming", uri] @staticmethod
@@ -439,6 +445,9 @@ def run(self, hardware, scenario, result_dir=os.getcwd()): except: pass + if scenario._multifd: + defer_migrate = True + if self._dst_host != "localhost": dstmonaddr = ("localhost", 9001) else:
@@ -452,7 +461,7 @@ def run(self, hardware, scenario, result_dir=os.getcwd()): monitor_address=srcmonaddr) dst = QEMUMachine(self._binary, - args=self._get_dst_args(hardware, uri), + args=self._get_dst_args(hardware, uri, defer_migrate), wrapper=self._get_dst_wrapper(hardware), name="qemu-dst-%d" % os.getpid(), monitor_address=dstmonaddr)
@@ -461,7 +470,8 @@ def run(self, hardware, scenario, result_dir=os.getcwd()): src.launch() dst.launch() - ret = self._migrate(hardware, scenario, src, dst, uri) + ret = self._migrate(hardware, scenario, src, + dst, uri, defer_migrate) progress_history = ret[0] qemu_timings = ret[1] vcpu_timings = ret[2]
Signature · 1 line
2.11.0
PATCH 4/5 guestperf: Nitpick the inconsistent parameters
In reply to [email protected]From: Hyman Huang <[email protected]>
--- scripts/migration/guestperf/comparison.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/migration/guestperf/comparison.py +1 -1
@@ -127,7 +127,7 @@ def __init__(self, name, scenarios): # varying numbers of channels Comparison("compr-multifd", scenarios = [ Scenario("compr-multifd-channels-4", - multifd=True, multifd_channels=2), + multifd=True, multifd_channels=4), Scenario("compr-multifd-channels-8", multifd=True, multifd_channels=8), Scenario("compr-multifd-channels-32",
Signature · 1 line
2.11.0
PATCH 5/5 guestperf: Introduce multifd compression option
In reply to [email protected]From: Hyman Huang <[email protected]>
Guestperf tool does not cover the multifd compression option currently, it is worth supporting so that developers can analysis the migration performance with different compression algorithms.
Multifd support 4 compression algorithms currently:
zlib, zstd, qpl, uadk
To request that multifd with the specified compression algorithm such as zlib:
$ ./scripts/migration/guestperf.py \
--multifd --multifd-channels 4 --multifd-compression zlib \
--output output.jsonTo run the entire standardized set of multifd compression comparisons, with unix migration:
$ ./scripts/migration/guestperf-batch.py \
--dst-host localhost --transport unix \
--filter compr-multifd-compression* --output outputdir--- scripts/migration/guestperf/comparison.py | 13 +++++++++++++ scripts/migration/guestperf/engine.py | 14 ++++++++++++++ scripts/migration/guestperf/scenario.py | 7 +++++-- scripts/migration/guestperf/shell.py | 3 +++ 4 files changed, 35 insertions(+), 2 deletions(-)
scripts/migration/guestperf/comparison.py +13 -0
@@ -158,4 +158,17 @@ def __init__(self, name, scenarios): Scenario("compr-dirty-limit-50MB", dirty_limit=True, vcpu_dirty_limit=50), ]), + + # Looking at effect of multifd with + # different compression algorithms + Comparison("compr-multifd-compression", scenarios = [ + Scenario("compr-multifd-compression-zlib", + multifd=True, multifd_channels=4, multifd_compression="zlib"), + Scenario("compr-multifd-compression-zstd", + multifd=True, multifd_channels=4, multifd_compression="zstd"), + Scenario("compr-multifd-compression-qpl", + multifd=True, multifd_channels=4, multifd_compression="qpl"), + Scenario("compr-multifd-compression-uadk", + multifd=True, multifd_channels=4, multifd_compression="uadk"), + ]), ]
scripts/migration/guestperf/engine.py +14 -0
@@ -31,6 +31,8 @@ '..', '..', '..', 'python')) from qemu.machine import QEMUMachine +# multifd supported compression algorithms +MULTIFD_CMP_ALGS = ("zlib", "zstd", "qpl", "uadk") class Engine(object):
@@ -191,6 +193,12 @@ def _migrate(self, hardware, scenario, src, scenario._compression_xbzrle_cache)) if scenario._multifd: + if (scenario._multifd_compression and + (scenario._multifd_compression not in MULTIFD_CMP_ALGS)): + raise Exception("unsupported multifd compression " + "algorithm: %s" % + scenario._multifd_compression) + resp = src.cmd("migrate-set-capabilities", capabilities = [ { "capability": "multifd",
@@ -206,6 +214,12 @@ def _migrate(self, hardware, scenario, src, resp = dst.cmd("migrate-set-parameters", multifd_channels=scenario._multifd_channels) + if scenario._multifd_compression: + resp = src.cmd("migrate-set-parameters", + multifd_compression=scenario._multifd_compression) + resp = dst.cmd("migrate-set-parameters", + multifd_compression=scenario._multifd_compression) + if scenario._dirty_limit: if not hardware._dirty_ring_size: raise Exception("dirty ring size must be configured when "
scripts/migration/guestperf/scenario.py +5 -2
@@ -30,7 +30,7 @@ def __init__(self, name, auto_converge=False, auto_converge_step=10, compression_mt=False, compression_mt_threads=1, compression_xbzrle=False, compression_xbzrle_cache=10, - multifd=False, multifd_channels=2, + multifd=False, multifd_channels=2, multifd_compression="", dirty_limit=False, x_vcpu_dirty_limit_period=500, vcpu_dirty_limit=1):
@@ -61,6 +61,7 @@ def __init__(self, name, self._multifd = multifd self._multifd_channels = multifd_channels + self._multifd_compression = multifd_compression self._dirty_limit = dirty_limit self._x_vcpu_dirty_limit_period = x_vcpu_dirty_limit_period
@@ -85,6 +86,7 @@ def serialize(self): "compression_xbzrle_cache": self._compression_xbzrle_cache, "multifd": self._multifd, "multifd_channels": self._multifd_channels, + "multifd_compression": self._multifd_compression, "dirty_limit": self._dirty_limit, "x_vcpu_dirty_limit_period": self._x_vcpu_dirty_limit_period, "vcpu_dirty_limit": self._vcpu_dirty_limit,
@@ -109,4 +111,5 @@ def deserialize(cls, data): data["compression_xbzrle"], data["compression_xbzrle_cache"], data["multifd"], - data["multifd_channels"]) + data["multifd_channels"], + data["multifd_compression"])
scripts/migration/guestperf/shell.py +3 -0
@@ -130,6 +130,8 @@ def __init__(self): action="store_true") parser.add_argument("--multifd-channels", dest="multifd_channels", default=2, type=int) + parser.add_argument("--multifd-compression", dest="multifd_compression", + default="") parser.add_argument("--dirty-limit", dest="dirty_limit", default=False, action="store_true")
@@ -166,6 +168,7 @@ def get_scenario(self, args): multifd=args.multifd, multifd_channels=args.multifd_channels, + multifd_compression=args.multifd_compression, dirty_limit=args.dirty_limit, x_vcpu_dirty_limit_period=\
Signature · 1 line
2.11.0