[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 13/19] block: Remove aio_poll() in bdrv_drain_pol
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH v3 13/19] block: Remove aio_poll() in bdrv_drain_poll variants |
Date: |
Thu, 20 Sep 2018 18:19:52 +0200 |
bdrv_drain_poll_top_level() was buggy because it didn't release the
AioContext lock of the node to be drained before calling aio_poll().
This way, callbacks called by aio_poll() would possibly take the lock a
second time and run into a deadlock with a nested AIO_WAIT_WHILE() call.
However, it turns out that the aio_poll() call isn't actually needed any
more. It was introduced in commit 91af091f923, which is effectively
reverted by this patch. The cases it was supposed to fix are now covered
by bdrv_drain_poll(), which waits for block jobs to reach a quiescent
state.
Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
---
block/io.c | 8 --------
1 file changed, 8 deletions(-)
diff --git a/block/io.c b/block/io.c
index 914ba78f1a..8b81ff3913 100644
--- a/block/io.c
+++ b/block/io.c
@@ -268,10 +268,6 @@ bool bdrv_drain_poll(BlockDriverState *bs, bool recursive,
static bool bdrv_drain_poll_top_level(BlockDriverState *bs, bool recursive,
BdrvChild *ignore_parent)
{
- /* Execute pending BHs first and check everything else only after the BHs
- * have executed. */
- while (aio_poll(bs->aio_context, false));
-
return bdrv_drain_poll(bs, recursive, ignore_parent, false);
}
@@ -511,10 +507,6 @@ static bool bdrv_drain_all_poll(void)
BlockDriverState *bs = NULL;
bool result = false;
- /* Execute pending BHs first (may modify the graph) and check everything
- * else only after the BHs have executed. */
- while (aio_poll(qemu_get_aio_context(), false));
-
/* bdrv_drain_poll() can't make changes to the graph and we are holding the
* main AioContext lock, so iterating bdrv_next_all_states() is safe. */
while ((bs = bdrv_next_all_states(bs))) {
--
2.13.6
- [Qemu-devel] [PATCH v3 01/19] job: Fix missing locking due to mismerge, (continued)
- [Qemu-devel] [PATCH v3 01/19] job: Fix missing locking due to mismerge, Kevin Wolf, 2018/09/20
- [Qemu-devel] [PATCH v3 03/19] aio-wait: Increase num_waiters even in home thread, Kevin Wolf, 2018/09/20
- [Qemu-devel] [PATCH v3 05/19] test-blockjob: Acquire AioContext around job_cancel_sync(), Kevin Wolf, 2018/09/20
- [Qemu-devel] [PATCH v3 04/19] test-bdrv-drain: Drain with block jobs in an I/O thread, Kevin Wolf, 2018/09/20
- [Qemu-devel] [PATCH v3 06/19] job: Use AIO_WAIT_WHILE() in job_finish_sync(), Kevin Wolf, 2018/09/20
- [Qemu-devel] [PATCH v3 09/19] block-backend: Add .drained_poll callback, Kevin Wolf, 2018/09/20
- [Qemu-devel] [PATCH v3 11/19] block-backend: Decrease in_flight only after callback, Kevin Wolf, 2018/09/20
- [Qemu-devel] [PATCH v3 08/19] block: Add missing locking in bdrv_co_drain_bh_cb(), Kevin Wolf, 2018/09/20
- [Qemu-devel] [PATCH v3 12/19] blockjob: Lie better in child_job_drained_poll(), Kevin Wolf, 2018/09/20
- [Qemu-devel] [PATCH v3 13/19] block: Remove aio_poll() in bdrv_drain_poll variants,
Kevin Wolf <=
- [Qemu-devel] [PATCH v3 10/19] block-backend: Fix potential double blk_delete(), Kevin Wolf, 2018/09/20
- [Qemu-devel] [PATCH v3 14/19] test-bdrv-drain: Test nested poll in bdrv_drain_poll_top_level(), Kevin Wolf, 2018/09/20
- [Qemu-devel] [PATCH v3 07/19] test-bdrv-drain: Test AIO_WAIT_WHILE() in completion callback, Kevin Wolf, 2018/09/20
- [Qemu-devel] [PATCH v3 15/19] job: Avoid deadlocks in job_completed_txn_abort(), Kevin Wolf, 2018/09/20
- [Qemu-devel] [PATCH v3 16/19] test-bdrv-drain: AIO_WAIT_WHILE() in job .commit/.abort, Kevin Wolf, 2018/09/20
- [Qemu-devel] [PATCH v3 17/19] test-bdrv-drain: Fix outdated comments, Kevin Wolf, 2018/09/20
- [Qemu-devel] [PATCH v3 19/19] test-bdrv-drain: Test draining job source child and parent, Kevin Wolf, 2018/09/20