From: Paolo Bonzini <pbonzini@redhat.com>
To: "Stefan Hajnoczi" <stefanha@gmail.com>,
"Marcin Gibuła" <m.gibula@beyond.pl>
Cc: qemu-devel <qemu-devel@nongnu.org>
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 [thread overview]
Message-ID: <538EF278.30308@redhat.com> (raw)
In-Reply-To: <20140604100156.GF26902@stefanha-thinkpad.redhat.com>
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 <m.gibula@beyond.pl>
>> > ---
> 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
next prev parent reply other threads:[~2014-06-04 10:18 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-02 7:15 [Qemu-devel] [PATCH v2] thread-pool: fix deadlock when callbacks depends on each other Marcin Gibuła
2014-06-04 10:01 ` Stefan Hajnoczi
2014-06-04 10:18 ` Paolo Bonzini [this message]
2014-06-04 10:31 ` Marcin Gibuła
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=538EF278.30308@redhat.com \
--to=pbonzini@redhat.com \
--cc=m.gibula@beyond.pl \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).