[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 09/13] hw/xen: do not set is_external=true on evtchn fds
From: |
Stefan Hajnoczi |
Subject: |
[PATCH 09/13] hw/xen: do not set is_external=true on evtchn fds |
Date: |
Mon, 3 Apr 2023 14:30:00 -0400 |
is_external=true suspends fd handlers between aio_disable_external() and
aio_enable_external(). The block layer's drain operation uses this
mechanism to prevent new I/O from sneaking in between
bdrv_drained_begin() and bdrv_drained_end().
The xen-block device actually works fine with is_external=false because
BlockBackend requests are already queued between bdrv_drained_begin()
and bdrv_drained_end(). Since the Xen ring size is finite, request
queuing will stop once the ring is full and memory usage is bounded.
After bdrv_drained_end() the BlockBackend requests will resume and
xen-block's processing will continue.
This is part of ongoing work to remove the aio_disable_external() API.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
hw/xen/xen-bus.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/hw/xen/xen-bus.c b/hw/xen/xen-bus.c
index c59850b1de..c4fd26abe1 100644
--- a/hw/xen/xen-bus.c
+++ b/hw/xen/xen-bus.c
@@ -842,11 +842,11 @@ void xen_device_set_event_channel_context(XenDevice
*xendev,
}
if (channel->ctx)
- aio_set_fd_handler(channel->ctx, qemu_xen_evtchn_fd(channel->xeh),
true,
+ aio_set_fd_handler(channel->ctx, qemu_xen_evtchn_fd(channel->xeh),
false,
NULL, NULL, NULL, NULL, NULL);
channel->ctx = ctx;
- aio_set_fd_handler(channel->ctx, qemu_xen_evtchn_fd(channel->xeh), true,
+ aio_set_fd_handler(channel->ctx, qemu_xen_evtchn_fd(channel->xeh), false,
xen_device_event, NULL, xen_device_poll, NULL, channel);
}
@@ -920,7 +920,7 @@ void xen_device_unbind_event_channel(XenDevice *xendev,
QLIST_REMOVE(channel, list);
- aio_set_fd_handler(channel->ctx, qemu_xen_evtchn_fd(channel->xeh), true,
+ aio_set_fd_handler(channel->ctx, qemu_xen_evtchn_fd(channel->xeh), false,
NULL, NULL, NULL, NULL, NULL);
if (qemu_xen_evtchn_unbind(channel->xeh, channel->local_port) < 0) {
--
2.39.2
- [PATCH 03/13] block/export: only acquire AioContext once for vhost_user_server_stop(), (continued)
- [PATCH 03/13] block/export: only acquire AioContext once for vhost_user_server_stop(), Stefan Hajnoczi, 2023/04/03
- [PATCH 08/13] hw/xen: do not use aio_set_fd_handler(is_external=true) in xen_xenstore, Stefan Hajnoczi, 2023/04/03
- [PATCH 04/13] util/vhost-user-server: rename refcount to in_flight counter, Stefan Hajnoczi, 2023/04/03
- [PATCH 01/13] virtio-scsi: avoid race between unplug and transport event, Stefan Hajnoczi, 2023/04/03
- Re: [PATCH 01/13] virtio-scsi: avoid race between unplug and transport event, Michael S. Tsirkin, 2023/04/04
- [PATCH 09/13] hw/xen: do not set is_external=true on evtchn fds,
Stefan Hajnoczi <=
- [PATCH 07/13] virtio: do not set is_external=true on host notifiers, Stefan Hajnoczi, 2023/04/03
- [PATCH 12/13] block/fuse: do not set is_external=true on FUSE fd, Stefan Hajnoczi, 2023/04/03
- [PATCH 10/13] block/export: rewrite vduse-blk drain code, Stefan Hajnoczi, 2023/04/03
- [PATCH 13/13] aio: remove aio_disable_external() API, Stefan Hajnoczi, 2023/04/03
- [PATCH 11/13] block/fuse: take AioContext lock around blk_exp_ref/unref(), Stefan Hajnoczi, 2023/04/03
- Re: [PATCH 00/13] block: remove aio_disable_external() API, Paolo Bonzini, 2023/04/04