Quoting Paolo Bonzini (2014-08-27 11:28:23)
> Il 27/08/2014 17:53, Michael Roth ha scritto:
> >> In case VM does IO while we run a stream job.
> >> When stream finishes, the stream coroutine drains all IOs before
> >> close the unused image, in bdrv_drain_all() it may find
> >> a pending request which is submitted by guest IO coroutine.
> >> In order to wait the pending req finish, the subsequent aio_poll()
> >> call poll() to wait the req. however, if the req is already done by
> >> threadpool and is waiting for the callback, there is no chance to switch
> >> back to guest IO coroutine to call the callback and so that the stream
> >> coroutine waits in poll() all the time.
> 
> This is the same bug fixed by this patch;
> 
> commit 3c80ca158c96ff902a30883a8933e755988948b1
> Author: Stefan Hajnoczi <stefa...@redhat.com>
> Date:   Tue Jul 15 16:44:26 2014 +0200
> 
>     thread-pool: avoid deadlock in nested aio_poll() calls
> 
>     The thread pool has a race condition if two elements complete before
>     thread_pool_completion_bh() runs:
>     
>       If element A's callback waits for element B using aio_poll() it will
>       deadlock since pool->completion_bh is not marked scheduled when the
>       nested aio_poll() runs.
>     
>     Fix this by marking the BH scheduled while thread_pool_completion_bh()
>     is executing.  This way any nested aio_poll() loops will enter
>     thread_pool_completion_bh() and complete the remaining elements.
>     
>     Signed-off-by: Stefan Hajnoczi <stefa...@redhat.com>

Thanks. Looks like this missed v2.1.0 so I've gone ahead and queued it
for 2.1.1 (along with 5f8127a5811429da85cc4bc273f166aed129fc31).

> 
> Paolo


Reply via email to