[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [Qemu-block] [PATCH v3 2/2] virtio-blk: Use blk_drain()
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [Qemu-block] [PATCH v3 2/2] virtio-blk: Use blk_drain() to drain IO requests |
Date: |
Thu, 2 Jul 2015 09:21:53 +0100 |
On Wed, Jul 1, 2015 at 4:52 PM, Markus Armbruster <address@hidden> wrote:
> Stefan Hajnoczi <address@hidden> writes:
>
>> On Mon, Jun 29, 2015 at 08:10:20AM +0200, Markus Armbruster wrote:
>>> Alexander Yarygin <address@hidden> writes:
>>> > Markus Armbruster <address@hidden> writes:
>>> > * Ignorant answer: I was told that the bdrv_drain_all()'s comment is
>>> > obsolete and we can use bdrv_drain(). Here is a link to the old
>>> > thread: http://marc.info/?l=qemu-devel&m=143154211017926&w=2.
>>>
>>> Kevin, Stefan, if the comment has become wrong, it needs to be redone.
>>> Who's going to take care of it?
>>
>> I couldn't think of a scenario where this patch is unsafe.
>>
>> The danger is that the I/O code path depends on something outside the
>> AioContext. In that case you block in aio_poll(aio_context, true)
>> forever without making progress. The thing the I/O request depends on
>> will never finish.
>>
>> Code that accesses multiple BDSes puts them into the same AioContext, so
>> this should not be a problem in practice.
>
> Stefan, could you rework the bdrv_drain()'s to spell out how it can be
> used safely?
Good idea. I will send a patch.