From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=46993 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P620S-0005Ej-7o for qemu-devel@nongnu.org; Wed, 13 Oct 2010 10:09:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P61zF-0003wh-9S for qemu-devel@nongnu.org; Wed, 13 Oct 2010 10:08:30 -0400 Received: from mtagate1.de.ibm.com ([195.212.17.161]:37912) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P61zF-0003vw-1j for qemu-devel@nongnu.org; Wed, 13 Oct 2010 10:07:21 -0400 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate1.de.ibm.com (8.13.1/8.13.1) with ESMTP id o9DE7HYi023980 for ; Wed, 13 Oct 2010 14:07:17 GMT Received: from d12av01.megacenter.de.ibm.com (d12av01.megacenter.de.ibm.com [9.149.165.212]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o9DE7HoT4075638 for ; Wed, 13 Oct 2010 16:07:17 +0200 Received: from d12av01.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av01.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id o9DE7Gd5014292 for ; Wed, 13 Oct 2010 16:07:17 +0200 Date: Wed, 13 Oct 2010 15:07:15 +0100 From: Stefan Hajnoczi Subject: Re: [Qemu-devel] Re: [PATCH v2 6/7] qed: Read/write support Message-ID: <20101013140715.GF8998@stefan-thinkpad.transitives.com> References: <1286552914-27014-7-git-send-email-stefanha@linux.vnet.ibm.com> <4CB479D2.7030901@redhat.com> <4CB47D38.3060602@linux.vnet.ibm.com> <4CB48144.9030607@redhat.com> <20101012155953.GA13872@stefan-thinkpad.transitives.com> <4CB489D1.3050204@linux.vnet.ibm.com> <20101013121328.GB8998@stefan-thinkpad.transitives.com> <4CB5AF0D.9000800@redhat.com> <4CB5B2FD.9030205@linux.vnet.ibm.com> <4CB5B908.1020406@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4CB5B908.1020406@redhat.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: Kevin Wolf , Anthony Liguori , qemu-devel@nongnu.org, Christoph Hellwig On Wed, Oct 13, 2010 at 03:50:00PM +0200, Avi Kivity wrote: > On 10/13/2010 03:24 PM, Anthony Liguori wrote: > >On 10/13/2010 08:07 AM, Kevin Wolf wrote: > >>Am 13.10.2010 14:13, schrieb Stefan Hajnoczi: > >>>We can avoid it when a backing image is not used. Your idea to check > >>>for zeroes in the backing image is neat too, it may well reduce the > >>>common case even for backing images. > >>The additional requirement is that we're extending the file and not > >>reusing an old cluster. (And bdrv_has_zero_init() == true, but QED > >>doesn't work on host_devices anyway) > > > >Yes, that's a good point. > > > >BTW, I think we've decided that making it work on host_devices is > >not that bad. > > > >We can add an additional feature called QED_F_PHYSICAL_SIZE. > > > >This feature will add another field to the header that contains an > >offset immediately following the last cluster allocation. > > > >During a metadata scan, we can accurately recreate this field so > >we only need to update this field whenever we clear the header > >dirty bit (which means during an fsync()). > > If you make QED_F_PHYSICAL_SIZE an autoclear bit, you don't need the > header dirty bit. Do you mean we just need to check the physical size header field against the actual file size? If the two are different, then a consistency check is forced. > > > >That means we can maintain the physical size without introducing > >additional fsync()s in the allocation path. Since we're already > >writing out the header anyway, the write operation is basically > >free too. > > I don't see how it is free. It's an extra write. The good news is > that it's very easy to amortize. We only need to update the header field on disk when we're already updating the header, so it's not even an extra write operation. Stefan