qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2 00/11] aio: Introduce handler type to fix nested aio_poll for dataplane
@ 2015-07-29  4:42 Fam Zheng
  2015-07-29  4:42 ` [Qemu-devel] [PATCH v2 01/11] aio: Introduce "type" in aio_set_fd_handler and aio_set_event_notifier Fam Zheng
                   ` (13 more replies)
  0 siblings, 14 replies; 54+ messages in thread
From: Fam Zheng @ 2015-07-29  4:42 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, pbonzini, stefanha, qemu-block

v2: Switch to disable/enable model. [Paolo]

Most existing nested aio_poll()'s in block layer are inconsiderate of
dispatching potential new r/w requests from ioeventfds and nbd exports, which
might result in responsiveness issues (e.g. bdrv_drain_all will not return when
new requests keep coming), or even wrong semantics (e.g. qmp_transaction cannot
enforce atomicity due to aio_poll in bdrv_drain_all).

Previous attampts to address this issue include new op blocker[1], bdrv_lock[2]
and nested AioContext (patches not posted to qemu-devel).

This approach is based on the idea proposed by Paolo Bonzini. The original idea
is introducing "aio_context_disable_client / aio_context_enable_client to
filter AioContext handlers according to the "client", e.g.
AIO_CLIENT_DATAPLANE (ioeventfd), AIO_CLIENT_PROTOCOL, AIO_CLIENT_NBD_SERVER,
AIO_CLIENT_CONTEXT, ... Extend aio_set_{event_notifier,fd}_handler to pass a
client (type)." 

After this series, block layer aio_poll() will only process those "protocol"
fds that are used in block I/O, plus the ctx->notifier for aio_notify();  other
aio_poll()'s keep unchanged.

The biggest advantage over approaches [1] and [2] is, no change is needed in
virtio-{blk,scsi}-dataplane code, also this doesn't depend on converting QMP to
coroutines.

The windows implementation is not tested except for compiling.

[1]: https://lists.gnu.org/archive/html/qemu-block/2015-05/msg00800.html
[2]: http://lists.nongnu.org/archive/html/qemu-block/2015-06/msg00027.html


Fam Zheng (11):
  aio: Introduce "type" in aio_set_fd_handler and aio_set_event_notifier
  aio: Save type to AioHandler
  block: Mark fd handlers as "protocol"
  nbd: Mark fd handlers client type as "nbd server"
  aio: Mark ctx->notifier's client type as "context"
  dataplane: Mark host notifiers' client type as "dataplane"
  aio-posix: introduce aio_{disable,enable}_clients
  aio-win32: Implement aio_{disable,enable}_clients
  block: Introduce bdrv_aio_poll
  block: Replace nested aio_poll with bdrv_aio_poll
  block: Only poll block layer fds in bdrv_aio_poll

 aio-posix.c                     | 23 ++++++++++++++--
 aio-win32.c                     | 22 +++++++++++++++-
 async.c                         |  3 ++-
 block.c                         |  2 +-
 block/curl.c                    | 16 +++++++-----
 block/io.c                      | 28 +++++++++++++-------
 block/iscsi.c                   |  9 +++----
 block/linux-aio.c               |  5 ++--
 block/nbd-client.c              | 10 ++++---
 block/nfs.c                     | 19 ++++++--------
 block/qed-table.c               |  8 +++---
 block/sheepdog.c                | 32 +++++++++++++++--------
 block/ssh.c                     |  5 ++--
 block/win32-aio.c               |  5 ++--
 blockjob.c                      |  2 +-
 hw/block/dataplane/virtio-blk.c |  6 +++--
 hw/scsi/virtio-scsi-dataplane.c | 24 +++++++++++------
 include/block/aio.h             | 33 +++++++++++++++++++++++
 include/block/block.h           |  2 ++
 nbd.c                           |  4 ++-
 qemu-img.c                      |  2 +-
 qemu-io-cmds.c                  |  4 +--
 tests/test-aio.c                | 58 +++++++++++++++++++++++------------------
 23 files changed, 219 insertions(+), 103 deletions(-)

-- 
2.4.3

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

end of thread, other threads:[~2015-09-28  9:31 UTC | newest]

Thread overview: 54+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-29  4:42 [Qemu-devel] [PATCH v2 00/11] aio: Introduce handler type to fix nested aio_poll for dataplane Fam Zheng
2015-07-29  4:42 ` [Qemu-devel] [PATCH v2 01/11] aio: Introduce "type" in aio_set_fd_handler and aio_set_event_notifier Fam Zheng
2015-08-27 13:50   ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2015-07-29  4:42 ` [Qemu-devel] [PATCH v2 02/11] aio: Save type to AioHandler Fam Zheng
2015-08-27 13:50   ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2015-07-29  4:42 ` [Qemu-devel] [PATCH v2 03/11] block: Mark fd handlers as "protocol" Fam Zheng
2015-08-27 13:53   ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2015-09-07  4:43     ` Fam Zheng
2015-07-29  4:42 ` [Qemu-devel] [PATCH v2 04/11] nbd: Mark fd handlers client type as "nbd server" Fam Zheng
2015-08-27 14:02   ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2015-07-29  4:42 ` [Qemu-devel] [PATCH v2 05/11] aio: Mark ctx->notifier's client type as "context" Fam Zheng
2015-08-27 17:12   ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2015-07-29  4:42 ` [Qemu-devel] [PATCH v2 06/11] dataplane: Mark host notifiers' client type as "dataplane" Fam Zheng
2015-08-27 17:14   ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2015-07-29  4:42 ` [Qemu-devel] [PATCH v2 07/11] aio-posix: introduce aio_{disable, enable}_clients Fam Zheng
2015-08-27 17:23   ` Stefan Hajnoczi
2015-09-07  5:26     ` Fam Zheng
2015-07-29  4:42 ` [Qemu-devel] [PATCH v2 08/11] aio-win32: Implement " Fam Zheng
2015-07-29  4:42 ` [Qemu-devel] [PATCH v2 09/11] block: Introduce bdrv_aio_poll Fam Zheng
2015-08-27 17:25   ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2015-08-28 11:50   ` Stefan Hajnoczi
2015-07-29  4:42 ` [Qemu-devel] [PATCH v2 10/11] block: Replace nested aio_poll with bdrv_aio_poll Fam Zheng
2015-08-28 11:50   ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2015-07-29  4:42 ` [Qemu-devel] [PATCH v2 11/11] block: Only poll block layer fds in bdrv_aio_poll Fam Zheng
2015-07-29  7:36   ` Paolo Bonzini
2015-07-29  7:37   ` Paolo Bonzini
2015-07-29 10:57     ` Fam Zheng
2015-07-29 11:02       ` Paolo Bonzini
2015-07-29 11:53         ` Fam Zheng
2015-07-29 12:03           ` Paolo Bonzini
2015-07-30  1:35             ` Fam Zheng
2015-07-30 13:22               ` Paolo Bonzini
2015-09-09  3:22             ` Fam Zheng
2015-09-11  8:15               ` Paolo Bonzini
2015-09-11  9:14                 ` Fam Zheng
2015-09-11  9:36                   ` [Qemu-devel] [Qemu-block] " Alberto Garcia
2015-09-11  9:43                     ` Daniel P. Berrange
2015-09-11  9:44                     ` Fam Zheng
2015-09-11  9:54                       ` Paolo Bonzini
2015-09-11 10:40                         ` Fam Zheng
2015-09-11 10:46                           ` Paolo Bonzini
2015-09-11 11:01                             ` Fam Zheng
2015-09-11 11:02                               ` Paolo Bonzini
2015-09-11 11:12                                 ` Fam Zheng
2015-09-11  9:45                     ` Paolo Bonzini
2015-07-29  7:38 ` [Qemu-devel] [PATCH v2 00/11] aio: Introduce handler type to fix nested aio_poll for dataplane Paolo Bonzini
2015-08-28 11:53 ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2015-09-07  6:28   ` Fam Zheng
2015-09-11 10:39 ` [Qemu-devel] " Kevin Wolf
2015-09-11 11:46   ` Fam Zheng
2015-09-11 12:22     ` Kevin Wolf
2015-09-14  7:27       ` Fam Zheng
2015-09-14  8:40         ` Kevin Wolf
2015-09-28  9:31       ` Stefan Hajnoczi

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