From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Jh4oU-0001gT-A8 for qemu-devel@nongnu.org; Wed, 02 Apr 2008 11:23:46 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Jh4oS-0001gF-Ld for qemu-devel@nongnu.org; Wed, 02 Apr 2008 11:23:45 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jh4oS-0001g6-D0 for qemu-devel@nongnu.org; Wed, 02 Apr 2008 11:23:44 -0400 Received: from mail2.shareable.org ([80.68.89.115]) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Jh4oS-0004BM-8j for qemu-devel@nongnu.org; Wed, 02 Apr 2008 11:23:44 -0400 Date: Wed, 2 Apr 2008 16:23:39 +0100 From: Jamie Lokier Subject: Re: [Qemu-devel] [PATCH] Asynchronous reliable and configurable cache flush Message-ID: <20080402152339.GA15460@shareable.org> References: <18418.28291.689482.198484@mariner.uk.xensource.com> <200804011846.25975.paul@codesourcery.com> <20080401184501.GA26813@shareable.org> <200804021326.22707.paul@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200804021326.22707.paul@codesourcery.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paul Brook Cc: Ian Jackson , qemu-devel@nongnu.org Paul Brook wrote: > > Looks that way to me too. It might be simplest to open the device > > with O_DSYNC when !s->write_cache and user actually wants fdatasync, > > so that async write can be used. I suspect every platform with useful > > Posix AIO has O_DSYNC. > > The cache is dynamically enabled/disabled by the target. This means > you've got to close and repopen the file every time it changes, > which is likely to get really hairy. Just open two descriptors :-) I'm not sure if F_SETFL can be used. Both descriptors are useful with the cache enabled, if the SATA FUA (force unit access) bit is set on a write command. Only those writes would use the O_DSYNC descriptor. > > Otherwise, chaining where the completion of aio_write triggers > > aio_fsync instead of reporting completion to the guest? > > Yes, that should do it. Yes, though O_DSYNC will save a system call. -- Jamie