Re: [Qemu-devel] [PATCH v2] thread-pool: fix deadlock when callbacks depends on each other

2014-06-04 Thread Marcin Gibuła
On 04.06.2014 12:01, Stefan Hajnoczi wrote: On Mon, Jun 02, 2014 at 09:15:27AM +0200, Marcin Gibuła wrote: When two coroutines submit I/O and first coroutine depends on second to complete (by calling bdrv_drain_all), deadlock may occur. bdrv_drain_all() is a very heavy-weight operation. Corou

Re: [Qemu-devel] [PATCH v2] thread-pool: fix deadlock when callbacks depends on each other

2014-06-04 Thread Paolo Bonzini
Il 04/06/2014 12:01, Stefan Hajnoczi ha scritto: > Without this patch, I could reproduce this bug with snapshot-commit with > about 1 per 10 tries. With this patch, I couldn't reproduce it any more. > > Signed-off-by: Marcin Gibula > --- This is an interesting bug that definitely needs a test c

Re: [Qemu-devel] [PATCH v2] thread-pool: fix deadlock when callbacks depends on each other

2014-06-04 Thread Stefan Hajnoczi
On Mon, Jun 02, 2014 at 09:15:27AM +0200, Marcin Gibuła wrote: > When two coroutines submit I/O and first coroutine depends on second to > complete (by calling bdrv_drain_all), deadlock may occur. bdrv_drain_all() is a very heavy-weight operation. Coroutines should avoid it if possible. Please p

[Qemu-devel] [PATCH v2] thread-pool: fix deadlock when callbacks depends on each other

2014-06-02 Thread Marcin Gibuła
When two coroutines submit I/O and first coroutine depends on second to complete (by calling bdrv_drain_all), deadlock may occur. This is because both requests may have completed before thread pool notifier got called. Then, when notifier gets executed and first coroutine calls aio_pool() to m