From: Kevin Wolf <kwolf@redhat.com>
To: l00284672 <lizhengui@huawei.com>
Cc: qemu-block@nongnu.org, eric.fangyi@huawei.com, armbru@redhat.com,
qemu-devel@nongnu.org, mreitz@redhat.com, jiangyiwen@huawei.com,
stefanha@redhat.com, wangjie88@huawei.com,
Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [Qemu-devel] [Qemu-block] [PATCH] file-posix: unlock qemu_global_mutex before pread when attach disk
Date: Tue, 11 Jun 2019 10:49:41 +0200 [thread overview]
Message-ID: <20190611084941.GB8112@localhost.localdomain> (raw)
In-Reply-To: <98826c00-3dae-3972-c68a-f86f544c2093@huawei.com>
Am 11.06.2019 um 04:53 hat l00284672 geschrieben:
> -- Would the "open" hang as well in that case?
> The "open" doesn't hang in that case.
>
> Do you have any better solutions to solve this problem in the case?
Yes, but unfortunately it's a lot harder.
This is roughly what you'd have to do:
1. Make QMP command handlers async (patches from Marc-André are on the
list)
2. Stop using HMP drive_add and instead switch to QMP blockdev-add
3. Move the blockdev-add code into a coroutine
4. Make .bdrv_open a coroutine_fn
5. Move the pread() in file-posix to the thread pool and let the
coroutine yield while the request is running
Only with all of these pieces in place we'll be able to release the
global mutex while we're waiting for the pread() to complete.
Kevin
next prev parent reply other threads:[~2019-06-11 8:56 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-10 13:34 [Qemu-devel] [PATCH] file-posix: unlock qemu_global_mutex before pread when attach disk Zhengui li
2019-06-10 13:51 ` [Qemu-devel] [Qemu-block] " Paolo Bonzini
2019-06-10 14:51 ` l00284672
2019-06-10 16:03 ` Paolo Bonzini
2019-06-11 2:53 ` l00284672
2019-06-11 8:49 ` Kevin Wolf [this message]
2019-06-10 14:12 ` [Qemu-devel] " no-reply
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=20190611084941.GB8112@localhost.localdomain \
--to=kwolf@redhat.com \
--cc=armbru@redhat.com \
--cc=eric.fangyi@huawei.com \
--cc=jiangyiwen@huawei.com \
--cc=lizhengui@huawei.com \
--cc=mreitz@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
--cc=wangjie88@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).