From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56112) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WTA1d-0001kL-CK for qemu-devel@nongnu.org; Thu, 27 Mar 2014 09:07:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WTA1X-0001MG-Qg for qemu-devel@nongnu.org; Thu, 27 Mar 2014 09:07:17 -0400 Received: from mx-v6.kamp.de ([2a02:248:0:51::16]:47936 helo=mx01.kamp.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WTA1X-0001L1-DN for qemu-devel@nongnu.org; Thu, 27 Mar 2014 09:07:11 -0400 Message-ID: <53342271.5070803@kamp.de> Date: Thu, 27 Mar 2014 14:06:57 +0100 From: Peter Lieven MIME-Version: 1.0 References: <1395412589-30601-1-git-send-email-pl@kamp.de> <87fvm5720l.fsf@blackfin.pond.sub.org> In-Reply-To: <87fvm5720l.fsf@blackfin.pond.sub.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC PATCHv2] block: optimize zero writes with bdrv_write_zeroes List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: kwolf@redhat.com, famz@redhat.com, qemu-devel@nongnu.org, mreitz@redhat.com, stefanha@redhat.com, pbonzini@redhat.com On 26.03.2014 10:16, Markus Armbruster wrote: > Peter Lieven writes: > >> this patch tries to optimize zero write requests >> by automatically using bdrv_write_zeroes if it is >> supported by the format. >> >> this should significantly speed up file system initialization and >> should speed zero write test used to test backend storage performance. >> >> the difference can simply be tested by e.g. >> >> dd if=/dev/zero of=/dev/vdX bs=1M > Got actual numbers? Preferably for some operation that matters to > users. To give you a rough figure I have an iSCSI Storage for testing that has an 1GBit connection. The above command gives about 110MB/s with detect-zeroes=off and about 980MB/s with detect-zeroes=unmap. Additionally I ran a test with v1 of the patch: ---8<--- I created a 60GB qcow2 container and formatted it with ext4. To immediately show the difference I disabled lazy inode table and lazy journal init (writing zero takes place immediately then). Timing without the patch: time mkfs.ext4 -E lazy_itable_init=0,lazy_journal_init=0 /dev/vda real 1m5.649s user 0m0.416s sys 0m3.148s Timing with the patch: time mkfs.ext4 -E lazy_itable_init=0,lazy_journal_init=0 /dev/vdX real 0m1.228s user 0m0.116s sys 0m0.732s Container Size after Format without the patch: 1150615552 Byte (1097.3MB) Container Size after Format with the patch: 24645632 Byte (23.5MB) --->8--- Without the patch means detect-zeroes=off (default) and with the patch means detect-zeroes=unmap. BR, Peter