From: Zhiyong Ye <yezhiyong@bytedance.com>
To: qemu-block@nongnu.org, qemu-devel@nongnu.org
Cc: kwolf@redhat.com, Zhiyong Ye <yezhiyong@bytedance.com>,
mreitz@redhat.com
Subject: [PATCH 0/1] block: Do not poll in bdrv_set_aio_context_ignore() when acquiring new_context
Date: Mon, 12 Jul 2021 13:38:30 +0800 [thread overview]
Message-ID: <20210712053831.51722-1-yezhiyong@bytedance.com> (raw)
When bdrv_set_aio_context_ignore() is called in the main loop to change
the AioContext onto the IO thread, the bdrv_drain_invoke_entry() never
gets to run and the IO thread hangs at co_schedule_bh_cb().
This is because the AioContext is occupied by the main thread after
being attached to the IO thread, and the main thread poll in
bdrv_drained_end() waiting for the IO request to be drained, but the IO
thread cannot acquire the AioContext, which leads to deadlock.
Zhiyong Ye (1):
block: Do not poll in bdrv_set_aio_context_ignore() when acquiring new_context
block.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--
2.11.0
next reply other threads:[~2021-07-12 5:41 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-12 5:38 Zhiyong Ye [this message]
2021-07-12 5:38 ` [PATCH 1/1] block: Do not poll in bdrv_set_aio_context_ignore() when acquiring new_context Zhiyong Ye
2021-07-19 10:24 ` Kevin Wolf
2021-07-20 13:07 ` Zhiyong 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=20210712053831.51722-1-yezhiyong@bytedance.com \
--to=yezhiyong@bytedance.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/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).