From: Kevin Wolf <kwolf@redhat.com>
To: Fam Zheng <famz@redhat.com>
Cc: qemu-devel@nongnu.org, Paolo Bonzini <pbonzini@redhat.com>,
qemu-block@nongnu.org, jcody@redhat.com,
Max Reitz <mreitz@redhat.com>,
Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [PATCH RFC 0/9] block: Rewrite block drain begin/end
Date: Fri, 1 Dec 2017 13:24:20 +0100 [thread overview]
Message-ID: <20171201122420.GC4147@localhost.localdomain> (raw)
In-Reply-To: <20171201095120.GA11092@lemon>
Am 01.12.2017 um 10:51 hat Fam Zheng geschrieben:
> On Thu, 11/30 17:04, Paolo Bonzini wrote:
> > On 30/11/2017 16:10, Kevin Wolf wrote:
> > >> Yes, I agree, but that (using CoMutex around graph change) requires
> > >> everything, especially the defer_to_main_loop_bh, runs in a coroutine
> > >> context, which is exactly what I mean by "introducing 'ubiquitous
> > >> coroutines'", because currently we don't have them.
> > > Is it hard to do, though? Instead of using a BH to switch to the main
> > > loop and outside of coroutine context, you could use aio_co_schedule()
> > > and yield, which would leave you in the main loop, but still in
> > > coroutine context.
> >
> > Not that I think of, but just aio_co_schedule wouldn't work, because
> > "the coroutine must have yielded unless ctx is the context in which the
> > coroutine is running (i.e. the value of qemu_get_current_aio_context()
> > from the coroutine itself)".
> >
> > So you'd have to use a bottom half that calls aio_co_schedule. But that
> > would work.
>
> We have QMP commands that can manupulate the graph which are all not coroutines.
> I think running QMP commands in coroutines has it merit especially regarding to
> the nested event loops.
>
> Also the bdrv_close_all() and similar at the end of main() do draining too,
> which I'm not sure how to deal with. Maybe special case them and forget the
> draining CoMutex?
All of these cases have in common that they are the outermost layer with
respect to the block subsystem. This means that a nested event loop
there should be harmless because the callbacks called by it won't
influence callers further up in the call stack.
Kevin
prev parent reply other threads:[~2017-12-01 16:04 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-29 14:49 [Qemu-devel] [PATCH RFC 0/9] block: Rewrite block drain begin/end Fam Zheng
2017-11-29 14:49 ` [Qemu-devel] [PATCH RFC 1/9] block: Remove unused bdrv_requests_pending Fam Zheng
2017-12-01 12:35 ` [Qemu-devel] [Qemu-block] " Alberto Garcia
2017-11-29 14:49 ` [Qemu-devel] [PATCH RFC 2/9] aio: Add drain begin/end API to AioContext Fam Zheng
2017-11-30 16:07 ` Stefan Hajnoczi
2017-11-29 14:49 ` [Qemu-devel] [PATCH RFC 3/9] blockjob: Implement AioContext drain ops Fam Zheng
2017-11-30 16:09 ` Stefan Hajnoczi
2017-11-29 14:49 ` [Qemu-devel] [PATCH RFC 4/9] throttle: " Fam Zheng
2017-11-29 14:49 ` [Qemu-devel] [PATCH RFC 5/9] qed: " Fam Zheng
2017-11-29 14:49 ` [Qemu-devel] [PATCH RFC 6/9] block: Use aio_context_drained_begin in bdrv_set_aio_context Fam Zheng
2017-11-29 14:49 ` [Qemu-devel] [PATCH RFC 7/9] block: Switch to use AIO drained begin/end API Fam Zheng
2017-11-29 14:49 ` [Qemu-devel] [PATCH RFC 8/9] block: Drop old drained_{begin, end} callbacks Fam Zheng
2017-11-29 14:49 ` [Qemu-devel] [PATCH RFC 9/9] blockjob: Drop unused functions Fam Zheng
2017-11-29 17:25 ` [Qemu-devel] [PATCH RFC 0/9] block: Rewrite block drain begin/end Kevin Wolf
2017-11-30 2:03 ` Fam Zheng
2017-11-30 10:31 ` Kevin Wolf
2017-11-30 14:34 ` Fam Zheng
2017-11-30 15:10 ` Kevin Wolf
2017-11-30 16:04 ` Paolo Bonzini
2017-12-01 9:51 ` Fam Zheng
2017-12-01 12:24 ` Kevin Wolf [this message]
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=20171201122420.GC4147@localhost.localdomain \
--to=kwolf@redhat.com \
--cc=famz@redhat.com \
--cc=jcody@redhat.com \
--cc=mreitz@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-block@nongnu.org \
--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.