From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:33476) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UFVnb-0005C6-4x for qemu-devel@nongnu.org; Tue, 12 Mar 2013 16:32:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UFVmX-00067V-2w for qemu-devel@nongnu.org; Tue, 12 Mar 2013 16:27:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:8444) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UFVmW-00067N-Qj for qemu-devel@nongnu.org; Tue, 12 Mar 2013 16:26:45 -0400 Message-ID: <513F8F7F.2030207@redhat.com> Date: Tue, 12 Mar 2013 14:26:39 -0600 From: Eric Blake MIME-Version: 1.0 References: <513F4FA6.6000701@dlhnet.de> In-Reply-To: <513F4FA6.6000701@dlhnet.de> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="----enig2TVNNENCEKDLOJSKDOHKG" Subject: Re: [Qemu-devel] [RFC][PATCH 8/9] migration: do not sent zero_pages in bulk stage List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Lieven Cc: Kevin Wolf , Paolo Bonzini , Stefan Hajnoczi , "qemu-devel@nongnu.org" , Orit Wasserman This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2TVNNENCEKDLOJSKDOHKG Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 03/12/2013 09:54 AM, Peter Lieven wrote: > if the dup_page is a zero_page do not send it at all. > the memory at the destination reads as zero anyway. It might help to comment that this is only true for the bulk migration stage. If the guest is actively zeroing pages, then later stages might encounter an all-zero page that was not all zeros in the bulk migration, so we must transmit the page in that case. >=20 > Signed-off-by: Peter Lieven > --- > arch_init.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) >=20 > diff --git a/arch_init.c b/arch_init.c > index 04c82e4..abd54a7 100644 > --- a/arch_init.c > +++ b/arch_init.c > @@ -447,9 +447,11 @@ static int ram_save_block(QEMUFile *f, bool > last_stage) > bytes_sent =3D -1; > if (ram_bulk_stage && is_dup_page(p)) { > acct_info.dup_pages++; > - bytes_sent =3D save_block_hdr(f, block, offset, cont, > + if (p[0]) { Your code has it right, because of the ram_bulk_stage check guarding this if body, but I did a double take when reading just your commit messa= ge. > + bytes_sent =3D save_block_hdr(f, block, offset, co= nt, > RAM_SAVE_FLAG_COMPRESS); > - qemu_put_byte(f, *p); > + qemu_put_byte(f, *p); > + } > bytes_sent +=3D 1; > } else if (!ram_bulk_stage && migrate_use_xbzrle()) { > current_addr =3D block->offset + offset; --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org ------enig2TVNNENCEKDLOJSKDOHKG Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJRP49/AAoJEKeha0olJ0NqiuoIAIL61a+ZDRu1oUBmyEZdU4QA NMblt2xVGSq+ksuJt364v4qaAHYBMRJo/sAHvfT7ql0r0V7K+HXEwYc7AeoQIDZC 3Eb4N4ZuUnXo9/PAhom84RBAo1VKvRf9Kym1l2izZecZD/Td7FuSi48EPt8bx98Y VSKl6UH5iYyNC0uTXa+u0Pmv9VUjH+BXNiFkPqr3ycOBJxRqooaosqIz6L9xiYPn 5mRo1LeMn9tOC70SlqVrcUxvoZHvnViduD/bLsVfLph6I4U7+oGAuB5nok5D3gYl hGYQiL5mHDgM0S2isSbLKisbUh9pxaIVIo4zpfG6CZ59+JWQHEzwpAa/OO1SGJk= =jEyl -----END PGP SIGNATURE----- ------enig2TVNNENCEKDLOJSKDOHKG--