From: Anthony PERARD <anthony.perard@citrix.com>
To: Paul Durrant <pdurrant@amazon.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
Stefano Stabellini <sstabellini@kernel.org>,
qemu-block@nongnu.org, Julien Grall <jgrall@amazon.com>,
qemu-devel@nongnu.org, Max Reitz <mreitz@redhat.com>,
Stefan Hajnoczi <stefanha@redhat.com>,
xen-devel@lists.xenproject.org
Subject: Re: [PATCH] xen-bus/block: explicitly assign event channels to an AioContext
Date: Thu, 19 Dec 2019 17:11:58 +0000 [thread overview]
Message-ID: <20191219171158.GF1267@perard.uk.xensource.com> (raw)
In-Reply-To: <20191216143451.19024-1-pdurrant@amazon.com>
On Mon, Dec 16, 2019 at 02:34:51PM +0000, Paul Durrant wrote:
> It is not safe to close an event channel from the QEMU main thread when
> that channel's poller is running in IOThread context.
>
> This patch adds a new xen_device_set_event_channel_context() function
> to explicitly assign the channel AioContext, and modifies
> xen_device_bind_event_channel() to initially assign the channel's poller
> to the QEMU main thread context. The code in xen-block's dataplane is
> then modified to assign the channel to IOThread context during
> xen_block_dataplane_start() and de-assign it during in
> xen_block_dataplane_stop(), such that the channel is always assigned
> back to main thread context before it is closed. aio_set_fd_handler()
> already deals with all the necessary synchronization when moving an fd
> between AioContext-s so no extra code is needed to manage this.
>
> Reported-by: Julien Grall <jgrall@amazon.com>
> Signed-off-by: Paul Durrant <pdurrant@amazon.com>
Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>
> Tested against an HVM debian guest with a QCOW2 image as system disk, and
> as a hot-plugged/unplgged secondary disk.
And I've run an osstest flight with the patch.
Thanks,
--
Anthony PERARD
next prev parent reply other threads:[~2019-12-19 17:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-16 14:34 [PATCH] xen-bus/block: explicitly assign event channels to an AioContext Paul Durrant
2019-12-19 17:11 ` Anthony PERARD [this message]
2020-01-29 22:22 ` Julien Grall
2020-01-31 11:12 ` Anthony PERARD
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=20191219171158.GF1267@perard.uk.xensource.com \
--to=anthony.perard@citrix.com \
--cc=jgrall@amazon.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=pdurrant@amazon.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=sstabellini@kernel.org \
--cc=stefanha@redhat.com \
--cc=xen-devel@lists.xenproject.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).