[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] fix bdrv_read/write_em and qemu_aio_flush
From: |
Christoph Hellwig |
Subject: |
Re: [Qemu-devel] fix bdrv_read/write_em and qemu_aio_flush |
Date: |
Sat, 30 May 2009 12:08:42 +0200 |
User-agent: |
Mutt/1.3.28i |
On Thu, May 28, 2009 at 06:33:10PM +0200, Andrea Arcangeli wrote:
> Hello,
>
> the debug code in my ide_dma_cancel patch (not yet included upstream)
> made us notice that when qemu_aio_flush returns, there are still
> pending aio commands that waits to complete. Auditing the code I found
> strange stuff like the fact qemu_aio_waits does nothing if there's an
> unrelated (no aio related) bh executed. And I think I found the reason
> of why there was still pending aio when qemu_aio_flush because
> qemu_aio_wait does a lot more than wait, it can start aio, and if the
> previous ->io_flush returned zero, the loop ends and ->io_flush isn't
> repeated. The fact an unrelated bh can make qemu_aio_wait a noop seems
> troublesome for all callers that aren't calling qemu_aio_wait in a
> loop like qemu_aio_flush, so I preferred to change those callers to a
> safer qemu_aio_flush in case the bh executed generates more pending
> I/O. What you think about this patch against qemu git?
Looks good to me. In my unsubmitted aio support patches for qemu-io
I had to call qemu_aio_wait at least twice to get aio requests reliably
completed, but with this patch and calling qemu_aio_flush it always
completes all requests.