From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=53344 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ODzcP-0007NT-5b for qemu-devel@nongnu.org; Mon, 17 May 2010 08:40:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1ODzcN-0002Zj-Ll for qemu-devel@nongnu.org; Mon, 17 May 2010 08:40:24 -0400 Received: from verein.lst.de ([213.95.11.210]:49185) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ODzcN-0002Zb-Bz for qemu-devel@nongnu.org; Mon, 17 May 2010 08:40:23 -0400 Date: Mon, 17 May 2010 14:40:18 +0200 From: Christoph Hellwig Subject: Re: [Qemu-devel] Re: [PATCH 2/2] Add flush=off parameter to -drive Message-ID: <20100517124018.GB6558@lst.de> References: <1273528310-7051-1-git-send-email-agraf@suse.de> <20100511182020.GB30446@shareable.org> <201005112258.52054.paul@codesourcery.com> <201005112311.12875.paul@codesourcery.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201005112311.12875.paul@codesourcery.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paul Brook Cc: Kevin Wolf , Alexander Graf , Christoph Hellwig , qemu-devel@nongnu.org, armbru@redhat.com On Tue, May 11, 2010 at 11:11:12PM +0100, Paul Brook wrote: > .. though it may be a kernel bug rather that a qemu bug, depending on the > exact details. Either way, I consider any mode that inhibits host filesystem > write cache but not volatile drive cache to be pretty worthless. Either we > guaranteed data integrity on completion or we don't. O_DIRECT just means bypassing the pagecache, it does not mean flushing the disk cache on every access, which for certain workloads can be very painful. It also doesn't require a synchronous writeout of metadata required to reach the data, e.g. in case when we have to allocate blocks for a sparse image file. To get the behaviour you want you need O_DIRECT|O_DSYNC, which is something that is not exposed by qemu's current cache= suboption. If we want to implement this properly we need to split the cache option, as I already mentioned. This would also have benefits in other areas, but again refer to my previous mail for that.