Skip to content

virtio-blk: remove AioContext lock

Stefan Hajnoczi qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest8 patches 8 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8virtio_queue_aio_attach_host_notifier: remove AioContext lockhw/block/dataplane/virtio-blk.c hw/block/virtio-blk.c hw/scsi/virtio-scsi-dataplane.c +2 more+15 -131 reply
2/8block-backend: enable_write_cache should be atomicblock/block-backend.c hw/block/virtio-blk.c+3 -71 reply
3/8virtio: categorize callbacks in GShw/block/virtio-blk.c hw/virtio/virtio-bus.c hw/virtio/virtio-pci.c +1 more+17 -01 reply
4/8virtio-blk: mark GLOBAL_STATE_CODE functionshw/block/dataplane/virtio-blk.c hw/block/virtio-blk.c+31 -01 reply
5/8virtio-blk: mark IO_CODE functionshw/block/dataplane/virtio-blk.c hw/block/virtio-blk.c+43 -61 reply
6/8virtio-blk: remove unnecessary AioContext lock from function already safehw/block/virtio-blk.c+2 -171 reply
7/8virtio-blk: don't acquire AioContext in virtio_blk_handle_vq()hw/block/virtio-blk.c+0 -21 reply
8/8virtio-blk: minimize virtio_blk_reset() AioContext lock regionhw/block/virtio-blk.c+1 -21 reply

Reviews trailers per patch

7 of 8 patches have a Reviewed-by or Acked-by.

PatchStefan HajnocziMichael S. TsirkinEmanuele Giuseppe Esposito
1/8R-b
2/8R-b R-b
3/8R-b A-b R-b
4/8R-b R-b
5/8R-b R-b
6/8R-b R-b
7/8
8/8R-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 3 reviewers.

Read the v1 thread

Cover letter [PATCH 0/8] virtio-blk: remove AioContext lock

This is a continuation of Emanuele Esposito's work to remove the AioContext lock in virtio-blk. In the past it was necessary to acquire the AioContext lock in order to do I/O. Paolo Bonzini and Emanuele have removed the need for the AioContext in the core block layer code, with a few exceptions like blk_drain() and blk_set_aio_context().

This patch series annotates virtio-blk functions with IO_CODE()/GLOBAL_STATE_CODE() so it's clear in which context they are called. It also removes unnecessary AioContext locks.

The end result is that virtio-blk rarely takes the AioContext lock. Future patch series will add support for multiple IOThreads so that true multi-queue can be achieved, but right now virtio-blk still has unprotected shared state like s->rq so that needs to wait for another day.

Based-on: <[email protected]>

Emanuele Giuseppe Esposito (6):
virtio_queue_aio_attach_host_notifier: remove AioContext lock
block-backend: enable_write_cache should be atomic
virtio: categorize callbacks in GS
virtio-blk: mark GLOBAL_STATE_CODE functions
virtio-blk: mark IO_CODE functions
virtio-blk: remove unnecessary AioContext lock from function already
safe

Stefan Hajnoczi (2):
virtio-blk: don't acquire AioContext in virtio_blk_handle_vq()
virtio-blk: minimize virtio_blk_reset() AioContext lock region

 include/block/aio-wait.h        |  4 +-
 block/block-backend.c           |  6 +--
 hw/block/dataplane/virtio-blk.c | 18 +++++--
 hw/block/virtio-blk.c           | 92 ++++++++++++++++++++++++---------
 hw/scsi/virtio-scsi-dataplane.c | 10 ++--
 hw/virtio/virtio-bus.c          |  5 ++
 hw/virtio/virtio-pci.c          |  2 +
 hw/virtio/virtio.c              |  8 +++
 util/aio-wait.c                 |  2 +-
 9 files changed, 106 insertions(+), 41 deletions(-)
Signature · 1 line
2.38.1