All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Marcin Gibuła" <m.gibula@beyond.pl>
To: Stefan Hajnoczi <stefanha@gmail.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>, 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:31:16 +0200	[thread overview]
Message-ID: <538EF574.90208@beyond.pl> (raw)
In-Reply-To: <20140604100156.GF26902@stefanha-thinkpad.redhat.com>

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.  Coroutines should
> avoid it if possible.  Please post the file/line/function where this
> call was made, perhaps there is a better way to wait for the other
> coroutine.  This isn't a fix for this bug but it's a cleanup.

As in original bug report:

#4  0x00007f699c095c0a in bdrv_drain_all () at 
/var/tmp/portage/app-emulation/qemu-2.0.0_rc2/work/qemu-2.0.0-rc2/block.c:1805
#5  0x00007f699c09c87e in bdrv_close (bs=bs@entry=0x7f699f0bc520) at 
/var/tmp/portage/app-emulation/qemu-2.0.0_rc2/work/qemu-2.0.0-rc2/block.c:1695
#6  0x00007f699c09c5fa in bdrv_delete (bs=0x7f699f0bc520) at 
/var/tmp/portage/app-emulation/qemu-2.0.0_rc2/work/qemu-2.0.0-rc2/block.c:1978
#7  bdrv_unref (bs=0x7f699f0bc520) at 
/var/tmp/portage/app-emulation/qemu-2.0.0_rc2/work/qemu-2.0.0-rc2/block.c:5198
#8  0x00007f699c09c812 in bdrv_drop_intermediate 
(active=active@entry=0x7f699ebfd330, top=top@entry=0x7f699f0bc520, 
base=base@entry=0x7f699eec43d0) at 
/var/tmp/portage/app-emulation/qemu-2.0.0_rc2/work/qemu-2.0.0-rc2/block.c:2567
#9  0x00007f699c0a1963 in commit_run (opaque=0x7f699f17dcc0) at 
/var/tmp/portage/app-emulation/qemu-2.0.0_rc2/work/qemu-2.0.0-rc2/block/commit.c:144
#10 0x00007f699c0e0dca in coroutine_trampoline (i0=<optimized out>, 
i1=<optimized out>) at 
/var/tmp/portage/app-emulation/qemu-2.0.0_rc2/work/qemu-2.0.0-rc2/coroutine-ucontext.c:118 



mirror_run probably has this as well. I didn't check others.

-- 
mg

      parent reply	other threads:[~2014-06-04 10:31 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
2014-06-04 10:31   ` Marcin Gibuła [this message]

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=538EF574.90208@beyond.pl \
    --to=m.gibula@beyond.pl \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.