From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:55296) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIl8M-00058A-4Q for qemu-devel@nongnu.org; Thu, 21 Mar 2013 15:26:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UIl8K-0007Bj-HM for qemu-devel@nongnu.org; Thu, 21 Mar 2013 15:26:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:21298) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIl8K-0007Bc-8u for qemu-devel@nongnu.org; Thu, 21 Mar 2013 15:26:40 -0400 Message-ID: <514B5EEB.2040507@redhat.com> Date: Thu, 21 Mar 2013 13:26:35 -0600 From: Eric Blake MIME-Version: 1.0 References: <1363881457-14814-1-git-send-email-pl@kamp.de> <1363881457-14814-8-git-send-email-pl@kamp.de> In-Reply-To: <1363881457-14814-8-git-send-email-pl@kamp.de> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="----enig2NRWTFHTRTFSRBLCSMGUC" Subject: Re: [Qemu-devel] [PATCHv3 7/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: kwolf@redhat.com, pbonzini@redhat.com, qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2NRWTFHTRTFSRBLCSMGUC Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 03/21/2013 09:57 AM, Peter Lieven wrote: > during bulk stage of ram migration if a page is a > zero page do not send it at all. > the memory at the destination reads as zero anyway. >=20 > even if there is an madvise with QEMU_MADV_DONTNEED > at the target upon receipt of a zero page I have observed > that the target starts swapping if the memory is overcommitted. > it seems that the pages are dropped asynchronously. >=20 > Signed-off-by: Peter Lieven > --- > arch_init.c | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) > if (is_zero_page(p)) { > acct_info.dup_pages++; > - bytes_sent =3D save_block_hdr(f, block, offset, cont, > - RAM_SAVE_FLAG_COMPRESS); > - qemu_put_byte(f, *p); > - bytes_sent +=3D 1; > + if (!ram_bulk_stage) { > + bytes_sent =3D save_block_hdr(f, block, offset, co= nt, > + RAM_SAVE_FLAG_COMPRESS= ); > + qemu_put_byte(f, 0); > + } > + bytes_sent++; Logic is STILL wrong. I pointed out in v2 that bytes_sent should not be incremented if you are not sending the page, so it needs to be inside the 'if (!ram_bulk_stage)'. Do we want to add a new migration statistic counter of how many zero pages we omitted sending during the bulk stage? --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org ------enig2NRWTFHTRTFSRBLCSMGUC 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/ iQEcBAEBCAAGBQJRS17rAAoJEKeha0olJ0NqZNYIAIt0ZJEX72g6BeEqsVsXtSyp gvXifpkU62m2vzBjk2Q8IMcRv+AJWKP9cQ4GmVQ/OJNH0mWVRXway6bSgvP74GBX hM1SkpdCOpEY3oi8YZtBKNNPO5T2lvM4IG/E72aPFztrjxgHbfh77csNoN65XauW CFIngML6z8xAwIyIPXZgZfWH9tfLJrJmHmQD3jY4/1mf+//jkTh6kvsi+DgDyc1W UJl7KF56s9k7isxfEGeX+ZwQ6IuKwJKtRSmoXPBnO5uQ7qBsKkP3LzWF+1LcImtN xbnZ3LGFD/bjsF3w2i74sGhLRiphmmXCy3Op4tm54Iuqkue8lIfwe/dg3cX1A1U= =YmkJ -----END PGP SIGNATURE----- ------enig2NRWTFHTRTFSRBLCSMGUC--