From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55233) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wkd1a-0005Oa-J7 for qemu-devel@nongnu.org; Wed, 14 May 2014 13:31:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wkd1V-0000ow-Uo for qemu-devel@nongnu.org; Wed, 14 May 2014 13:31:26 -0400 Received: from mx1.redhat.com ([209.132.183.28]:62355) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wkd1V-0000op-NH for qemu-devel@nongnu.org; Wed, 14 May 2014 13:31:21 -0400 Message-ID: <5373A85F.9080201@redhat.com> Date: Wed, 14 May 2014 11:31:11 -0600 From: Eric Blake MIME-Version: 1.0 References: <1399984592-2469-1-git-send-email-pl@kamp.de> In-Reply-To: <1399984592-2469-1-git-send-email-pl@kamp.de> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="xiHixA5Vht7jcVidTh1Ht2jnbj90wfJxp" Subject: Re: [Qemu-devel] [PATCHv3] block: introduce BDRV_O_SEQUENTIAL List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Lieven , qemu-devel@nongnu.org Cc: kwolf@redhat.com, pbonzini@redhat.com, shadowsor@gmail.com, famz@redhat.com, stefanha@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --xiHixA5Vht7jcVidTh1Ht2jnbj90wfJxp Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 05/13/2014 06:36 AM, Peter Lieven wrote: > this patch introduces a new flag to indicate that we are going to seque= ntially > read from a file and do not plan to reread/reuse the data after it has = been read. >=20 > The current use of this flag is to open the source(s) of a qemu-img con= vert > process. If a protocol from block/raw-posix.c is used posix_fadvise is = utilized > to advise to the kernel that we are going to read sequentially from the= > file and a POSIX_FADV_DONTNEED advise is issued after each write to ind= icate > that there is no advantage keeping the blocks in the buffers. >=20 > Consider the following test case that was created to confirm the behavi= our of > the new flag: >=20 > A 10G logical volume was created and filled with random data. > Then the logical volume was exported via qemu-img convert to an iscsi t= arget. > Before the export was started all caches of the linux kernel where drop= ped. >=20 > Old behavior: > - The convert process took 3m45s and the buffer cache grew up to 9.67 = GB close > to the end of the conversion. After qemu-img terminated all the buff= ers were > freed by the kernel. >=20 > New behavior with the -N switch: > - The convert process took 3m43s and the buffer cache grew up to 15.48= MB close > to the end with some small peaks up to 30 MB during the conversion. >=20 > Signed-off-by: Peter Lieven > --- > v2->v3: - rebased > - fixed typo in commit msg [Fam] > v1->v2: - added test example to commit msg > - added -N knob to qemu-img >=20 > block/raw-posix.c | 14 ++++++++++++++ > include/block/block.h | 1 + > qemu-img-cmds.hx | 4 ++-- > qemu-img.c | 15 ++++++++++++--- > qemu-img.texi | 9 ++++++++- > 5 files changed, 37 insertions(+), 6 deletions(-) Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --xiHixA5Vht7jcVidTh1Ht2jnbj90wfJxp 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/ iQEcBAEBCAAGBQJTc6hfAAoJEKeha0olJ0NqcEkH/1SDyeJHNomoh5b9ai21B1IU lGwbtgzhAf0p/n9jK2dPsFXwVOCv6HDCHDUlVQypC8MKWWHlDtYiwl6sc+arUx/g aB2Fl/Feu9UhOF/rcRA8mcwjTzEMHEjOYE5T5hOFw5bae0vRyVCBKueCYEXj0krA fXkHYQRMstqSI8nIMN6b5AP/JcFFYPPXtj9fsiOZSblkBzHf9zYXRTI/SslXLhCa fe5dypueqqkQ9vbUltPG89mmG0qAuIKgqtfFNOKB2Bw2aiGL71s2w8cJzwSDPRNe ufRdzp2LN/v10cxMnb26lf1PcKvh5xiQi5TSbimiV4X8/RwiztXmH8TJ5S0h0cM= =ij4F -----END PGP SIGNATURE----- --xiHixA5Vht7jcVidTh1Ht2jnbj90wfJxp--