From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:54621) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIl63-000395-OZ for qemu-devel@nongnu.org; Thu, 21 Mar 2013 15:24:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UIl62-0005qK-Mi for qemu-devel@nongnu.org; Thu, 21 Mar 2013 15:24:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54149) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIl62-0005qE-DQ for qemu-devel@nongnu.org; Thu, 21 Mar 2013 15:24:18 -0400 Message-ID: <514B5E5D.7090906@redhat.com> Date: Thu, 21 Mar 2013 13:24:13 -0600 From: Eric Blake MIME-Version: 1.0 References: <1363881457-14814-1-git-send-email-pl@kamp.de> <1363881457-14814-6-git-send-email-pl@kamp.de> In-Reply-To: <1363881457-14814-6-git-send-email-pl@kamp.de> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="----enig2QCVAPHINJXXQSGKGCWJF" Subject: Re: [Qemu-devel] [PATCHv3 5/9] migration: search for zero instead of dup pages 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) ------enig2QCVAPHINJXXQSGKGCWJF Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 03/21/2013 09:57 AM, Peter Lieven wrote: > virtually all dup pages are zero pages. remove > the special is_dup_page() function and use the > optimized buffer_find_nonzero_offset() function > instead. >=20 > here buffer_find_nonzero_offset() is used directly > to avoid the unnecssary additional checks in > buffer_is_zero(). >=20 > Signed-off-by: Peter Lieven > --- > - return 1; > + return=20 > + buffer_find_nonzero_offset(p, TARGET_PAGE_SIZE) =3D=3D TARGET_PAG= E_SIZE; Unusual layout. I would have written: return buffer_find_nonzero_offset(p, TARGET_PAGE_SIZE) =3D=3D TARGET_PAGE_SIZE; > /* struct contains XBZRLE cache and a static page > @@ -443,7 +434,7 @@ static int ram_save_block(QEMUFile *f, bool last_st= age) > =20 > /* In doubt sent page as normal */ > bytes_sent =3D -1; > - if (is_dup_page(p)) { > + if (is_zero_page(p)) { > acct_info.dup_pages++; > bytes_sent =3D save_block_hdr(f, block, offset, cont, > RAM_SAVE_FLAG_COMPRESS); I would move the change for qemu_put_byte(f, 0) out of patch 7 into this patch, since this is the first point where you know the byte to send is 0= =2E --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org ------enig2QCVAPHINJXXQSGKGCWJF 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/ iQEcBAEBCAAGBQJRS15dAAoJEKeha0olJ0NqlhsH/Rv84UdxDZ/cGSF4WMQb36Jz qV7tDXI+p9e0ssGx2lctzK7jQO/Xtee0w+dIrj8eb85WTYNzAFWcult84VjGSEJ9 Z+nnsR3fX5iB3SBphGe6QzWynojAYjf8WuY+zXO2THPC/qARsWsH44VinlQ5/+vh hIrqMm80Q/cEVzz5gMAx71relyeHLMpGoq1o4Bew2H5kiobD0sbYeYVADeVngG1k q/woS1cp2YMaMhnc4ThLd6iyBN4Q2tZFlBuh6NA3QMhJX/O2spaQrn8/ECIi5HmU v81f9PiHhbHt0GjQI04zMW5kJgM4eRLNIbWUIVIYsG6LGMcaccyP6bV9WkUydGI= =3+Ju -----END PGP SIGNATURE----- ------enig2QCVAPHINJXXQSGKGCWJF--