From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57774) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZJfWC-0008FK-Fg for qemu-devel@nongnu.org; Mon, 27 Jul 2015 06:20:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZJfW9-0003qY-AS for qemu-devel@nongnu.org; Mon, 27 Jul 2015 06:20:24 -0400 Received: from mail-wi0-x234.google.com ([2a00:1450:400c:c05::234]:34729) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZJfW9-0003qC-1e for qemu-devel@nongnu.org; Mon, 27 Jul 2015 06:20:21 -0400 Received: by wibud3 with SMTP id ud3so133431780wib.1 for ; Mon, 27 Jul 2015 03:20:20 -0700 (PDT) Date: Mon, 27 Jul 2015 11:20:16 +0100 From: Stefan Hajnoczi Message-ID: <20150727102016.GE30018@stefanha-thinkpad.redhat.com> References: <1437738175-23624-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="imjhCm/Pyz7Rq5F2" Content-Disposition: inline In-Reply-To: <1437738175-23624-1-git-send-email-pbonzini@redhat.com> Subject: Re: [Qemu-devel] [PATCH v2] main-loop: fix qemu_notify_event for aio_notify optimization List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: peter.maydell@linaro.org, qemu-devel@nongnu.org --imjhCm/Pyz7Rq5F2 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jul 24, 2015 at 01:42:55PM +0200, Paolo Bonzini wrote: > aio_notify can be optimized away, and in fact almost always will. Howeve= r, > qemu_notify_event is used in places where this is incorrect---most notabl= y, > when handling SIGTERM. When aio_notify is optimized away, it is possible= that > QEMU enters a blocking ppoll immediately afterwards and stays there, with= out > reaching main_loop_should_exit(). >=20 > Fix this by using a bottom half. The bottom half can be optimized too, b= ut > scheduling it is enough for the ppoll not to block. The hang is thus avo= ided. >=20 > Reported-by: Peter Maydell > Signed-off-by: Paolo Bonzini > --- > main-loop.c | 11 ++++++++++- > 1 file changed, 10 insertions(+), 1 deletion(-) Reviewed-by: Stefan Hajnoczi --imjhCm/Pyz7Rq5F2 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJVtgXgAAoJEJykq7OBq3PI2IwH/jKk75AS/ZiONKsaeUFePPQu HBcrRW00P6FcZkT2fCZgVbtMJ3gT5VsfUNFN/Vx7pX9Mv/T9ghmr+Aa8ORkXsqPd de3B9hDSZMNmbWqvA5tPtdcr5gQsSodoOaoFz5T2DeLuwgaDCbUaXey2OPAIW9jW sRYsrnyuFGeVgmP0T/gANLc1rKOnPdex8w32Fl/NQb1odRv4zq6iO/pyq0Tt8XxQ EOcd/+GWV67hvxuB5rpvxFFjrMNAyrASFTs2ZJiB8N/i5phy8z85BAcby48fHIY7 C0bKd1wVxPHZthSs6ZzWfv4XGxwTzuaFHnIZ6CudSnskIkPrcOdrR4vHRkEomR0= =EMvV -----END PGP SIGNATURE----- --imjhCm/Pyz7Rq5F2--