[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] Asynchronous reliable and configurable cache fl
From: |
Paul Brook |
Subject: |
Re: [Qemu-devel] [PATCH] Asynchronous reliable and configurable cache flush |
Date: |
Wed, 2 Apr 2008 13:26:21 +0100 |
User-agent: |
KMail/1.9.9 |
On Tuesday 01 April 2008, Jamie Lokier wrote:
> 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.
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.
> Otherwise, chaining where the completion of aio_write triggers
> aio_fsync instead of reporting completion to the guest?
Yes, that should do it.
Paul
Re: [Qemu-devel] [PATCH] Asynchronous reliable and configurable cache flush, Ian Jackson, 2008/04/02
Re: [Qemu-devel] [PATCH] Asynchronous reliable and configurable cache flush, Samuel Thibault, 2008/04/01