From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JfGAk-0008NG-5j for qemu-devel@nongnu.org; Fri, 28 Mar 2008 11:07:14 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JfGAf-0008L2-Lu for qemu-devel@nongnu.org; Fri, 28 Mar 2008 11:07:12 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JfGAf-0008Ku-Gq for qemu-devel@nongnu.org; Fri, 28 Mar 2008 11:07:09 -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 1JfGAf-0004MU-10 for qemu-devel@nongnu.org; Fri, 28 Mar 2008 11:07:09 -0400 Date: Fri, 28 Mar 2008 15:07:03 +0000 From: Jamie Lokier Subject: Re: [Qemu-devel] [PATCH] QEMU: fsync AIO writes on flush request Message-ID: <20080328150703.GA19624@shareable.org> References: <20080328150517.GA18077@dmt> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080328150517.GA18077@dmt> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kvm-devel Marcelo Tosatti wrote: > Its necessary to guarantee that pending AIO writes have reached stable > storage when the flush request returns. > > Also change fsync() to fdatasync(), since the modification time is not > critical data. > + if (aio_fsync(O_DSYNC, &acb->aiocb) < 0) { > BDRVRawState *s = bs->opaque; > - fsync(s->fd); > + raw_aio_flush(bs); > + fdatasync(s->fd); > + > + /* We rely on the fact that no other AIO will be submitted > + * in parallel, but this should be fixed by per-device > + * AIO queues when allowing multiple CPU's to process IO > + * in QEMU. > + */ > + qemu_aio_flush(); I'm a bit confused by this. Why do you need aio_fsync(O_DSYNC) _and_ synchronous fdatasync() calls? Aren't they equivalent? -- Jamie