qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>
Cc: qemu-devel@nongnu.org, mst@redhat.com, quintela@redhat.com,
	peterx@redhat.com, leobras@redhat.com, pbonzini@redhat.com,
	qemu-block@nongnu.org, qemu-stable@nongnu.org
Subject: Re: [PATCH 2/2] virtio: Drop out of coroutine context in virtio_load()
Date: Fri, 8 Sep 2023 06:46:01 -0400	[thread overview]
Message-ID: <20230908104601.GB3552950@fedora> (raw)
In-Reply-To: <ZPrihIbmMJMRlP2W@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1156 bytes --]

On Fri, Sep 08, 2023 at 10:59:48AM +0200, Kevin Wolf wrote:
> Am 07.09.2023 um 20:40 hat Stefan Hajnoczi geschrieben:
> > On Tue, Sep 05, 2023 at 04:50:02PM +0200, Kevin Wolf wrote:
> > > virtio_load() as a whole should run in coroutine context because it
> > > reads from the migration stream and we don't want this to block.
> > 
> > Is that "should" a "must" or a "can"?
> > 
> > If it's a "must" then virtio_load() needs assert(qemu_in_coroutine()).
> > 
> > But the previous patch mentioned that loadvm for snapshots calls it
> > outside coroutine context. So maybe it's a "can"?
> 
> Where this makes a difference is when the function indirectly calls into
> QIOChannel. When called from a coroutine, it yields while waiting for
> I/O, and outside of a coroutine it blocks. Yielding is always
> preferable, but in cases like HMP savevm/loadvm we also don't really
> care because it's synchronous anyway.
> 
> Whether that makes it a MAY or a SHOULD in the RFC sense, you decide.
> If you wanted to make it a MUST, you'd need to check all callers first
> and change some of them.

Thanks for clarifying. It is "can".

Stefan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2023-09-08 10:47 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-05 14:50 [PATCH 0/2] virtio: Drop out of coroutine context in virtio_load() Kevin Wolf
2023-09-05 14:50 ` [PATCH 1/2] vmstate: Mark VMStateInfo.get/put() coroutine_mixed_fn Kevin Wolf
2023-09-05 15:06   ` Peter Xu
2023-09-05 14:50 ` [PATCH 2/2] virtio: Drop out of coroutine context in virtio_load() Kevin Wolf
2023-09-07 18:40   ` Stefan Hajnoczi
2023-09-08  8:59     ` Kevin Wolf
2023-09-08 10:46       ` Stefan Hajnoczi [this message]
2023-10-17  5:19   ` Michael Tokarev
2023-10-17  8:48     ` Kevin Wolf
2023-10-17 13:06     ` Juan Quintela
2023-09-07 18:42 ` [PATCH 0/2] " Stefan Hajnoczi
2023-09-08  8:53   ` Kevin Wolf
2023-09-08 10:46 ` Stefan Hajnoczi

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=20230908104601.GB3552950@fedora \
    --to=stefanha@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=leobras@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peterx@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@nongnu.org \
    --cc=quintela@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 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).