From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51497) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y8WKs-0007jP-Rb for qemu-devel@nongnu.org; Tue, 06 Jan 2015 10:46:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y8WKo-0004Ff-OI for qemu-devel@nongnu.org; Tue, 06 Jan 2015 10:46:22 -0500 Received: from mx1.redhat.com ([209.132.183.28]:46299) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y8WKo-0004FW-F1 for qemu-devel@nongnu.org; Tue, 06 Jan 2015 10:46:18 -0500 Message-ID: <54AC0347.5040807@redhat.com> Date: Tue, 06 Jan 2015 08:46:15 -0700 From: Eric Blake MIME-Version: 1.0 References: <1419604968-87437-1-git-send-email-agraf@suse.de> <1419604968-87437-4-git-send-email-agraf@suse.de> In-Reply-To: <1419604968-87437-4-git-send-email-agraf@suse.de> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="5vklfg8CkrIFusOp6W6a36RSKOLSDoCTI" Subject: Re: [Qemu-devel] [PATCH v3 3/5] qemu-file: Add fast ftell code path List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf , qemu-devel@nongnu.org Cc: amit.shah@redhat.com, pbonzini@redhat.com, afaerber@suse.de, quintela@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --5vklfg8CkrIFusOp6W6a36RSKOLSDoCTI Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 12/26/2014 07:42 AM, Alexander Graf wrote: > For ftell we flush the output buffer to ensure that we don't have anyth= ing > lingering in our internal buffers. This is a very safe thing to do. >=20 > However, with the dynamic size measurement that the dynamic vmstate > description will bring this would turn out quite slow. >=20 > Instead, we can fast path this specific measurement and just take the > internal buffers into account when telling the kernel our position. >=20 > I'm sure I overlooked some corner cases where this doesn't work, so > instead of tuning the safe, existing version, this patch adds a fast > variant of ftell that gets used by the dynamic vmstate description code= > which isn't critical when it fails. >=20 > Signed-off-by: Alexander Graf >=20 > --- >=20 > v2 -> v3: >=20 > - improve ftell_fast, now works with bdrv too > --- > include/migration/qemu-file.h | 1 + > migration/qemu-file.c | 16 ++++++++++++++++ > 2 files changed, 17 insertions(+) Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --5vklfg8CkrIFusOp6W6a36RSKOLSDoCTI 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/ iQEcBAEBCAAGBQJUrANHAAoJEKeha0olJ0NqUX8IAKjGzAetomlWp19bC6uBopuw JsxpDsa7JEe6XdH+d+j/D7VVjIOO7fgdls0jAscjjfGG6zTJUiieosDmhX4Oyocc NNUkjhjFSS+JmupP12u3LRtWN1hdfe45IS9aLjUt5D+opURNRB9S8mLKgKwl58UM ecFoHIxeT+n+yWloKCDShXn/F2A2fzvJNE4syjQFeA/AJXhck2u07hXk60RFglNE AQnciipz9nDndm8m444bS7dZSablvfNuZp/RNpQCdYqcWMrCAAW6cEzCZOwy5Zv2 1PZ0VBWXt8AvTThoDefLVj+om/8xUEeIz+1eKM+Ygw68Kpo4Fab6qYbbeE8WrIo= =lcLw -----END PGP SIGNATURE----- --5vklfg8CkrIFusOp6W6a36RSKOLSDoCTI--