From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JfJvr-0002TB-Qq for qemu-devel@nongnu.org; Fri, 28 Mar 2008 15:08:07 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JfJvq-0002Sk-9U for qemu-devel@nongnu.org; Fri, 28 Mar 2008 15:08:07 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JfJvq-0002Sh-4y for qemu-devel@nongnu.org; Fri, 28 Mar 2008 15:08:06 -0400 Received: from kanga.kvack.org ([66.96.29.28]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JfJvq-0004Lr-0L for qemu-devel@nongnu.org; Fri, 28 Mar 2008 15:08:06 -0400 Date: Fri, 28 Mar 2008 16:11:08 -0300 From: Marcelo Tosatti Subject: Re: [kvm-devel] [Qemu-devel] [PATCH] QEMU: fsync AIO writes on flush request Message-ID: <20080328191108.GC19547@dmt> References: <20080328150517.GA18077@dmt> <18413.10773.769938.658683@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <18413.10773.769938.658683@mariner.uk.xensource.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Ian Jackson Cc: qemu-devel@nongnu.org On Fri, Mar 28, 2008 at 05:25:41PM +0000, Ian Jackson wrote: > Marcelo Tosatti writes ("[Qemu-devel] [PATCH] QEMU: fsync AIO writes on flush request "): > > Its necessary to guarantee that pending AIO writes have reached stable > > storage when the flush request returns. > > Surely it isn't necessary to call qemu_aio_flush ? Because those > pending AIO writes have not yet been returned to the guest as > complete, the guest is not entitled to assume that a FLUSH CACHE > command (issued before those writes have completed) completing > successfully means that those interleaved writes have reached stable > storage. By the time qemu_aio_flush() finishes, all pending requests submitted before aio_fsync() will have reached stable storage (aio_fsync will be queued in the last position of the priority 0 AIO queue). Unless the scheduling priority of the QEMU process is changed between AIO write's and the fsync(). > Also, this patch does a synchronous flush (which is bad because it > stalls the guest while the flush takes place) and it ignores any error > return (which is quite bad - see my other messages about bdrv_flush, > caches, etc.) > > So I think it would be better to apply > - my bdrv_flush patch from February which I've reposted today > and then > - the asynchronous FLUSH CACHE patch which I've posted today > > I think we concluded last time that the change of fsync to fdatasync > is correct but I think we should wait for the dust to settle before > introducing another change on top of all this ... Alright, please also fix the SCSI driver to perform asynchronous flush with bdrv_aio_flush() and complete the SYNC_CACHE command on the callback.