Skip to content

block-backend: process I/O in the current AioContext

Stefan Hajnoczi qemu-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 Latest5 patches 8 repliesApplied
  2. v24 patches 3 repliesSuperseded
  3. v12 patches 2 repliesSuperseded

Patches in v3 Applied

#Subject and filesSizeRepliesApplied
1/5block: remove AIOCBInfo->get_aio_context()block/block-backend.c block/io.c hw/nvme/ctrl.c +5 more+10 -572 replies
2/5test-bdrv-drain: avoid race with BH in IOThread drain testtests/unit/test-bdrv-drain.c+8 -02 replies
3/5block-backend: process I/O in the current AioContextblock/block-backend.c+3 -31 reply
4/5block-backend: process zoned requests in the current AioContextblock/block-backend.c+6 -61 reply
5/5block-coroutine-wrapper: use qemu_get_current_aio_context()scripts/block-coroutine-wrapper.py tests/qemu-iotests/051.pc.out+4 -61 reply

Reviews trailers per patch

All 5 patches have a Reviewed-by or Acked-by.

PatchEric BlakeKlaus Jensen
1/5R-b R-b
2/5R-b
3/5R-b
4/5R-b
5/5R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 0/5] block-backend: process I/O in the current AioContext

v3
- Add Patch 2 to fix a race condition in test-bdrv-drain. This was the CI failure that bumped this patch series from Kevin's pull request.
- Add missing 051.pc.out file. I tried qemu-system-aarch64 to see of 051.out also needs to be updated, but no changes were necessary. [Kevin]
v2
- Add patch to remove AIOCBInfo->get_aio_context() [Kevin]
- Add patch to use qemu_get_current_aio_context() in block-coroutine-wrapper so that the wrappers use the current AioContext instead of bdrv_get_aio_context().

Switch blk_aio_*() APIs over to multi-queue by using qemu_get_current_aio_context() instead of blk_get_aio_context(). This change will allow devices to process I/O in multiple IOThreads in the future.

The final patch requires my QIOChannel AioContext series to pass tests/qemu-iotests/check -qcow2 281 because the nbd block driver is now accessed from the main loop thread in addition to the IOThread:
https://lore.kernel.org/qemu-devel/[email protected]/T/#t

Based-on: [email protected]

Stefan Hajnoczi (5):
block: remove AIOCBInfo->get_aio_context()
test-bdrv-drain: avoid race with BH in IOThread drain test
block-backend: process I/O in the current AioContext
block-backend: process zoned requests in the current AioContext
block-coroutine-wrapper: use qemu_get_current_aio_context()

 include/block/aio.h                |  1 -
 include/block/block-global-state.h |  2 ++
 include/block/block-io.h           |  1 -
 block/block-backend.c              | 35 ++++++++----------------------
 block/io.c                         | 23 +++++++-------------
 hw/nvme/ctrl.c                     |  7 ------
 softmmu/dma-helpers.c              |  8 -------
 tests/unit/test-bdrv-drain.c       |  8 +++++++
 util/thread-pool.c                 |  8 -------
 scripts/block-coroutine-wrapper.py |  6 ++---
 tests/qemu-iotests/051.pc.out      |  4 ++--
 11 files changed, 31 insertions(+), 72 deletions(-)
Signature · 1 line
2.41.0