[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/3] block: Forbid bdrv_set_aio_context outside
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH 1/3] block: Forbid bdrv_set_aio_context outside BQL |
Date: |
Tue, 10 Mar 2015 13:34:26 +0000 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Thu, Feb 12, 2015 at 01:21:00PM +0800, Fam Zheng wrote:
> Even if the caller has the old #AioContext, there can be a deadlock, due
> to the leading bdrv_drain_all:
>
> Suppose there are three io threads (a, b, c) with each owning a BDS
> (bds_a, bds_b, bds_c), and a and b want to move their own BDS to c at
> the same time:
>
> iothread a iothread b
> --------------------------------------------------------------------------
> bdrv_set_aio_context(bds_a, c) bdrv_set_aio_context(bds_b, c)
> -> bdrv_drain_all() -> bdrv_drain_all()
> -> acquire a (OK, already has) -> acquire a (blocked)
> -> acquire b (blocked) -> acquire b
> -> acquire c -> acquire c
>
> Current caller of bdrv_set_aio_context outside BQL is
> virtio-scsi-dataplane, which will be fixed in the next patches.
>
> Signed-off-by: Fam Zheng <address@hidden>
> ---
> include/block/block.h | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
Reviewed-by: Stefan Hajnoczi <address@hidden>
pgppzJiqnEPbu.pgp
Description: PGP signature
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [Qemu-devel] [PATCH 1/3] block: Forbid bdrv_set_aio_context outside BQL,
Stefan Hajnoczi <=