Skip to content

virtio-blk: use blk_io_plug_call() instead of notification BH

Stefan Hajnoczi qemu-devel xen-devel 3 versions – Applied

Status from this message: Thanks, applied to the block branch.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest4 patches 2 repliesApplied
  2. v24 patches 7 repliesSuperseded
  3. v12 patches 4 repliesSuperseded

Changes in v3 from the cover letter

- Add comment pointing to API documentation in .c file [Philippe]
- Add virtio_notify_irqfd_deferred_fn trace event [Ilya]
- Remove outdated #include [Ilya]

Patches in v3 Applied

#Subject and filesSizeRepliesApplied
1/4block: rename blk_io_plug_call() API to defer_call()block/blkio.c block/io_uring.c block/linux-aio.c +6 more+76 -790 replies
2/4util/defer-call: move defer_call() to util/MAINTAINERS block/blkio.c block/io_uring.c +10 more+27 -70 replies
3/4virtio: use defer_call() in virtio_irqfd_notify()block/io_uring.c block/linux-aio.c hw/virtio/trace-events +2 more+28 -10 replies
4/4virtio-blk: remove batch notification BHhw/block/dataplane/virtio-blk.c+1 -470 replies

Reviews trailers per patch

All 4 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchPhilippe Mathieu-DaudéPaul DurrantEric BlakeMichael S. Tsirkin
SeriesR-b
1/4R-b R-b
2/4R-b
3/4R-b
4/4R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v3 thread

Cover letter [PATCH v3 0/4] virtio-blk: use blk_io_plug_call() instead of notification BH

v3:
- Add comment pointing to API documentation in .c file [Philippe]
- Add virtio_notify_irqfd_deferred_fn trace event [Ilya]
- Remove outdated #include [Ilya]
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         |  16 +++
 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                |  13 ++-
 util/defer-call.c                 | 156 +++++++++++++++++++++++++++++
 util/thread-pool.c                |   5 +
 block/meson.build                 |   1 -
 hw/virtio/trace-events            |   1 +
 util/meson.build                  |   1 +
 18 files changed, 231 insertions(+), 233 deletions(-)
 create mode 100644 include/qemu/defer-call.h
 delete mode 100644 block/plug.c
 create mode 100644 util/defer-call.c
Signature · 1 line
2.41.0