From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54656) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XNNei-00026O-Co for qemu-devel@nongnu.org; Fri, 29 Aug 2014 11:00:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XNNea-0006HE-3M for qemu-devel@nongnu.org; Fri, 29 Aug 2014 11:00:00 -0400 Received: from mail-wi0-x234.google.com ([2a00:1450:400c:c05::234]:50669) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XNNeZ-0006HA-SA for qemu-devel@nongnu.org; Fri, 29 Aug 2014 10:59:52 -0400 Received: by mail-wi0-f180.google.com with SMTP id ex7so2684190wid.7 for ; Fri, 29 Aug 2014 07:59:50 -0700 (PDT) Date: Fri, 29 Aug 2014 15:59:47 +0100 From: Stefan Hajnoczi Message-ID: <20140829145947.GA17125@stefanha-thinkpad.redhat.com> References: <1407167793-20425-1-git-send-email-stefanha@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="azLHFNyN32YCQGCU" Content-Disposition: inline In-Reply-To: <1407167793-20425-1-git-send-email-stefanha@redhat.com> Subject: Re: [Qemu-devel] [PATCH] linux-aio: avoid deadlock in nested aio_poll() calls List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Kevin Wolf , Paolo Bonzini , Ming Lei , Marcin =?utf-8?Q?Gibu=C5=82a?= , qemu-devel@nongnu.org --azLHFNyN32YCQGCU Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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. >=20 > 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. >=20 > Cc: Kevin Wolf > Cc: Paolo Bonzini > Cc: Ming Lei > Cc: Marcin Gibu=C5=82a > Reported-by: Marcin Gibu=C5=82a > Signed-off-by: Stefan Hajnoczi > --- > 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 --azLHFNyN32YCQGCU Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJUAJVjAAoJEJykq7OBq3PITZ4H/R+2U8qX8Uu7789mY2nIH7wg n8tgLxZWs3S5TvYtVzVM8NmZcr9gTkWSt239U7yhP6c9g4aePGSFW2ySLlTfjJbp UMeBSmuOBLyyQ8UUhqgJU4YjIFpxdMMAK6lU6KEt/+L9+EPoCrOBMzh0l86K5scn 9W/zr6ThBaX+Uxbgy9g8D7kdtt2EQBErFuPbsuB5CrALBmFW75QaBIX7DFi7Jc9j rRIYURaBDrFUbJ7D1Loz5kk8Q1f/M6r1UKNqdFYf05Fmw/eH9nMBloRLMk+OChaF wO+kZlQi+sPlkSHRtIrvtEN07YMuzowo3Ppb7EmHTHnFWe+ec8EHDptb3PAvals= =Y7o2 -----END PGP SIGNATURE----- --azLHFNyN32YCQGCU--