block: Some multi-threading fixes
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest19 patches 11 repliesIn review
- v116 patches 19 repliesSuperseded
Changes in v2 from the cover letter
- Kept .ret = EINPGORESS-style initializations where they already had been (curl, nvme)
- Dropped trivial BH waking code (i.e. which can be directly replaced by aio_co_wake()) in iscsi, nfs, nvme
- curl: Yield in curl_do_preadv() (former curl_setup_preadv()) and curl_find_buf() instead of returning whether curl_co_preadv() has to yield or not
- nvme: Added a patch that annotates some functions (primarily BHs and CBs) with which AioContext they (must) run in
- qcow2 cache-cleaning timer: Run the timer as a coroutine instead of in a timer CB; use a CoQueue to await it exiting instead of polling (well, we still need to poll in case we don’t run in a coroutine, but that’s standard procedure, I believe)
- The need to initialize the CoQueue showed that there is a code path in qcow2 that doesn’t initialize its CoMutex. Added a patch to do that.
- Also added a patch to have the timer use realtime instead of virtual time.
Patches in v2 No applies recorded yet
Reviews trailers per patch
None of the 19 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.
| Patch | Kevin Wolf | Stefan Hajnoczi |
|---|---|---|
| Series | R-b | R-b |
| 1/19 | ||
| 2/19 | ||
| 3/19 | ||
| 4/19 | ||
| 5/19 | ||
| 6/19 | ||
| 7/19 | ||
| 8/19 | ||
| 9/19 | ||
| 10/19 | ||
| 11/19 | ||
| 12/19 | ||
| 13/19 | ||
| 14/19 | ||
| 15/19 | ||
| 16/19 | ||
| 17/19 | ||
| 18/19 | ||
| 19/19 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v2 00/19] block: Some multi-threading fixes
Hi,
See the v1 cover letter for a general overview:
https://lists.nongnu.org/archive/html/qemu-block/2025-10/msg00501.html
Changes in v2:
- Kept .ret = EINPGORESS-style initializations where they already had been (curl, nvme)
- Dropped trivial BH waking code (i.e. which can be directly replaced by aio_co_wake()) in iscsi, nfs, nvme
- curl: Yield in curl_do_preadv() (former curl_setup_preadv()) and curl_find_buf() instead of returning whether curl_co_preadv() has to yield or not
- nvme: Added a patch that annotates some functions (primarily BHs and CBs) with which AioContext they (must) run in
- qcow2 cache-cleaning timer: Run the timer as a coroutine instead of in a timer CB; use a CoQueue to await it exiting instead of polling (well, we still need to poll in case we don’t run in a coroutine, but that’s standard procedure, I believe)
- The need to initialize the CoQueue showed that there is a code path in qcow2 that doesn’t initialize its CoMutex. Added a patch to do that.
- Also added a patch to have the timer use realtime instead of virtual time.
git backport-diff against v1:
Key:
[----] : patches are identical
[####] : number of functional differences between upstream/downstream patch [down] : patch is downstream-only
The flags [FC] indicate (F)unctional and (C)ontextual differences, respectively
001/19:[----] [--] 'block: Note on aio_co_wake use if not yet yielding' 002/19:[----] [--] 'rbd: Run co BH CB in the coroutine’s AioContext' 003/19:[0019] [FC] 'iscsi: Run co BH CB in the coroutine’s AioContext' 004/19:[0022] [FC] 'nfs: Run co BH CB in the coroutine’s AioContext' 005/19:[0060] [FC] 'curl: Fix coroutine waking' 006/19:[----] [--] 'gluster: Do not move coroutine into BDS context' 007/19:[----] [--] 'nvme: Kick and check completions in BDS context' 008/19:[0038] [FC] 'nvme: Fix coroutine waking' 009/19:[down] 'nvme: Note in which AioContext some functions run' 010/19:[----] [--] 'block/io: Take reqs_lock for tracked_requests' 011/19:[down] 'qcow2: Re-initialize lock in invalidate_cache' 012/19:[0145] [FC] 'qcow2: Fix cache_clean_timer' 013/19:[down] 'qcow2: Schedule cache-clean-timer in realtime' 014/19:[----] [--] 'ssh: Run restart_coroutine in current AioContext' 015/19:[----] [--] 'blkreplay: Run BH in coroutine’s AioContext' 016/19:[----] [--] 'block: Note in which AioContext AIO CBs are called' 017/19:[----] [--] 'iscsi: Create AIO BH in original AioContext' 018/19:[----] [--] 'null-aio: Run CB in original AioContext' 019/19:[----] [--] 'win32-aio: Run CB in original context'
Hanna Czenczek (19):
block: Note on aio_co_wake use if not yet yielding
rbd: Run co BH CB in the coroutine’s AioContext
iscsi: Run co BH CB in the coroutine’s AioContext
nfs: Run co BH CB in the coroutine’s AioContext
curl: Fix coroutine waking
gluster: Do not move coroutine into BDS context
nvme: Kick and check completions in BDS context
nvme: Fix coroutine waking
nvme: Note in which AioContext some functions run block/io: Take reqs_lock for tracked_requests
qcow2: Re-initialize lock in invalidate_cache
qcow2: Fix cache_clean_timer
qcow2: Schedule cache-clean-timer in realtime
ssh: Run restart_coroutine in current AioContext
blkreplay: Run BH in coroutine’s AioContext
block: Note in which AioContext AIO CBs are called
iscsi: Create AIO BH in original AioContext
null-aio: Run CB in original AioContext
win32-aio: Run CB in original context
block/qcow2.h | 5 +- include/block/aio.h | 15 ++++ include/block/block_int-common.h | 7 +- block/blkreplay.c | 3 +- block/curl.c | 45 +++++++--- block/gluster.c | 17 ++-- block/io.c | 3 + block/iscsi.c | 63 ++++++-------- block/nfs.c | 41 ++++----- block/null.c | 7 +- block/nvme.c | 113 ++++++++++++++++-------- block/qcow2.c | 145 ++++++++++++++++++++++++------- block/rbd.c | 12 +-- block/ssh.c | 22 ++--- block/win32-aio.c | 31 +++++-- 15 files changed, 347 insertions(+), 182 deletions(-)
Signature · 1 line
2.51.1