From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54448) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YkvUQ-0005Kl-1e for qemu-devel@nongnu.org; Wed, 22 Apr 2015 10:18:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YkvUJ-0007gL-Kp for qemu-devel@nongnu.org; Wed, 22 Apr 2015 10:18:56 -0400 Received: from mail-wi0-x235.google.com ([2a00:1450:400c:c05::235]:35703) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YkvUJ-0007fe-Dl for qemu-devel@nongnu.org; Wed, 22 Apr 2015 10:18:51 -0400 Received: by widdi4 with SMTP id di4so179749439wid.0 for ; Wed, 22 Apr 2015 07:18:50 -0700 (PDT) Date: Wed, 22 Apr 2015 15:18:48 +0100 From: Stefan Hajnoczi Message-ID: <20150422141848.GA27617@stefanha-thinkpad.redhat.com> References: <1426069701-1405-1-git-send-email-den@openvz.org> <1426069701-1405-27-git-send-email-den@openvz.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="7A15IXT36zwL5BDA" Content-Disposition: inline In-Reply-To: <1426069701-1405-27-git-send-email-den@openvz.org> Subject: Re: [Qemu-devel] [PATCH 26/27] block/parallels: optimize linear image expansion List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Denis V. Lunev" Cc: Kevin Wolf , qemu-devel@nongnu.org, Stefan Hajnoczi --7A15IXT36zwL5BDA Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Mar 11, 2015 at 01:28:20PM +0300, Denis V. Lunev wrote: > Plain image expansion spends a lot of time to update image file size. > This seriously affects the performance. The following simple test > qemu_img create -f parallels -o cluster_size=3D64k ./1.hds 64G > qemu_io -n -c "write -P 0x11 0 1024M" ./1.hds > could be improved if the format driver will pre-allocate some space > in the image file with a reasonable chunk. >=20 > This patch preallocates 128 Mb using bdrv_write_zeroes, which should > normally use fallocate() call inside. Fallback to older truncate() > could be used as a fallback using image open options thanks to the > previous patch. >=20 > The benefit is around 15%. qcow2 doesn't use bdrv_truncate() at all. It simply writes past the end of bs->file to grow the file. Can you use this approach instead? --7A15IXT36zwL5BDA Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJVN63IAAoJEJykq7OBq3PIhiUH/RMpw3E8NS6hSzEhPhcYBDsi aMb2LlDpnpGZN4Rzsq8npYYYQ5xo8n4g0S1EE9e3C5zxV/Uvh8jVgcr/Vfc8OMRV mCAQ+m5GiSjeqiNH3QQ/+ihiEzvRI9r0Eqh9qy2uc8CVjMxwgMJDymeJRyDKszVy mGNDlKwqZGKS47meOC1sJVABxUaKWDSUQ/gP7diw5P2mz+BeicymCx5Jv/lT1ZtC UAhX/jtXsykiR5eM8OCroT/8yQFNEUPmwN7NC0O3aprBy1T9g0n9ZYbjNIHrLCg7 E0byC2i4h8AZ/u6STyQ3BeCBDvvgmUj42veJswY58kIYZgzCMadkOBz3qjzgfp0= =0j+c -----END PGP SIGNATURE----- --7A15IXT36zwL5BDA--