From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52253) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WNTl8-0004Qd-E4 for qemu-devel@nongnu.org; Tue, 11 Mar 2014 16:58:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WNTl4-00080x-2p for qemu-devel@nongnu.org; Tue, 11 Mar 2014 16:58:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:30130) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WNTl3-00080l-Qt for qemu-devel@nongnu.org; Tue, 11 Mar 2014 16:58:42 -0400 Message-ID: <531F78FC.6070403@redhat.com> Date: Tue, 11 Mar 2014 14:58:36 -0600 From: Eric Blake MIME-Version: 1.0 References: <1394542415-5152-1-git-send-email-arei.gonglei@huawei.com> <1394542415-5152-7-git-send-email-arei.gonglei@huawei.com> In-Reply-To: <1394542415-5152-7-git-send-email-arei.gonglei@huawei.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="K7uaohwNEhAFo4JqEB7qUtJCiEF8ar6cP" Subject: Re: [Qemu-devel] [PATCH 06/10] migraion: optimiztion xbzrle by reducing data copy List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: arei.gonglei@huawei.com, qemu-devel@nongnu.org Cc: ChenLiang , owasserm@redhat.com, pbonzini@redhat.com, weidong.huang@huawei.com, quintela@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --K7uaohwNEhAFo4JqEB7qUtJCiEF8ar6cP Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 03/11/2014 06:53 AM, arei.gonglei@huawei.com wrote: > From: ChenLiang s/migraion/migration/ in the subject (here and in 7/10) s/optimiztion/optimize/ in the subject > +++ b/arch_init.c > @@ -381,11 +381,8 @@ static int save_xbzrle_page(QEMUFile *f, uint8_t *= *current_data, > =20 > prev_cached_page =3D get_cached_data(XBZRLE.cache, current_addr); > =20 > - /* save current buffer into memory */ > - memcpy(XBZRLE.current_buf, *current_data, TARGET_PAGE_SIZE); > - > /* XBZRLE encoding (if there is no overflow) */ > - encoded_len =3D xbzrle_encode_buffer(prev_cached_page, XBZRLE.curr= ent_buf, > + encoded_len =3D xbzrle_encode_buffer(prev_cached_page, *current_da= ta, > TARGET_PAGE_SIZE, XBZRLE.encode= d_buf, > TARGET_PAGE_SIZE); > if (encoded_len =3D=3D 0) { > @@ -404,7 +401,8 @@ static int save_xbzrle_page(QEMUFile *f, uint8_t **= current_data, > =20 > /* we need to update the data in the cache, in order to get the sa= me data */ > if (!last_stage) { > - memcpy(prev_cached_page, XBZRLE.current_buf, TARGET_PAGE_SIZE)= ; > + xbzrle_decode_buffer(XBZRLE.encoded_buf, encoded_len, prev_cac= hed_page, > + TARGET_PAGE_SIZE); So, is XBZRLE.current_buf even needed after this patch? Oh, patch 7 kills it. I guess splitting in two patches is okay, although I personally would have squashed them into one. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --K7uaohwNEhAFo4JqEB7qUtJCiEF8ar6cP 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 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJTH3j9AAoJEKeha0olJ0NqkKcH/3AbYYiz3pDyIUgSN1vsRbDr 9RygNP/kxKoZNosiEEug7dU+pOZg7ra29kiQTw6y/en/7wPm82Q7IOxoTg3dSN87 WOgTiXpoEC/ARi7dy68Er4zqRDcsW6yA08yJq+9f2TBoqcM7C2cbGg+v8nPCsv80 x7KayYRUh3vJHD9liht8vFYs1Wts9xSjjUfi4fP5rhrbr1DNxy9VsihFb4LQFqdn il28KCzveHHyNiaWYu6J+Qi5ZWRNFk6i1aJazM4KQtqLaIYU8QVFrDduA0VOPl2S 6EhbOGbgIY1UM1laSIDk+TiLDHxIkYe3WwhPChKMnWZ12mCu9S6KAoAm4a7y7fE= =QrE/ -----END PGP SIGNATURE----- --K7uaohwNEhAFo4JqEB7qUtJCiEF8ar6cP--