All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Marcin Gibuła" <m.gibula@beyond.pl>
To: Stefan Hajnoczi <stefanha@redhat.com>, qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Ming Lei <ming.lei@canonical.com>
Subject: Re: [Qemu-devel] [PATCH] linux-aio: avoid deadlock in nested aio_poll() calls
Date: Tue, 05 Aug 2014 16:26:55 +0200	[thread overview]
Message-ID: <53E0E9AF.8030103@beyond.pl> (raw)
In-Reply-To: <1407167793-20425-1-git-send-email-stefanha@redhat.com>

On 04.08.2014 17:56, Stefan Hajnoczi wrote:
> If two Linux AIO request completions are fetched in the same
> io_getevents() call, QEMU will deadlock if request A's callback waits
> for request B to complete using an aio_poll() loop.  This was reported
> to happen with the mirror blockjob.
>
> This patch moves completion processing into a BH and makes it resumable.
> Nested event loops can resume completion processing so that request B
> will complete and the deadlock will not occur.
>
> Cc: Kevin Wolf <kwolf@redhat.com>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc: Ming Lei <ming.lei@canonical.com>
> Cc: Marcin Gibuła <m.gibula@beyond.pl>
> Reported-by: Marcin Gibuła <m.gibula@beyond.pl>
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>

Still hangs...

Backtrace still looks like this:

Thread 1 (Thread 0x7f3d5313a900 (LWP 17440)):
#0  0x00007f3d4f38f286 in ppoll () from /lib64/libc.so.6
#1  0x00007f3d5347465b in ppoll (__ss=0x0, __timeout=0x0, 
__nfds=<optimized out>, __fds=<optimized out>) at 
/usr/include/bits/poll2.h:77
#2  qemu_poll_ns (fds=<optimized out>, nfds=<optimized out>, 
timeout=<optimized out>)
     at 
/var/tmp/portage/app-emulation/qemu-2.1.0/work/qemu-2.1.0/qemu-timer.c:314
#3  0x00007f3d53475970 in aio_poll (ctx=ctx@entry=0x7f3d54270c00, 
blocking=blocking@entry=true)
     at 
/var/tmp/portage/app-emulation/qemu-2.1.0/work/qemu-2.1.0/aio-posix.c:250
#4  0x00007f3d534695e7 in bdrv_drain_all () at 
/var/tmp/portage/app-emulation/qemu-2.1.0/work/qemu-2.1.0/block.c:1924
#5  0x00007f3d5346fe1f in bdrv_close (bs=bs@entry=0x7f3d5579b340) at 
/var/tmp/portage/app-emulation/qemu-2.1.0/work/qemu-2.1.0/block.c:1820
#6  0x00007f3d53470047 in bdrv_delete (bs=0x7f3d5579b340) at 
/var/tmp/portage/app-emulation/qemu-2.1.0/work/qemu-2.1.0/block.c:2094
#7  bdrv_unref (bs=0x7f3d5579b340) at 
/var/tmp/portage/app-emulation/qemu-2.1.0/work/qemu-2.1.0/block.c:5376
#8  0x00007f3d5347030b in bdrv_drop_intermediate 
(active=active@entry=0x7f3d54635e20, top=top@entry=0x7f3d5579b340, 
base=base@entry=0x7f3d54d956b0,
     backing_file_str=0x7f3d54d95700 
"/mnt/nfs/volumes/7c13c27f-0c48-4676-b075-6e8a3325383e/3785abe6-d2df-49da-9cba-e15cfce8e2af.qcow2")
     at 
/var/tmp/portage/app-emulation/qemu-2.1.0/work/qemu-2.1.0/block.c:2643
#9  0x00007f3d5335121a in commit_run (opaque=0x7f3d545cdac0) at 
/var/tmp/portage/app-emulation/qemu-2.1.0/work/qemu-2.1.0/block/commit.c:145
#10 0x00007f3d5347ebca in coroutine_trampoline (i0=<optimized out>, 
i1=<optimized out>)
     at 
/var/tmp/portage/app-emulation/qemu-2.1.0/work/qemu-2.1.0/coroutine-ucontext.c:118
#11 0x00007f3d4f2f49f0 in ?? () from /lib64/libc.so.6
#12 0x00007fff27d5ef50 in ?? ()
#13 0x0000000000000000 in ?? ()


-- 
mg

  parent reply	other threads:[~2014-08-05 14:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-04 15:56 [Qemu-devel] [PATCH] linux-aio: avoid deadlock in nested aio_poll() calls Stefan Hajnoczi
2014-08-04 16:10 ` Marcin Gibuła
2014-08-05 10:44 ` Ming Lei
2014-08-05 13:43   ` Stefan Hajnoczi
2014-08-05 14:26 ` Marcin Gibuła [this message]
2014-08-05 14:48   ` Marcin Gibuła
2014-08-05 17:33 ` Marcin Gibuła
2014-08-29 14:59 ` Stefan Hajnoczi

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=53E0E9AF.8030103@beyond.pl \
    --to=m.gibula@beyond.pl \
    --cc=kwolf@redhat.com \
    --cc=ming.lei@canonical.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.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.