qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] bdrv_aio_flush


From: Ian Jackson
Subject: Re: [Qemu-devel] [PATCH] bdrv_aio_flush
Date: Wed, 3 Sep 2008 11:01:02 +0100

Jamie Lokier writes ("Re: [Qemu-devel] [PATCH] bdrv_aio_flush"):
> Ian Jackson wrote:
> > Yes, certainly you do aio_sync _some_ data that doesn't need to be.
> > Without an O_FSYNC flag on aio_write that's almost inevitable.
> 
> Btw, in principle for FUA writes you can set O_SYNC or O_DSYNC on the
> file descriptor just for this operation.  Either using fcntl() (but
> I'm not sure I believe that would be portable and really work), or
> using two file descriptors.

You'd have to have two file descriptors anyway because other IO on the
same virtual disk might well be happening concurrently.

> > Andrea was making some comments about scsi and virtio.  It's possible
> > that these have different intended semantics and perhaps those device
> > models (in hw/*) need to call flush explicitly before sync.
> 
> Or perhaps they would benefit from an async equivalent, so they don't
> have to pause and can queue more requests?

By `flush' and `sync' I meant qemu_aio_flush and bdrv_aio_flush.
The latter is in my patchset and is an aio version of bdrv_flush.
It is unfortunate that the qemu code uses `flush' for `sync' :-).

The hypothetical device I mentioned should probably keep its own list
of its aio operations so that it can start the sync when they're
complete.  qemu_aio_flush isn't right because it flushes _all_ aio in
the whole emulator, even to unrelated devices.

Ian.




reply via email to

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