All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: "Stefan Hajnoczi" <stefanha@redhat.com>,
	"Emanuele Giuseppe Esposito" <eesposit@redhat.com>,
	qemu-block@nongnu.org,
	"Stefan Berger" <stefanb@linux.vnet.ibm.com>,
	"Hanna Reitz" <hreitz@redhat.com>, "Stefan Weil" <sw@weilnetz.de>,
	"Aarushi Mehta" <mehta.aaru20@gmail.com>,
	"Julia Suvorova" <jusual@redhat.com>,
	"Stefano Garzarella" <sgarzare@redhat.com>,
	"Greg Kurz" <groug@kaod.org>,
	"Christian Schoenebeck" <qemu_oss@crudebyte.com>,
	"Daniel Henrique Barboza" <danielhb413@gmail.com>,
	"Cédric Le Goater" <clg@kaod.org>,
	"David Gibson" <david@gibson.dropbear.id.au>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"Fam Zheng" <fam@euphon.net>,
	qemu-devel@nongnu.org, qemu-ppc@nongnu.org
Subject: Re: [PATCH v5 1/4] linux-aio: use LinuxAioState from the running thread
Date: Tue, 7 Mar 2023 13:17:17 +0100	[thread overview]
Message-ID: <ZAcrTfv2wXIZnNry@redhat.com> (raw)
In-Reply-To: <115b4902-b930-5f33-4a3c-5b767f94c2d5@redhat.com>

Am 07.03.2023 um 11:58 hat Paolo Bonzini geschrieben:
> On 3/7/23 09:48, Kevin Wolf wrote:
> > You mean we have a device that has a separate iothread, but a request is
> > submitted from the main thread? This isn't even allowed today; if a node
> > is in an iothread, all I/O must be submitted from that iothread. Do you
> > know any code that does submit I/O from the main thread instead?
> 
> I think it is allowed, you just have to take the AioContext lock around the
> bdrv_*?

Didn't we say at some point that we don't want to do this either? Though
maybe it's not strictly forbidden then.

> For example it could happen when you do block device migration.

As in migration/block.c? As far as I can tell, all of the requests made
there are actually processed in the iothread. (blk_aio_*() calls the
callback in the iothread even when it was called from the main thread
itself, which feels like a trap, but it shouldn't be affected by this
change lower in the stack.)

The potentially critical code would be coroutine_fns that call
blk_co_*() or bdrv_co_*() directly while running in a different thread.
Everything else schedules a new coroutine in the AioContext of the block
node.

Kevin



  reply	other threads:[~2023-03-07 12:18 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-03 13:17 [PATCH v5 0/4] AioContext removal: LinuxAioState and ThreadPool Emanuele Giuseppe Esposito
2023-02-03 13:17 ` [PATCH v5 1/4] linux-aio: use LinuxAioState from the running thread Emanuele Giuseppe Esposito
2023-03-01 16:16   ` Stefan Hajnoczi
2023-03-07  8:48     ` Kevin Wolf
2023-03-07 10:58       ` Paolo Bonzini
2023-03-07 12:17         ` Kevin Wolf [this message]
2023-03-07 14:18       ` Stefan Hajnoczi
2023-03-08 11:42         ` Kevin Wolf
2023-03-08 17:24           ` Stefan Hajnoczi
2023-02-03 13:17 ` [PATCH v5 2/4] io_uring: use LuringState " Emanuele Giuseppe Esposito
2023-02-03 13:17 ` [PATCH v5 3/4] thread-pool: use ThreadPool " Emanuele Giuseppe Esposito
2023-02-03 13:17 ` [PATCH v5 4/4] thread-pool: avoid passing the pool parameter every time Emanuele Giuseppe Esposito
2023-03-02 19:58 ` [PATCH v5 0/4] AioContext removal: LinuxAioState and ThreadPool Stefan Hajnoczi
2023-03-14 20:34 ` Kevin Wolf

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=ZAcrTfv2wXIZnNry@redhat.com \
    --to=kwolf@redhat.com \
    --cc=clg@kaod.org \
    --cc=danielhb413@gmail.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=eesposit@redhat.com \
    --cc=fam@euphon.net \
    --cc=groug@kaod.org \
    --cc=hreitz@redhat.com \
    --cc=jusual@redhat.com \
    --cc=mehta.aaru20@gmail.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=qemu_oss@crudebyte.com \
    --cc=sgarzare@redhat.com \
    --cc=stefanb@linux.vnet.ibm.com \
    --cc=stefanha@redhat.com \
    --cc=sw@weilnetz.de \
    /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.