[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC PATCH 5/5] [WIP] Lock AioContext in bdrv_co_drain_bh_c
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [RFC PATCH 5/5] [WIP] Lock AioContext in bdrv_co_drain_bh_cb() |
Date: |
Fri, 17 Aug 2018 19:02:46 +0200 |
Not sure if this is correct, but at least it makes qemu-iotests 127 pass
again.
Signed-off-by: Kevin Wolf <address@hidden>
---
block/io.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/block/io.c b/block/io.c
index 832d2536bf..d3dde4d7fd 100644
--- a/block/io.c
+++ b/block/io.c
@@ -309,6 +309,10 @@ static void bdrv_co_drain_bh_cb(void *opaque)
BdrvCoDrainData *data = opaque;
Coroutine *co = data->co;
BlockDriverState *bs = data->bs;
+ AioContext *ctx;
+
+ ctx = bdrv_get_aio_context(bs);
+ aio_context_acquire(ctx);
if (bs) {
bdrv_dec_in_flight(bs);
@@ -324,6 +328,8 @@ static void bdrv_co_drain_bh_cb(void *opaque)
bdrv_drain_all_begin();
}
+ aio_context_release(ctx);
+
data->done = true;
aio_co_wake(co);
}
--
2.13.6
- [Qemu-devel] [RFC PATCH 0/5] Fix some jobs/drain/aio_poll related hangs, Kevin Wolf, 2018/08/17
- [Qemu-devel] [RFC PATCH 2/5] tests: Acquire AioContext around job_finish_sync(), Kevin Wolf, 2018/08/17
- [Qemu-devel] [RFC PATCH 3/5] job: Drop AioContext lock around aio_poll(), Kevin Wolf, 2018/08/17
- [Qemu-devel] [RFC PATCH 4/5] block: Drop AioContext lock in bdrv_drain_poll_top_level(), Kevin Wolf, 2018/08/17
- [Qemu-devel] [RFC PATCH 1/5] blockjob: Wake up BDS when job becomes idle, Kevin Wolf, 2018/08/17
- [Qemu-devel] [RFC PATCH 5/5] [WIP] Lock AioContext in bdrv_co_drain_bh_cb(),
Kevin Wolf <=
- Re: [Qemu-devel] [RFC PATCH 0/5] Fix some jobs/drain/aio_poll related hangs, no-reply, 2018/08/18
- Re: [Qemu-devel] [RFC PATCH 0/5] Fix some jobs/drain/aio_poll related hangs, Fam Zheng, 2018/08/21