qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [RFC PATCH 0/4] aio: Don't poll ioeventfd in nested aio_poll()
@ 2015-05-27  7:19 Fam Zheng
  2015-05-27  7:19 ` [Qemu-devel] [RFC PATCH 1/4] aio-posix: Introduce aio_set_io_event_notifier Fam Zheng
                   ` (4 more replies)
  0 siblings, 5 replies; 16+ messages in thread
From: Fam Zheng @ 2015-05-27  7:19 UTC (permalink / raw)
  To: qemu-devel
  Cc: Kevin Wolf, qemu-block, Michael S. Tsirkin, Stefan Weil,
	Stefan Hajnoczi, Paolo Bonzini

This series looks at the other side of the broken "qmp transaction" problem
with dataplane [1] - the event loop.

Before, an ioeventfd of a non-dataplane device is registered via
qemu_set_fd_handler, which is only polled directly by main_loop_wait(), not in
aio_poll(); an ioeventfd of a dataplane device (virtio-blk/virtio-scsi) is
registered specially via aio_set_event_notifier, which is a wrapper of
aio_set_fd_handler, thus it WILL be polled by all aio_poll().

As explained in [1], and in patch 3, this is wrong. The handlers mustn't run.

[1] Fixes it by unregistering them temporarily around such nested poll, while
this series fixes it by skipping those file descriptors in all nested
aio_poll(), just like how iohandler behaves in the main loop.

On the one hand, it is simpler than [1]; on the other hand, this approach is
also interesting because once we remove qemu_set_fd_handler2 [2], iohandler.c
can be removed by converting all qemu_set_fd_handler to the new
aio_set_io_event_notifier introduced in this series.

Note that patch 2 is not tested.

[1]: https://lists.gnu.org/archive/html/qemu-block/2015-05/msg00800.html
[2]: https://lists.gnu.org/archive/html/qemu-block/2015-05/msg00647.html


Fam Zheng (4):
  aio-posix: Introduce aio_set_io_event_notifier
  aio-win32: Implement aio_set_io_event_notifier
  virtio-blk: Use aio_set_io_event_notifier in dataplane
  virtio-scsi-dataplane: User aio_set_io_event_notifier

 aio-posix.c                     | 33 +++++++++++++++++++-----
 aio-win32.c                     | 56 ++++++++++++++++++++++++++++++++++-------
 hw/block/dataplane/virtio-blk.c |  4 +--
 hw/scsi/virtio-scsi-dataplane.c | 18 +++++++------
 include/block/aio.h             | 23 ++++++++++++++---
 5 files changed, 106 insertions(+), 28 deletions(-)

-- 
2.4.1

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2015-05-28 13:43 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-27  7:19 [Qemu-devel] [RFC PATCH 0/4] aio: Don't poll ioeventfd in nested aio_poll() Fam Zheng
2015-05-27  7:19 ` [Qemu-devel] [RFC PATCH 1/4] aio-posix: Introduce aio_set_io_event_notifier Fam Zheng
2015-05-27 12:07   ` Eric Blake
2015-05-27  7:19 ` [Qemu-devel] [RFC PATCH 2/4] aio-win32: Implement aio_set_io_event_notifier Fam Zheng
2015-05-27  7:19 ` [Qemu-devel] [RFC PATCH 3/4] virtio-blk: Use aio_set_io_event_notifier in dataplane Fam Zheng
2015-05-27 12:10   ` Eric Blake
2015-05-27  7:19 ` [Qemu-devel] [RFC PATCH 4/4] virtio-scsi-dataplane: User aio_set_io_event_notifier Fam Zheng
2015-05-27  9:38 ` [Qemu-devel] [RFC PATCH 0/4] aio: Don't poll ioeventfd in nested aio_poll() Paolo Bonzini
2015-05-28  1:46   ` Fam Zheng
2015-05-28  8:21     ` Paolo Bonzini
2015-05-28 11:16       ` Fam Zheng
2015-05-28 11:19         ` Paolo Bonzini
2015-05-28 11:49           ` Fam Zheng
2015-05-28 12:01             ` Paolo Bonzini
2015-05-28 12:26               ` Fam Zheng
2015-05-28 13:42                 ` Paolo Bonzini

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).