From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46686) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YrU3N-0003tS-VL for qemu-devel@nongnu.org; Sun, 10 May 2015 12:26:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YrU3M-0002lp-W6 for qemu-devel@nongnu.org; Sun, 10 May 2015 12:26:09 -0400 Message-ID: <554F8698.1010807@weilnetz.de> Date: Sun, 10 May 2015 18:26:00 +0200 From: Stefan Weil MIME-Version: 1.0 References: <1430971496-32659-1-git-send-email-phoeagon@gmail.com> <1431011818-15822-1-git-send-email-phoeagon@gmail.com> <554CB6C6.3060809@redhat.com> <20150508135512.GJ4318@noname.redhat.com> <554D2A03.3080201@weilnetz.de> <554F72E6.5060001@redhat.com> <554F8117.1070800@weilnetz.de> <554F82E0.2000005@redhat.com> In-Reply-To: <554F82E0.2000005@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v4] block/vdi: Use bdrv_flush after metadata updates List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , phoeagon , Kevin Wolf , Max Reitz Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org Am 10.05.2015 um 18:10 schrieb Paolo Bonzini: > On 10/05/2015 18:02, Stefan Weil wrote: >>> Since the default qemu-img convert case isn't slowed down, I >>> would think that correctness trumps performance. Nevertheless, >>> it's a huge difference. >> I doubt that the convert case isn't slowed down. > The *default* convert case isn't slowed down because "qemu-img convert" > defaults to the "unsafe" cache mode. > > The *non-default* convert case with flushes was slowed down indeed: 2x > in total (if you include the final flush done by bdrv_close), and 10x if > you only consider the sequential write part of convert. > > Paolo For those who might be interested: The relevant GPL source code from VirtualBox is available here: https://www.virtualbox.org/browser/vbox/trunk/src/VBox/Storage If I interpret that code correctly, blocks are normally written asynchronously, but changes of metadata (new block allocation) are written synchronously. See file VDI.cpp (function vdiBlockAllocUpdate) and VD.cpp (vdIOIntWriteMeta). Stefan