Skip to content

Graph locking part 4 (node management)

Kevin Wolf qemu-devel 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest21 patches 9 repliesIn review
  2. v121 patches 48 repliesSuperseded

Changes in v2 from the cover letter

- Patch 5: Improved comments, added one for bdrv_schedule_unref()

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/21block: Remove unused BlockReopenQueueEntry.perms_checkedblock.c+0 -10 replies
2/21preallocate: Factor out preallocate_truncate_to_real_size()block/preallocate.c+22 -260 replies
3/21preallocate: Don't poll during permission updatesblock/preallocate.c+69 -204 replies
4/21block: Take AioContext lock for bdrv_append() more consistentlytests/unit/test-bdrv-drain.c tests/unit/test-bdrv-graph-mod.c tests/unit/test-block-iothread.c+12 -00 replies
5/21block: Introduce bdrv_schedule_unref()block.c block/graph-lock.c include/block/block-global-state.h +1 more+40 -101 reply
6/21block-coroutine-wrapper: Add no_co_wrapper_bdrv_wrlock functionsinclude/block/block-common.h scripts/block-coroutine-wrapper.py+15 -00 replies
7/21block-coroutine-wrapper: Allow arbitrary parameter namesscripts/block-coroutine-wrapper.py+4 -30 replies
8/21block: Mark bdrv_replace_child_noperm() GRAPH_WRLOCKblock.c+19 -70 replies
9/21block: Mark bdrv_replace_child_tran() GRAPH_WRLOCKblock.c+50 -280 replies
10/21block: Mark bdrv_attach_child_common() GRAPH_WRLOCKblock.c block/stream.c+100 -530 replies
11/21block: Call transaction callbacks with lock heldblock.c+44 -170 replies
12/21block: Mark bdrv_attach_child() GRAPH_WRLOCKblock.c block/quorum.c block/replication.c +3 more+43 -100 replies
13/21block: Mark bdrv_parent_perms_conflict() and callers GRAPH_RDLOCKblock.c block/block-backend.c block/crypto.c +6 more+66 -260 replies
14/21block: Mark bdrv_get_cumulative_perm() and callers GRAPH_RDLOCKblock.c blockdev.c include/block/block_int-common.h +1 more+40 -140 replies
15/21block: Mark bdrv_child_perm() GRAPH_RDLOCKblock.c block/copy-before-write.c include/block/block_int-common.h+16 -150 replies
16/21block: Mark bdrv_parent_cb_change_media() GRAPH_RDLOCKblock.c+5 -10 replies
17/21block: Take graph rdlock in bdrv_drop_intermediate()block.c+2 -01 reply
18/21block: Take graph rdlock in bdrv_change_aio_context()block.c+4 -01 reply
19/21block: Mark bdrv_root_unref_child() GRAPH_WRLOCKblock.c block/block-backend.c blockjob.c +1 more+9 -40 replies
20/21block: Mark bdrv_unref_child() GRAPH_WRLOCKblock.c block/blklogwrites.c block/blkverify.c +7 more+50 -80 replies
21/21block: Mark bdrv_add/del_child() and caller GRAPH_WRLOCKblock/quorum.c blockdev.c include/block/block-global-state.h +1 more+27 -300 replies

Reviews trailers per patch

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

PatchEric BlakeStefan HajnocziEmanuele Giuseppe Esposito
SeriesR-b
1/21R-b R-b R-b
2/21R-b R-b R-b
3/21R-b R-b
4/21R-b R-b R-b
5/21R-b
6/21R-b R-b
7/21R-b R-b
8/21R-b R-b
9/21R-b R-b
10/21R-b
11/21R-b
12/21R-b R-b
13/21R-b R-b
14/21R-b R-b
15/21R-b R-b
16/21R-b R-b
17/21R-b R-b
18/21R-b R-b
19/21R-b R-b
20/21R-b R-b
21/21R-b R-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 v2 thread

Cover letter [PATCH v2 00/21] Graph locking part 4 (node management)

The previous parts of the graph locking changes focussed mostly on the BlockDriver side and taking reader locks while performing I/O. This series focusses more on the functions managing the graph structure, i.e adding, removing and replacing nodes and updating their permissions.

Many of these places actually need to take the writer lock to avoid readers seeing an inconsistent half-updated graph state. Therefore taking the writer lock is now moved from the very low-level function bdrv_replace_child_noperm() into its more high level callers.

v2:
- Patch 5: Improved comments, added one for bdrv_schedule_unref()

Kevin Wolf (21):
block: Remove unused BlockReopenQueueEntry.perms_checked
preallocate: Factor out preallocate_truncate_to_real_size()
preallocate: Don't poll during permission updates
block: Take AioContext lock for bdrv_append() more consistently
block: Introduce bdrv_schedule_unref()
block-coroutine-wrapper: Add no_co_wrapper_bdrv_wrlock functions
block-coroutine-wrapper: Allow arbitrary parameter names
block: Mark bdrv_replace_child_noperm() GRAPH_WRLOCK
block: Mark bdrv_replace_child_tran() GRAPH_WRLOCK
block: Mark bdrv_attach_child_common() GRAPH_WRLOCK
block: Call transaction callbacks with lock held
block: Mark bdrv_attach_child() GRAPH_WRLOCK
block: Mark bdrv_parent_perms_conflict() and callers GRAPH_RDLOCK
block: Mark bdrv_get_cumulative_perm() and callers GRAPH_RDLOCK
block: Mark bdrv_child_perm() GRAPH_RDLOCK
block: Mark bdrv_parent_cb_change_media() GRAPH_RDLOCK
block: Take graph rdlock in bdrv_drop_intermediate()
block: Take graph rdlock in bdrv_change_aio_context()
block: Mark bdrv_root_unref_child() GRAPH_WRLOCK
block: Mark bdrv_unref_child() GRAPH_WRLOCK
block: Mark bdrv_add/del_child() and caller GRAPH_WRLOCK

 include/block/block-common.h                |   4 +
 include/block/block-global-state.h          |  30 +-
 include/block/block_int-common.h            |  34 +-
 include/block/block_int-global-state.h      |  14 +-
 include/sysemu/block-backend-global-state.h |   4 +-
 block.c                                     | 348 ++++++++++++++------
 block/blklogwrites.c                        |   4 +
 block/blkverify.c                           |   2 +
 block/block-backend.c                       |  29 +-
 block/copy-before-write.c                   |  10 +-
 block/crypto.c                              |   6 +-
 block/graph-lock.c                          |  26 +-
 block/mirror.c                              |   8 +
 block/preallocate.c                         | 133 +++++---
 block/qcow2.c                               |   4 +-
 block/quorum.c                              |  23 +-
 block/replication.c                         |   9 +
 block/snapshot.c                            |   2 +
 block/stream.c                              |  20 +-
 block/vmdk.c                                |  13 +
 blockdev.c                                  |  23 +-
 blockjob.c                                  |   2 +
 tests/unit/test-bdrv-drain.c                |  23 +-
 tests/unit/test-bdrv-graph-mod.c            |  20 ++
 tests/unit/test-block-iothread.c            |   3 +
 scripts/block-coroutine-wrapper.py          |  18 +-
 tests/qemu-iotests/051.pc.out               |   6 +-
 27 files changed, 591 insertions(+), 227 deletions(-)
Signature · 1 line
2.41.0