Re: [Qemu-devel] [PATCH qemu v3 0/6] Fast (de)inflating & fast live migration

2016-10-30 Thread Michael S. Tsirkin
On Fri, Oct 21, 2016 at 02:48:18PM +0800, Liang Li wrote:
> This patch set intends to do two optimizations, one is to speed up
> the (de)inflating process of virtio balloon, and another one which
> is to speed up the live migration process. We put them together
> because both of them are required to change the virtio balloon spec.
>  
> The main idea of speeding up the (de)inflating process is to use
> bitmap to send the page information to host instead of the PFNs, to
> reduce the overhead of virtio data transmission, address translation
> and madvise(). This can help to improve the performance by about 85%.
>  
> The idea of speeding up live migration is to skip process guest's
> free pages in the first round of data copy, to reduce needless
> data processing, this can help to save quite a lot of CPU cycles and
> network bandwidth. We get guest's free page information through the
> virt queue of virtio-balloon, and filter out these free pages during
> live migration. For an idle 8GB guest, this can help to shorten the
> total live migration time from 2Sec to about 500ms in the 10Gbps
> network environment.

So it looks like the host/guest interface here is still in flux,
I think it's best to defer this to QEMU 2.9.

If you think otherwise, pls let me know.


> Changes from v2 to v3:
> * Merged two patches for kernel head file updating into one 
> * Removed one patch which was unrelated with this feature 
> * Removed the patch to migrate the vq elem, use a new way instead
> 
> Changes from v1 to v2:
> * Abandon the patch for dropping page cache.
> * Get a struct from vq instead of separate variables.
> * Use two separate APIs to request free pages and query the status.
> * Changed the virtio balloon interface.
> * Addressed some of the comments of v1.
> 
> Liang Li (6):
>   virtio-balloon: update linux head file
>   virtio-balloon: speed up inflating & deflating process
>   balloon: get free page info from guest
>   bitmap: Add a new bitmap_move function
>   kvm: Add two new arch specific functions
>   migration: skip free pages during live migration
> 
>  balloon.c   |  47 +++-
>  hw/virtio/virtio-balloon.c  | 273 
> ++--
>  include/hw/virtio/virtio-balloon.h  |  18 +-
>  include/qemu/bitmap.h   |  13 ++
>  include/standard-headers/linux/virtio_balloon.h |  41 
>  include/sysemu/balloon.h|  18 +-
>  include/sysemu/kvm.h|  18 ++
>  migration/ram.c |  86 
>  target-arm/kvm.c|  14 ++
>  target-i386/kvm.c   |  37 
>  target-mips/kvm.c   |  14 ++
>  target-ppc/kvm.c|  14 ++
>  target-s390x/kvm.c  |  14 ++
>  13 files changed, 581 insertions(+), 26 deletions(-)
> 
> -- 
> 1.8.3.1



Re: [Qemu-devel] [PATCH qemu v3 0/6] Fast (de)inflating & fast live migration

2016-10-21 Thread no-reply
Hi,

Your series seems to have some coding style problems. See output below for
more information:

Type: series
Message-id: 1477032504-12745-1-git-send-email-liang.z...@intel.com
Subject: [Qemu-devel] [PATCH qemu v3 0/6] Fast (de)inflating & fast live 
migration

=== TEST SCRIPT BEGIN ===
#!/bin/bash

BASE=base
n=1
total=$(git log --oneline $BASE.. | wc -l)
failed=0

# Useful git options
git config --local diff.renamelimit 0
git config --local diff.renames True

commits="$(git log --format=%H --reverse $BASE..)"
for c in $commits; do
echo "Checking PATCH $n/$total: $(git show --no-patch --format=%s $c)..."
if ! git show $c --format=email | ./scripts/checkpatch.pl --mailback -; then
failed=1
echo
fi
n=$((n+1))
done

exit $failed
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
Switched to a new branch 'test'
071260f migration: skip free pages during live migration
6a1e772 kvm: Add two new arch specific functions
506ddf9 bitmap: Add a new bitmap_move function
eb934f9 balloon: get free page info from guest
6f16986 virtio-balloon: speed up inflating & deflating process
879a4d4 virtio-balloon: update linux head file

=== OUTPUT BEGIN ===
Checking PATCH 1/6: virtio-balloon: update linux head file...
Checking PATCH 2/6: virtio-balloon: speed up inflating & deflating process...
Checking PATCH 3/6: balloon: get free page info from guest...
ERROR: suspect code indent for conditional statements (12, 17)
#145: FILE: hw/virtio/virtio-balloon.c:434:
+if (s->bmap_len < hdr.start_pfn / BITS_PER_BYTE + hdr.bmap_len) {
+ hdr.bmap_len = s->bmap_len - hdr.start_pfn / BITS_PER_BYTE;

total: 1 errors, 0 warnings, 324 lines checked

Your patch has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

Checking PATCH 4/6: bitmap: Add a new bitmap_move function...
Checking PATCH 5/6: kvm: Add two new arch specific functions...
Checking PATCH 6/6: migration: skip free pages during live migration...
=== OUTPUT END ===

Test command exited with code: 1


---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to patchew-de...@freelists.org

Re: [Qemu-devel] [PATCH qemu v3 0/6] Fast (de)inflating & fast live migration

2016-10-21 Thread no-reply
Hi,

Your series failed automatic 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: 1477032504-12745-1-git-send-email-liang.z...@intel.com
Subject: [Qemu-devel] [PATCH qemu v3 0/6] Fast (de)inflating & fast live 
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=16
make docker-test-quick@centos6
make docker-test-mingw@fedora
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
 * [new tag] 
patchew/1477032504-12745-1-git-send-email-liang.z...@intel.com -> 
patchew/1477032504-12745-1-git-send-email-liang.z...@intel.com
Switched to a new branch 'test'
071260f migration: skip free pages during live migration
6a1e772 kvm: Add two new arch specific functions
506ddf9 bitmap: Add a new bitmap_move function
eb934f9 balloon: get free page info from guest
6f16986 virtio-balloon: speed up inflating & deflating process
879a4d4 virtio-balloon: update linux head file

=== OUTPUT BEGIN ===
Submodule 'dtc' (git://git.qemu-project.org/dtc.git) registered for path 'dtc'
Cloning into 'dtc'...
Submodule path 'dtc': checked out '65cc4d2748a2c2e6f27f1cf39e07a5dbabd80ebf'
  BUILD   centos6
make[1]: Entering directory '/var/tmp/patchew-tester-tmp-snod49x1/src'
  ARCHIVE qemu.tgz
  ARCHIVE dtc.tgz
  COPYRUNNER
RUN test-quick in qemu:centos6 
Packages installed:
SDL-devel-1.2.14-7.el6_7.1.x86_64
ccache-3.1.6-2.el6.x86_64
epel-release-6-8.noarch
gcc-4.4.7-17.el6.x86_64
git-1.7.1-4.el6_7.1.x86_64
glib2-devel-2.28.8-5.el6.x86_64
libfdt-devel-1.4.0-1.el6.x86_64
make-3.81-23.el6.x86_64
package g++ is not installed
pixman-devel-0.32.8-1.el6.x86_64
tar-1.23-15.el6_8.x86_64
zlib-devel-1.2.3-29.el6.x86_64

Environment variables:
PACKAGES=libfdt-devel ccache tar git make gcc g++ zlib-devel 
glib2-devel SDL-devel pixman-devel epel-release
HOSTNAME=07028584abec
TERM=xterm
MAKEFLAGS= -j16
HISTSIZE=1000
J=16
USER=root
CCACHE_DIR=/var/tmp/ccache
EXTRA_CONFIGURE_OPTS=
V=
SHOW_ENV=1
MAIL=/var/spool/mail/root
PATH=/usr/lib/ccache:/usr/lib64/ccache:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
PWD=/
LANG=en_US.UTF-8
TARGET_LIST=
HISTCONTROL=ignoredups
SHLVL=1
HOME=/root
TEST_DIR=/tmp/qemu-test
LOGNAME=root
LESSOPEN=||/usr/bin/lesspipe.sh %s
FEATURES= dtc
DEBUG=
G_BROKEN_FILENAMES=1
CCACHE_HASHDIR=
_=/usr/bin/env

Configure options:
--enable-werror --target-list=x86_64-softmmu,aarch64-softmmu 
--prefix=/var/tmp/qemu-build/install
No C++ compiler available; disabling C++ specific optional code
Install prefix/var/tmp/qemu-build/install
BIOS directory/var/tmp/qemu-build/install/share/qemu
binary directory  /var/tmp/qemu-build/install/bin
library directory /var/tmp/qemu-build/install/lib
module directory  /var/tmp/qemu-build/install/lib/qemu
libexec directory /var/tmp/qemu-build/install/libexec
include directory /var/tmp/qemu-build/install/include
config directory  /var/tmp/qemu-build/install/etc
local state directory   /var/tmp/qemu-build/install/var
Manual directory  /var/tmp/qemu-build/install/share/man
ELF interp prefix /usr/gnemul/qemu-%M
Source path   /tmp/qemu-test/src
C compilercc
Host C compiler   cc
C++ compiler  
Objective-C compiler cc
ARFLAGS   rv
CFLAGS-O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -g 
QEMU_CFLAGS   -I/usr/include/pixman-1-pthread -I/usr/include/glib-2.0 
-I/usr/lib64/glib-2.0/include   -fPIE -DPIE -m64 -D_GNU_SOURCE 
-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes 
-Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes 
-fno-strict-aliasing -fno-common -fwrapv  -Wendif-labels -Wmissing-include-dirs 
-Wempty-body -Wnested-externs -Wformat-security -Wformat-y2k -Winit-self 
-Wignored-qualifiers -Wold-style-declaration -Wold-style-definition 
-Wtype-limits -fstack-protector-all
LDFLAGS   -Wl,--warn-common -Wl,-z,relro -Wl,-z,now -pie -m64 -g 
make  make
install   install
pythonpython -B
smbd  /usr/sbin/smbd
module supportno
host CPU  x86_64
host big endian   no
target list   x86_64-softmmu aarch64-softmmu
tcg debug enabled no
gprof enabled no
sparse enabledno
strip binariesyes
profiler  no
static build  no
pixmansystem
SDL support   yes (1.2.14)
GTK support   no 
GTK GL supportno
VTE support   no 
TLS priority  NORMAL
GNUTLS supportno
GNUTLS rndno
libgcrypt no
libgcrypt kdf no
nettleno 
nettle kdfno
libtasn1  no
curses supportno
virgl support no
curl support  no
mingw32 support   no
Audio drivers oss
Block whitelist (rw) 
Block whitelist (ro) 
VirtFS supportno
VNC support   yes
VNC SASL support  no
VNC JPEG support  no
VNC PNG