[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 00/11] block: Re-enable the graph lock
From: |
Kevin Wolf |
Subject: |
[PATCH 00/11] block: Re-enable the graph lock |
Date: |
Wed, 31 May 2023 13:02:20 +0200 |
This series fixes the deadlock that was observed before commit ad128dff
('graph-lock: Disable locking for now'), which just disabled the graph
lock completely as a workaround to get 8.0.1 stable.
In theory the problem is simple: We can't poll while still holding the
lock of a different AioContext. So bdrv_graph_wrlock() just needs to
drop that lock before it polls. However, there are a number of callers
that don't even hold the AioContext lock they are supposed to hold, so
temporarily unlocking tries to unlock a mutex that isn't locked,
resulting in assertion failures.
Therefore, much of this series is just for fixing AioContext locking
correctness. It is only the last two patches that actually fix the
deadlock and reenable the graph locking.
Kevin Wolf (11):
iotests: Test active commit with iothread and background I/O
qdev-properties-system: Lock AioContext for blk_insert_bs()
test-block-iothread: Lock AioContext for blk_insert_bs()
block: Fix AioContext locking in bdrv_open_child()
block: Fix AioContext locking in bdrv_attach_child_common()
block: Fix AioContext locking in bdrv_reopen_parse_file_or_backing()
block: Fix AioContext locking in bdrv_open_inherit()
block: Fix AioContext locking in bdrv_open_backing_file()
blockjob: Fix AioContext locking in block_job_add_bdrv()
graph-lock: Unlock the AioContext while polling
Revert "graph-lock: Disable locking for now"
include/block/graph-lock.h | 6 +-
block.c | 103 ++++++++++++++++--
block/graph-lock.c | 40 ++++---
blockjob.c | 17 ++-
hw/core/qdev-properties-system.c | 3 +
tests/unit/test-block-iothread.c | 7 +-
.../tests/iothreads-commit-active | 85 +++++++++++++++
.../tests/iothreads-commit-active.out | 23 ++++
8 files changed, 247 insertions(+), 37 deletions(-)
create mode 100755 tests/qemu-iotests/tests/iothreads-commit-active
create mode 100644 tests/qemu-iotests/tests/iothreads-commit-active.out
--
2.40.1
- [PATCH 00/11] block: Re-enable the graph lock,
Kevin Wolf <=
- [PATCH 09/11] blockjob: Fix AioContext locking in block_job_add_bdrv(), Kevin Wolf, 2023/05/31
- [PATCH 02/11] qdev-properties-system: Lock AioContext for blk_insert_bs(), Kevin Wolf, 2023/05/31
- [PATCH 03/11] test-block-iothread: Lock AioContext for blk_insert_bs(), Kevin Wolf, 2023/05/31
- [PATCH 05/11] block: Fix AioContext locking in bdrv_attach_child_common(), Kevin Wolf, 2023/05/31
- [PATCH 10/11] graph-lock: Unlock the AioContext while polling, Kevin Wolf, 2023/05/31
- [PATCH 01/11] iotests: Test active commit with iothread and background I/O, Kevin Wolf, 2023/05/31
- [PATCH 06/11] block: Fix AioContext locking in bdrv_reopen_parse_file_or_backing(), Kevin Wolf, 2023/05/31
- [PATCH 11/11] Revert "graph-lock: Disable locking for now", Kevin Wolf, 2023/05/31
- [PATCH 08/11] block: Fix AioContext locking in bdrv_open_backing_file(), Kevin Wolf, 2023/05/31
- [PATCH 04/11] block: Fix AioContext locking in bdrv_open_child(), Kevin Wolf, 2023/05/31