diff mbox series

migration: do not transfer ram during bulk storage migration

Message ID 1519139403-2646-1-git-send-email-pl@kamp.de
State New
Headers show
Series migration: do not transfer ram during bulk storage migration | expand

Commit Message

Peter Lieven Feb. 20, 2018, 3:10 p.m. UTC
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.

Signed-off-by: Peter Lieven <pl@kamp.de>
---
 migration/ram.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Stefan Hajnoczi Feb. 21, 2018, 11:20 a.m. UTC | #1
On Tue, Feb 20, 2018 at 04:10:03PM +0100, Peter Lieven wrote:
> 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.
> 
> Signed-off-by: Peter Lieven <pl@kamp.de>
> ---
>  migration/ram.c | 8 ++++++++
>  1 file changed, 8 insertions(+)

This makes sense to me:

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
no-reply@patchew.org Feb. 24, 2018, 3:40 a.m. UTC | #2
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: 1519139403-2646-1-git-send-email-pl@kamp.de
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/1519241752-28083-1-git-send-email-walling@linux.vnet.ibm.com -> patchew/1519241752-28083-1-git-send-email-walling@linux.vnet.ibm.com
 t [tag update]            patchew/1519344729-73482-1-git-send-email-mjc@sifive.com -> patchew/1519344729-73482-1-git-send-email-mjc@sifive.com
 * [new tag]               patchew/1519390265-15576-1-git-send-email-imbrenda@linux.vnet.ibm.com -> patchew/1519390265-15576-1-git-send-email-imbrenda@linux.vnet.ibm.com
 * [new tag]               patchew/1519400599-21081-1-git-send-email-walling@linux.vnet.ibm.com -> patchew/1519400599-21081-1-git-send-email-walling@linux.vnet.ibm.com
 * [new tag]               patchew/1519407778-23095-1-git-send-email-imbrenda@linux.vnet.ibm.com -> patchew/1519407778-23095-1-git-send-email-imbrenda@linux.vnet.ibm.com
 * [new tag]               patchew/1519421985-18185-1-git-send-email-stefanb@linux.vnet.ibm.com -> patchew/1519421985-18185-1-git-send-email-stefanb@linux.vnet.ibm.com
 * [new tag]               patchew/1519439425-27883-1-git-send-email-babu.moger@amd.com -> patchew/1519439425-27883-1-git-send-email-babu.moger@amd.com
 t [tag update]            patchew/20171228180814.9749-1-lukeshu@lukeshu.com -> patchew/20171228180814.9749-1-lukeshu@lukeshu.com
 t [tag update]            patchew/20180213202701.15858-1-eblake@redhat.com -> patchew/20180213202701.15858-1-eblake@redhat.com
 t [tag update]            patchew/20180214204915.7980-1-mreitz@redhat.com -> patchew/20180214204915.7980-1-mreitz@redhat.com
 t [tag update]            patchew/20180215212552.26997-1-marcandre.lureau@redhat.com -> patchew/20180215212552.26997-1-marcandre.lureau@redhat.com
 * [new tag]               patchew/20180223095406.18251-1-cohuck@redhat.com -> patchew/20180223095406.18251-1-cohuck@redhat.com
 * [new tag]               patchew/20180223112933.4135-1-mark.cave-ayland@ilande.co.uk -> patchew/20180223112933.4135-1-mark.cave-ayland@ilande.co.uk
 * [new tag]               patchew/20180223125047.343-1-berto@igalia.com -> patchew/20180223125047.343-1-berto@igalia.com
 * [new tag]               patchew/20180223145959.18761-1-laurent@vivier.eu -> patchew/20180223145959.18761-1-laurent@vivier.eu
 * [new tag]               patchew/20180223150201.2960-1-thomas.tai@oracle.com -> patchew/20180223150201.2960-1-thomas.tai@oracle.com
 * [new tag]               patchew/20180223152640.11459-1-pbonzini@redhat.com -> patchew/20180223152640.11459-1-pbonzini@redhat.com
 * [new tag]               patchew/20180223153636.29809-1-alex.bennee@linaro.org -> patchew/20180223153636.29809-1-alex.bennee@linaro.org
 * [new tag]               patchew/20180223161226.11640-1-richard.henderson@linaro.org -> patchew/20180223161226.11640-1-richard.henderson@linaro.org
 * [new tag]               patchew/20180223164829.29683-1-bsd@redhat.com -> patchew/20180223164829.29683-1-bsd@redhat.com
 * [new tag]               patchew/20180223173657.29125-1-david@redhat.com -> patchew/20180223173657.29125-1-david@redhat.com
 * [new tag]               patchew/20180223184700.28854-1-mark.cave-ayland@ilande.co.uk -> patchew/20180223184700.28854-1-mark.cave-ayland@ilande.co.uk
 * [new tag]               patchew/20180223215858.16987-1-wei@redhat.com -> patchew/20180223215858.16987-1-wei@redhat.com
 * [new tag]               patchew/20180223232233.31482-1-frasse.iglesias@gmail.com -> patchew/20180223232233.31482-1-frasse.iglesias@gmail.com
 * [new tag]               patchew/20180223235142.21501-1-jsnow@redhat.com -> patchew/20180223235142.21501-1-jsnow@redhat.com
 * [new tag]               patchew/alpine.LSU.2.21.1802231729040.10187@wotan.suse.de -> patchew/alpine.LSU.2.21.1802231729040.10187@wotan.suse.de
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 patchew-devel@freelists.org
diff mbox series

Patch

diff --git a/migration/ram.c b/migration/ram.c
index 5e33e5c..42468ee 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -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;