qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2] thread-pool: fix deadlock when callbacks dep


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH v2] thread-pool: fix deadlock when callbacks depends on each other
Date: Wed, 04 Jun 2014 12:18:32 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0

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 <address@hidden>
> ---
This is an interesting bug that definitely needs a test case to prevent
regressions in the future.

Please take a look at tests/test-thread-pool.c and add a test to it.  It
can be reproduced deterministically - just call aio_poll() after the
dummy worker functions have both completed.  Then the next aio_poll()
call in the thread pool callback will suffer the problem you described.

The question if we want to consider this thread-pool.c behavior a real bug or just a misfeature (the real bug being elsewhere).

Even though this patch avoids the performance problems of v1, we would have to fix at least two other cases and it's not obvious (a) that those two are the only ones (b) tgat those two can be fixed without affecting performance.

If the bottom half code is immune from this event notifier problem, bdrv_drain/bdrv_drain_all calls in coroutine context can defer the actual draining to a bottom half and reenter the coroutine afterwards; we can then audit that all other calls should come from the main loop rather than aio_poll.

Paolo



reply via email to

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