From: Christian Borntraeger <borntraeger@de.ibm.com>
To: Fam Zheng <famz@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>,
qemu-devel <qemu-devel@nongnu.org>,
Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Qemu-devel] "iothread: release iothread around aio_poll" causes random hangs at startup
Date: Tue, 09 Jun 2015 11:01:06 +0200 [thread overview]
Message-ID: <5576AB52.8090708@de.ibm.com> (raw)
In-Reply-To: <20150609022832.GA12817@cpc-pc.redhat.com>
Am 09.06.2015 um 04:28 schrieb Fam Zheng:
> On Tue, 06/02 16:36, Christian Borntraeger wrote:
>> Paolo,
>>
>> I bisected
>> commit a0710f7995f914e3044e5899bd8ff6c43c62f916
>> Author: Paolo Bonzini <pbonzini@redhat.com>
>> AuthorDate: Fri Feb 20 17:26:52 2015 +0100
>> Commit: Kevin Wolf <kwolf@redhat.com>
>> CommitDate: Tue Apr 28 15:36:08 2015 +0200
>>
>> iothread: release iothread around aio_poll
>>
>> to cause a problem with hanging guests.
>>
>> Having many guests all with a kernel/ramdisk (via -kernel) and
>> several null block devices will result in hangs. All hanging
>> guests are in partition detection code waiting for an I/O to return
>> so very early maybe even the first I/O.
>>
>> Reverting that commit "fixes" the hangs.
>> Any ideas?
>
> Christian, I can't reproduce this on my x86 box with virtio-blk-pci. Do you
> have a reproducer for x86? Or could you collect backtraces for all the threads
> in QEMU when it hangs?
>
> My long shot is that the main loop is blocked at aio_context_acquire(ctx),
> while the iothread of that ctx is blocked at aio_poll(ctx, blocking).
Here is a backtrace on s390. I need 2 or more disks, (one is not enough).
Thread 5 (Thread 0x3fffb406910 (LWP 74602)):
#0 0x000003fffc0bde8e in syscall () from /lib64/libc.so.6
#1 0x00000000801dd282 in futex_wait (val=4294967295, ev=0x8079c6c4 <rcu_call_ready_event>) at /home/cborntra/REPOS/qemu/util/qemu-thread-posix.c:301
#2 qemu_event_wait (ev=ev@entry=0x8079c6c4 <rcu_call_ready_event>) at /home/cborntra/REPOS/qemu/util/qemu-thread-posix.c:399
#3 0x00000000801ec75c in call_rcu_thread (opaque=<optimized out>) at /home/cborntra/REPOS/qemu/util/rcu.c:233
#4 0x000003fffc16f4e6 in start_thread () from /lib64/libpthread.so.0
#5 0x000003fffc0c30fa in thread_start () from /lib64/libc.so.6
Thread 4 (Thread 0x3fffabf7910 (LWP 74604)):
#0 0x000003fffc0b75d6 in ppoll () from /lib64/libc.so.6
#1 0x000000008016fbd0 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=timeout@entry=-1) at /home/cborntra/REPOS/qemu/qemu-timer.c:310
#3 0x0000000080170d32 in aio_poll (ctx=0x807d6a70, blocking=blocking@entry=true) at /home/cborntra/REPOS/qemu/aio-posix.c:274
#4 0x00000000800b3758 in iothread_run (opaque=0x807d6690) at /home/cborntra/REPOS/qemu/iothread.c:41
#5 0x000003fffc16f4e6 in start_thread () from /lib64/libpthread.so.0
#6 0x000003fffc0c30fa in thread_start () from /lib64/libc.so.6
Thread 3 (Thread 0x3fffa3f7910 (LWP 74605)):
#0 0x000003fffc0b75d6 in ppoll () from /lib64/libc.so.6
#1 0x000000008016fbd0 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=timeout@entry=-1) at /home/cborntra/REPOS/qemu/qemu-timer.c:310
#3 0x0000000080170d32 in aio_poll (ctx=0x807d94a0, blocking=blocking@entry=true) at /home/cborntra/REPOS/qemu/aio-posix.c:274
#4 0x00000000800b3758 in iothread_run (opaque=0x807d6f60) at /home/cborntra/REPOS/qemu/iothread.c:41
#5 0x000003fffc16f4e6 in start_thread () from /lib64/libpthread.so.0
#6 0x000003fffc0c30fa in thread_start () from /lib64/libc.so.6
Thread 2 (Thread 0x3fff8a21910 (LWP 74625)):
#0 0x000003fffc0b90a2 in ioctl () from /lib64/libc.so.6
#1 0x0000000080056a46 in kvm_vcpu_ioctl (cpu=cpu@entry=0x81f3b620, type=type@entry=44672) at /home/cborntra/REPOS/qemu/kvm-all.c:1916
#2 0x0000000080056b08 in kvm_cpu_exec (cpu=cpu@entry=0x81f3b620) at /home/cborntra/REPOS/qemu/kvm-all.c:1775
#3 0x00000000800445de in qemu_kvm_cpu_thread_fn (arg=0x81f3b620) at /home/cborntra/REPOS/qemu/cpus.c:979
#4 0x000003fffc16f4e6 in start_thread () from /lib64/libpthread.so.0
#5 0x000003fffc0c30fa in thread_start () from /lib64/libc.so.6
Thread 1 (Thread 0x3fffb408bc0 (LWP 74580)):
#0 0x000003fffc0b75d6 in ppoll () from /lib64/libc.so.6
#1 0x000000008016fbb0 in ppoll (__ss=0x0, __timeout=0x3ffffd64438, __nfds=<optimized out>, __fds=<optimized out>) at /usr/include/bits/poll2.h:77
#2 qemu_poll_ns (fds=<optimized out>, nfds=<optimized out>, timeout=timeout@entry=999000000) at /home/cborntra/REPOS/qemu/qemu-timer.c:322
#3 0x000000008016f230 in os_host_main_loop_wait (timeout=999000000) at /home/cborntra/REPOS/qemu/main-loop.c:239
#4 main_loop_wait (nonblocking=<optimized out>) at /home/cborntra/REPOS/qemu/main-loop.c:494
#5 0x000000008001346a in main_loop () at /home/cborntra/REPOS/qemu/vl.c:1789
#6 main (argc=<optimized out>, argv=<optimized out>, envp=<optimized out>) at /home/cborntra/REPOS/qemu/vl.c:4391
next prev parent reply other threads:[~2015-06-09 9:01 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-02 14:36 [Qemu-devel] "iothread: release iothread around aio_poll" causes random hangs at startup Christian Borntraeger
2015-06-02 14:51 ` Paolo Bonzini
2015-06-03 9:17 ` Stefan Hajnoczi
2015-06-09 2:28 ` Fam Zheng
2015-06-09 9:01 ` Christian Borntraeger [this message]
2015-06-10 2:12 ` Fam Zheng
2015-06-10 9:18 ` Christian Borntraeger
2015-06-10 9:34 ` Fam Zheng
2015-06-10 10:31 ` Christian Borntraeger
2015-07-16 11:03 ` Christian Borntraeger
2015-07-16 11:20 ` Paolo Bonzini
2015-07-16 11:24 ` Christian Borntraeger
2015-07-16 11:37 ` Paolo Bonzini
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=5576AB52.8090708@de.ibm.com \
--to=borntraeger@de.ibm.com \
--cc=famz@redhat.com \
--cc=kwolf@redhat.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.