qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/4] virtio-blk: use blk_io_plug_call() instead of notification BH
@ 2023-08-17 15:58 Stefan Hajnoczi
  2023-08-17 15:58 ` [PATCH v2 1/4] block: rename blk_io_plug_call() API to defer_call() Stefan Hajnoczi
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Stefan Hajnoczi @ 2023-08-17 15:58 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-block, Stefan Hajnoczi, Fam Zheng, xen-devel, Anthony Perard,
	Hanna Reitz, Kevin Wolf, Julia Suvorova, Stefano Garzarella,
	Paolo Bonzini, Aarushi Mehta, Philippe Mathieu-Daudé,
	Michael S. Tsirkin, Stefano Stabellini, Paul Durrant,
	Ilya Maximets

v2:
- Rename blk_io_plug() to defer_call() and move it to util/ so the net
  subsystem can use it [Ilya]
- Add defer_call_begin()/end() to thread_pool_completion_bh() to match Linux
  AIO and io_uring completion batching

Replace the seldom-used virtio-blk notification BH mechanism with
blk_io_plug(). This is part of an effort to enable the multi-queue block layer
in virtio-blk. The notification BH was not multi-queue friendly.

The blk_io_plug() mechanism improves fio rw=randread bs=4k iodepth=64 numjobs=8
IOPS by ~9% with a single IOThread and 8 vCPUs (this is not even a multi-queue
block layer configuration) compared to no completion batching. iodepth=1
decreases by ~1% but this could be noise. Benchmark details are available here:
https://gitlab.com/stefanha/virt-playbooks/-/tree/blk_io_plug-irqfd

Stefan Hajnoczi (4):
  block: rename blk_io_plug_call() API to defer_call()
  util/defer-call: move defer_call() to util/
  virtio: use defer_call() in virtio_irqfd_notify()
  virtio-blk: remove batch notification BH

 MAINTAINERS                       |   3 +-
 include/qemu/defer-call.h         |  15 +++
 include/sysemu/block-backend-io.h |   4 -
 block/blkio.c                     |   9 +-
 block/io_uring.c                  |  11 ++-
 block/linux-aio.c                 |   9 +-
 block/nvme.c                      |   5 +-
 block/plug.c                      | 159 ------------------------------
 hw/block/dataplane/virtio-blk.c   |  48 +--------
 hw/block/dataplane/xen-block.c    |  11 ++-
 hw/block/virtio-blk.c             |   5 +-
 hw/scsi/virtio-scsi.c             |   7 +-
 hw/virtio/virtio.c                |  11 ++-
 util/defer-call.c                 | 156 +++++++++++++++++++++++++++++
 util/thread-pool.c                |   5 +
 block/meson.build                 |   1 -
 util/meson.build                  |   1 +
 17 files changed, 227 insertions(+), 233 deletions(-)
 create mode 100644 include/qemu/defer-call.h
 delete mode 100644 block/plug.c
 create mode 100644 util/defer-call.c

-- 
2.41.0



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

end of thread, other threads:[~2023-09-13 19:40 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-17 15:58 [PATCH v2 0/4] virtio-blk: use blk_io_plug_call() instead of notification BH Stefan Hajnoczi
2023-08-17 15:58 ` [PATCH v2 1/4] block: rename blk_io_plug_call() API to defer_call() Stefan Hajnoczi
2023-08-18  8:33   ` Philippe Mathieu-Daudé
2023-08-18 11:06   ` Paul Durrant
2023-08-17 15:58 ` [PATCH v2 2/4] util/defer-call: move defer_call() to util/ Stefan Hajnoczi
2023-08-18  8:31   ` Philippe Mathieu-Daudé
2023-09-13 19:39     ` Stefan Hajnoczi
2023-08-17 15:58 ` [PATCH v2 3/4] virtio: use defer_call() in virtio_irqfd_notify() Stefan Hajnoczi
2023-08-18 15:17   ` Eric Blake
2023-08-21 11:02   ` Ilya Maximets
2023-08-17 15:58 ` [PATCH v2 4/4] virtio-blk: remove batch notification BH Stefan Hajnoczi
2023-08-18 15:19   ` Eric Blake

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