Skip to contentSkip to conversation

migration: do not transfer ram during bulk storage migration

PATCH In review Peter Lieven 3 participants 3 messages Feb 20, 2018 – Feb 24, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 migration: do not transfer ram during bulk storage migration

this patch makes the bulk phase of a block migration to take place before we start transferring ram. As the bulk block migration can take a long time its pointless to transfer ram during that phase.

---
 migration/ram.c | 8 ++++++++
 1 file changed, 8 insertions(+)
migration/ram.c +8 -0
index 5e33e5c..42468ee 100644
@@ -2258,6 +2258,13 @@ static int ram_save_iterate(QEMUFile *f, void *opaque)
     int64_t t0;
     int done = 0;
 
+    if (blk_mig_bulk_active()) {
+        /* Avoid transferring ram during bulk phase of block migration as
+         * the bulk phase will usually take a long time and transferring
+         * ram updates during that time is pointless. */
+        goto out;
+    }
+
     rcu_read_lock();
     if (ram_list.version != rs->last_version) {
         ram_state_reset(rs);
@@ -2304,6 +2311,7 @@ static int ram_save_iterate(QEMUFile *f, void *opaque)
      */
     ram_control_after_iterate(f, RAM_CONTROL_ROUND);
 
+out:
     qemu_put_be64(f, RAM_SAVE_FLAG_EOS);
     ram_counters.transferred += 8;
 
Signature · 1 line
2.7.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Peter Lieven

this patch makes the bulk phase of a block migration to take place before we start transferring ram. As the bulk block migration can take a long time its pointless to transfer ram during that phase.

---
 migration/ram.c | 8 ++++++++
 1 file changed, 8 insertions(+)

This makes sense to me:

#2 lore raw
In reply to Peter Lieven
This series failed docker-build@min-glib build test. Please find the testing commands and their output below. If you have Docker installed, you can probably reproduce it locally.

Hi,

This series failed docker-build@min-glib build test. Please find the testing commands and their output below. If you have Docker installed, you can probably reproduce it locally.

Type: series
Message-id: [email protected]
Subject: [Qemu-devel] [PATCH] migration: do not transfer ram during bulk storage migration

=== TEST SCRIPT BEGIN === #!/bin/bash
set -e
git submodule update --init dtc
# Let docker tests dump environment info export SHOW_ENV=1
export J=8
time make docker-test-build@min-glib === TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384 From https://github.com/patchew-project/qemu

   205e3e78d2..0a773d55ac  master     -> master
 t [tag update]            patchew/[email protected] -> patchew/[email protected]
 t [tag update]            patchew/[email protected] -> patchew/[email protected]
 * [new tag]               patchew/[email protected] -> patchew/[email protected]
 * [new tag]               patchew/[email protected] -> patchew/[email protected]
 * [new tag]               patchew/[email protected] -> patchew/[email protected]
 * [new tag]               patchew/[email protected] -> patchew/[email protected]
 * [new tag]               patchew/[email protected] -> patchew/[email protected]
 t [tag update]            patchew/[email protected] -> patchew/[email protected]
 t [tag update]            patchew/[email protected] -> patchew/[email protected]
 t [tag update]            patchew/[email protected] -> patchew/[email protected]
 t [tag update]            patchew/[email protected] -> patchew/[email protected]
 * [new tag]               patchew/[email protected] -> patchew/[email protected]
 * [new tag]               patchew/[email protected] -> patchew/[email protected]
 * [new tag]               patchew/[email protected] -> patchew/[email protected]
 * [new tag]               patchew/[email protected] -> patchew/[email protected]
 * [new tag]               patchew/[email protected] -> patchew/[email protected]
 * [new tag]               patchew/[email protected] -> patchew/[email protected]
 * [new tag]               patchew/[email protected] -> patchew/[email protected]
 * [new tag]               patchew/[email protected] -> patchew/[email protected]
 * [new tag]               patchew/[email protected] -> patchew/[email protected]
 * [new tag]               patchew/[email protected] -> patchew/[email protected]
 * [new tag]               patchew/[email protected] -> patchew/[email protected]
 * [new tag]               patchew/[email protected] -> patchew/[email protected]
 * [new tag]               patchew/[email protected] -> patchew/[email protected]
 * [new tag]               patchew/[email protected] -> patchew/[email protected]
 * [new tag]               patchew/[email protected] -> patchew/[email protected]

Switched to a new branch 'test'
83862115e8 migration: do not transfer ram during bulk storage migration

=== OUTPUT BEGIN ===
Submodule 'dtc' (git://git.qemu-project.org/dtc.git) registered for path 'dtc'
Cloning into '/var/tmp/patchew-tester-tmp-b2bnyei8/src/dtc'...
Submodule path 'dtc': checked out 'e54388015af1fb4bf04d0bca99caba1074d9cc42'
BUILD min-glib
make[1]: Entering directory '/var/tmp/patchew-tester-tmp-b2bnyei8/src'
GEN /var/tmp/patchew-tester-tmp-b2bnyei8/src/docker-src.2018-02-23-22.39.25.21756/qemu.tar
Cloning into '/var/tmp/patchew-tester-tmp-b2bnyei8/src/docker-src.2018-02-23-22.39.25.21756/qemu.tar.vroot'... done.

Checking out files:  40% (2376/5855)   
Checking out files:  41% (2401/5855)   
Checking out files:  42% (2460/5855)   
Checking out files:  43% (2518/5855)   
Checking out files:  44% (2577/5855)   
Checking out files:  45% (2635/5855)   
Checking out files:  46% (2694/5855)   
Checking out files:  47% (2752/5855)   
Checking out files:  48% (2811/5855)   
Checking out files:  49% (2869/5855)   
Checking out files:  49% (2901/5855)   
Checking out files:  50% (2928/5855)   
Checking out files:  51% (2987/5855)   
Checking out files:  52% (3045/5855)   
Checking out files:  53% (3104/5855)   
Checking out files:  53% (3123/5855)   
Checking out files:  54% (3162/5855)   
Checking out files:  54% (3182/5855)   
Checking out files:  55% (3221/5855)   
Checking out files:  56% (3279/5855)   
Checking out files:  56% (3328/5855)   
Checking out files:  57% (3338/5855)   
Checking out files:  58% (3396/5855)   
Checking out files:  59% (3455/5855)   
Checking out files:  60% (3513/5855)   
Checking out files:  61% (3572/5855)   
Checking out files:  62% (3631/5855)   
Checking out files:  63% (3689/5855)   
Checking out files:  64% (3748/5855)   
Checking out files:  65% (3806/5855)   
Checking out files:  66% (3865/5855)   
Checking out files:  67% (3923/5855)   
Checking out files:  68% (3982/5855)   
Checking out files:  69% (4040/5855)   
Checking out files:  70% (4099/5855)   
Checking out files:  71% (4158/5855)   
Checking out files:  72% (4216/5855)   
Checking out files:  73% (4275/5855)   
Checking out files:  74% (4333/5855)   
Checking out files:  75% (4392/5855)   
Checking out files:  76% (4450/5855)   
Checking out files:  77% (4509/5855)   
Checking out files:  78% (4567/5855)   
Checking out files:  79% (4626/5855)   
Checking out files:  80% (4684/5855)   
Checking out files:  81% (4743/5855)   
Checking out files:  82% (4802/5855)   
Checking out files:  83% (4860/5855)   
Checking out files:  84% (4919/5855)   
Checking out files:  84% (4932/5855)   
Checking out files:  85% (4977/5855)   
Checking out files:  86% (5036/5855)   
Checking out files:  87% (5094/5855)   
Checking out files:  88% (5153/5855)   
Checking out files:  89% (5211/5855)   
Checking out files:  90% (5270/5855)   
Checking out files:  91% (5329/5855)   
Checking out files:  92% (5387/5855)   
Checking out files:  93% (5446/5855)   
Checking out files:  94% (5504/5855)   
Checking out files:  95% (5563/5855)   
Checking out files:  96% (5621/5855)   
Checking out files:  97% (5680/5855)   
Checking out files:  98% (5738/5855)   
Checking out files:  99% (5797/5855)   
Checking out files: 100% (5855/5855)   
Checking out files: 100% (5855/5855), done.

Your branch is up-to-date with 'origin/test'.
Submodule 'dtc' (git://git.qemu-project.org/dtc.git) registered for path 'dtc'
Cloning into '/var/tmp/patchew-tester-tmp-b2bnyei8/src/docker-src.2018-02-23-22.39.25.21756/qemu.tar.vroot/dtc'... Submodule path 'dtc': checked out 'e54388015af1fb4bf04d0bca99caba1074d9cc42'
Submodule 'ui/keycodemapdb' (git://git.qemu.org/keycodemapdb.git) registered for path 'ui/keycodemapdb' Cloning into '/var/tmp/patchew-tester-tmp-b2bnyei8/src/docker-src.2018-02-23-22.39.25.21756/qemu.tar.vroot/ui/keycodemapdb'... Submodule path 'ui/keycodemapdb': checked out '6b3d716e2b6472eb7189d3220552280ef3d832ce'
COPY RUNNER
RUN test-build in qemu:min-glib
Environment variables:
HOSTNAME=4e27a71bcc27
MAKEFLAGS= -j8
J=8
CCACHE_DIR=/var/tmp/ccache
EXTRA_CONFIGURE_OPTS=
V=
SHOW_ENV=1 PATH=/usr/lib/ccache:/usr/lib64/ccache:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
PWD=/
TARGET_LIST=
SHLVL=1
HOME=/root
TEST_DIR=/tmp/qemu-test
FEATURES= dtc
DEBUG=
_=/usr/bin/env

Configure options:
--enable-werror --target-list=x86_64-softmmu,aarch64-softmmu --prefix=/tmp/qemu-test/install Traceback (most recent call last):
File "./tests/docker/docker.py", line 407, in <module>

    sys.exit(main())

File "./tests/docker/docker.py", line 404, in main
return args.cmdobj.run(args, argv)
File "./tests/docker/docker.py", line 261, in run
return Docker().run(argv, args.keep, quiet=args.quiet)
File "./tests/docker/docker.py", line 229, in run
quiet=quiet)
File "./tests/docker/docker.py", line 147, in _do_check
return subprocess.check_call(self._command + cmd, **kwargs)
File "/usr/lib64/python2.7/subprocess.py", line 186, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['docker', 'run', '--label', 'com.qemu.instance.uuid=5aa38682191411e89c0452540069c830', '-u', '0', '--security-opt', 'seccomp=unconfined', '--rm', '--net=none', '-e', 'TARGET_LIST=', '-e', 'EXTRA_CONFIGURE_OPTS=', '-e', 'V=', '-e', 'J=8', '-e', 'DEBUG=', '-e', 'SHOW_ENV=1', '-e', 'CCACHE_DIR=/var/tmp/ccache', '-v', '/root/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-b2bnyei8/src/docker-src.2018-02-23-22.39.25.21756:/var/tmp/qemu:z,ro', 'qemu:min-glib', '/var/tmp/qemu/run', 'test-build']' returned non-zero exit status 137 make[1]: *** [tests/docker/Makefile.include:129: docker-run] Error 1
make[1]: Leaving directory '/var/tmp/patchew-tester-tmp-b2bnyei8/src'
make: *** [tests/docker/Makefile.include:163: docker-run-test-build@min-glib] Error 2

real 0m54.460s
user 0m5.095s
sys 0m7.751s
=== OUTPUT END ===

Test command exited with code: 2

---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to [email protected]