From: Fam Zheng <fam@euphon.net>
To: Stefan Hajnoczi <stefanha@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
qemu-block@nongnu.org, Zhenyu Ye <yezhenyu2@huawei.com>,
qemu-devel@nongnu.org, xiexiangyou@huawei.com, armbru@redhat.com,
pbonzini@redhat.com, mreitz@redhat.com
Subject: Re: [PATCH v1 0/2] Add timeout mechanism to qmp actions
Date: Thu, 17 Sep 2020 16:01:06 +0000 [thread overview]
Message-ID: <20200917160054.GA2453251@dev> (raw)
In-Reply-To: <20200917154415.GB839531@stefanha-x1.localdomain>
On 2020-09-17 16:44, Stefan Hajnoczi wrote:
> On Thu, Sep 17, 2020 at 03:36:57PM +0800, Zhenyu Ye wrote:
> > When the hang occurs, the QEMU is blocked at:
> >
> > #0 0x0000ffff95762b64 in ?? () from target:/usr/lib64/libpthread.so.0
> > #1 0x0000ffff9575bd88 in pthread_mutex_lock () from target:/usr/lib64/libpthread.so.0
> > #2 0x0000aaaabb1f5948 in qemu_mutex_lock_impl (mutex=0xaaaacc8e1860,
> > file=0xaaaabb4e1bd0 "/Images/eillon/CODE/5-opensource/qemu/util/async.c", line=605)
> > #3 0x0000aaaabb20acd4 in aio_context_acquire (ctx=0xaaaacc8e1800)
> > #4 0x0000aaaabb105e90 in bdrv_query_image_info (bs=0xaaaacc934620,
> > p_info=0xaaaaccc41e18, errp=0xffffca669118)
> > #5 0x0000aaaabb105968 in bdrv_block_device_info (blk=0xaaaacdca19f0, bs=0xaaaacc934620,
> > flat=false, errp=0xffffca6692b8)
> > #6 0x0000aaaabb1063dc in bdrv_query_info (blk=0xaaaacdca19f0, p_info=0xaaaacd29c9a8,
> > errp=0xffffca6692b8)
> > #7 0x0000aaaabb106c14 in qmp_query_block (errp=0x0)
> > #8 0x0000aaaabacb8e6c in hmp_info_block (mon=0xffffca6693d0, qdict=0xaaaacd089790)
>
> Great, this shows that the main loop thread is stuck waiting for the
> AioContext lock.
>
> Please post backtraces from all QEMU threads ((gdb) thread apply all bt)
> so we can figure out which thread is holding up the main loop.
I think that is reflected in the perf backtrace posted by Zheny already:
And in the host, the information of sys_enter_io_submit() is:
Samples: 3K of event 'syscalls:sys_enter_io_submit', Event count
(approx.): 3150
Children Self Trace output
- 66.70% 66.70% ctx_id: 0xffff9c044000,
nr: 0x00000001, iocbpp: 0xffff9f7fad28
0xffffae7f871c
0xffffae8a27c4
qemu_thread_start
iothread_run
aio_poll
aio_dispatch_ready_handlers
aio_dispatch_handler
virtio_queue_host_notifier_aio_read
virtio_queue_notify_aio_vq
virtio_blk_data_plane_handle_output
virtio_blk_handle_vq
blk_io_unplug
bdrv_io_unplug
bdrv_io_unplug
raw_aio_unplug
laio_io_unplug
syscall
So the iothread is blocked by a slow io_submit holding the AioContext
lock.
It would be interesting to know what in kernel is blocking io_submit
from returning.
Fam
next prev parent reply other threads:[~2020-09-17 16:12 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-10 14:52 [PATCH v1 0/2] Add timeout mechanism to qmp actions Zhenyu Ye
2020-08-10 14:52 ` [PATCH v1 1/2] util: introduce aio_context_acquire_timeout Zhenyu Ye
2020-08-10 14:52 ` [PATCH v1 2/2] qmp: use aio_context_acquire_timeout replace aio_context_acquire Zhenyu Ye
2020-08-10 15:38 ` [PATCH v1 0/2] Add timeout mechanism to qmp actions Kevin Wolf
2020-08-11 13:54 ` Zhenyu Ye
2020-08-21 12:52 ` Stefan Hajnoczi
2020-09-14 13:27 ` Stefan Hajnoczi
2020-09-17 7:36 ` Zhenyu Ye
2020-09-17 10:10 ` Fam Zheng
2020-09-17 15:44 ` Stefan Hajnoczi
2020-09-17 16:01 ` Fam Zheng [this message]
2020-09-18 11:23 ` Zhenyu Ye
2020-09-18 14:06 ` Fam Zheng
2020-09-19 2:22 ` Zhenyu Ye
2020-09-21 11:14 ` Fam Zheng
2020-10-13 10:00 ` Stefan Hajnoczi
2020-10-19 12:40 ` Zhenyu Ye
2020-10-19 13:25 ` Paolo Bonzini
2020-10-20 1:34 ` Zhenyu Ye
2020-10-22 16:29 ` Fam Zheng
2020-12-08 13:10 ` Stefan Hajnoczi
2020-12-08 13:47 ` Glauber Costa
2020-12-14 16:33 ` Stefan Hajnoczi
2020-12-21 11:30 ` Zhenyu Ye
2020-09-14 14:42 ` Daniel P. Berrangé
2020-09-17 8:12 ` Zhenyu Ye
2020-08-12 13:51 ` Stefan Hajnoczi
2020-08-13 1:51 ` Zhenyu Ye
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=20200917160054.GA2453251@dev \
--to=fam@euphon.net \
--cc=armbru@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
--cc=xiexiangyou@huawei.com \
--cc=yezhenyu2@huawei.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).