[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] linux-aio: avoid deadlock in nested aio_poll()
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH] linux-aio: avoid deadlock in nested aio_poll() calls |
Date: |
Fri, 29 Aug 2014 15:59:47 +0100 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Mon, Aug 04, 2014 at 04:56:33PM +0100, Stefan Hajnoczi wrote:
> If two Linux AIO request completions are fetched in the same
> io_getevents() call, QEMU will deadlock if request A's callback waits
> for request B to complete using an aio_poll() loop. This was reported
> to happen with the mirror blockjob.
>
> This patch moves completion processing into a BH and makes it resumable.
> Nested event loops can resume completion processing so that request B
> will complete and the deadlock will not occur.
>
> Cc: Kevin Wolf <address@hidden>
> Cc: Paolo Bonzini <address@hidden>
> Cc: Ming Lei <address@hidden>
> Cc: Marcin Gibuła <address@hidden>
> Reported-by: Marcin Gibuła <address@hidden>
> Signed-off-by: Stefan Hajnoczi <address@hidden>
> ---
> block/linux-aio.c | 71
> ++++++++++++++++++++++++++++++++++++++++++-------------
> 1 file changed, 55 insertions(+), 16 deletions(-)
Applied to my block tree:
https://github.com/stefanha/qemu/commits/block
Stefan
pgpztw92vsnAY.pgp
Description: PGP signature