qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] Asynchronous reliable and configurable cache fl


From: Jamie Lokier
Subject: Re: [Qemu-devel] [PATCH] Asynchronous reliable and configurable cache flush
Date: Tue, 1 Apr 2008 19:45:02 +0100
User-agent: Mutt/1.5.13 (2006-08-11)

Paul Brook wrote:
> > @@ -1021,6 +1031,13 @@ static void ide_write_dma_cb(void *opaque, int ret)
> >  
> >      /* end of transfer ? */
> >      if (s->nsector == 0) {
> > +       if (!s->write_cache) {
> > +           ret = bdrv_flush(s->bs);
> > +           if (ret != 0) {
> > +               ide_dma_error(s);
> > +               return;
> > +           }
> > +       }
> 
> By my reading this is adding a synchronous flush to the end of an
> async write operation, which in practice makes the whole operation
> synchronous.

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.

Otherwise, chaining where the completion of aio_write triggers
aio_fsync instead of reporting completion to the guest?

-- Jamie




reply via email to

[Prev in Thread] Current Thread [Next in Thread]