From: Stefan Hajnoczi <stefanha@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Stefan Hajnoczi <stefanha@gmail.com>,
qemu-devel@nongnu.org,
Christian Borntraeger <borntraeger@de.ibm.com>
Subject: Re: [Qemu-devel] [PATCH for-2.1? 2/2] thread-pool: avoid deadlock in nested aio_poll() calls
Date: Thu, 17 Jul 2014 13:56:44 +0100 [thread overview]
Message-ID: <20140717125644.GB24256@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <53C546F1.1090003@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 816 bytes --]
On Tue, Jul 15, 2014 at 05:21:21PM +0200, Paolo Bonzini wrote:
> Il 15/07/2014 16:37, Stefan Hajnoczi ha scritto:
> >>> This is of course missing here:
> >>>
> >>> break;
> >Let's keep goto restart so we don't use the BH for each completion
> >callback. We just need the BH scheduled once to protect against the
> >deadlock.
>
> Ah, I missed this remark.
>
> Then you could add qemu_bh_cancel at the end of the BH handler.
No, because a worker thread could be completing a work item just as we
leave the BH handler. Then the BH would be cancelled and the work item
completion would never get executed (until the next work item
completes).
This is why I needed the atomic completion_token. That way I could
check whether more requests completed while we were in the BH handler.
Stefan
[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]
next prev parent reply other threads:[~2014-07-17 12:57 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-11 11:20 [Qemu-devel] [PATCH for-2.1? 0/2] thread-pool: avoid fd usage and fix nested aio_poll() deadlock Stefan Hajnoczi
2014-07-11 11:20 ` [Qemu-devel] [PATCH for-2.1? 1/2] thread-pool: avoid per-thread-pool EventNotifier Stefan Hajnoczi
2014-07-11 11:20 ` [Qemu-devel] [PATCH for-2.1? 2/2] thread-pool: avoid deadlock in nested aio_poll() calls Stefan Hajnoczi
2014-07-14 8:36 ` Paolo Bonzini
2014-07-14 10:49 ` Paolo Bonzini
2014-07-15 14:37 ` Stefan Hajnoczi
2014-07-15 15:21 ` Paolo Bonzini
2014-07-17 12:56 ` Stefan Hajnoczi [this message]
2014-07-15 14:23 ` Stefan Hajnoczi
2014-07-11 11:37 ` [Qemu-devel] [PATCH for-2.1? 0/2] thread-pool: avoid fd usage and fix nested aio_poll() deadlock Christian Borntraeger
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=20140717125644.GB24256@stefanha-thinkpad.redhat.com \
--to=stefanha@redhat.com \
--cc=borntraeger@de.ibm.com \
--cc=pbonzini@redhat.com \
--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).