qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] linux-aio: avoid deadlock in nested aio_poll()


From: Marcin Gibuła
Subject: Re: [Qemu-devel] [PATCH] linux-aio: avoid deadlock in nested aio_poll() calls
Date: Tue, 05 Aug 2014 16:26:55 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0

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 <address@hidden>
Cc: Paolo Bonzini <address@hidden>
Cc: Ming Lei <address@hidden>
Cc: Marcin Gibuła <address@hidden>
Reported-by: Marcin Gibuła <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>

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 (address@hidden, address@hidden) 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 (address@hidden) 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 (address@hidden, address@hidden, address@hidden, 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



reply via email to

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