From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43072) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZG1BF-0005ZK-9C for qemu-devel@nongnu.org; Fri, 17 Jul 2015 04:39:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZG1BC-0004GP-3Z for qemu-devel@nongnu.org; Fri, 17 Jul 2015 04:39:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39061) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZG1BB-0004GL-UQ for qemu-devel@nongnu.org; Fri, 17 Jul 2015 04:39:38 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id A38C3AED78 for ; Fri, 17 Jul 2015 08:39:36 +0000 (UTC) Date: Fri, 17 Jul 2015 09:39:34 +0100 From: Stefan Hajnoczi Message-ID: <20150717083934.GA17781@stefanha-thinkpad.redhat.com> References: <1437040609-9878-1-git-send-email-pbonzini@redhat.com> <1437040609-9878-4-git-send-email-pbonzini@redhat.com> <55A881EB.1040500@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="UugvWAfsgieZRqgk" Content-Disposition: inline In-Reply-To: <55A881EB.1040500@redhat.com> Subject: Re: [Qemu-devel] [PATCH v2 3/3] AioContext: fix broken ctx->dispatching optimization List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: kwolf@redhat.com, lersek@redhat.com, qemu-devel@nongnu.org, rjones@redhat.com --UugvWAfsgieZRqgk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jul 17, 2015 at 06:17:47AM +0200, Paolo Bonzini wrote: >=20 >=20 > On 16/07/2015 11:56, Paolo Bonzini wrote: > > @@ -286,13 +283,15 @@ bool aio_poll(AioContext *ctx, bool blocking) > > npfd =3D 0; > > ctx->walking_handlers--; > > =20 > > + if (blocking) { > > + atomic_sub(&ctx->notify_me, 2); > > + } > > + >=20 > I kept this place for subtracting notify_me because it is the same place > where aio_set_dispatching was called. However, it can be anticipated to >=20 > /* if we have any readable fds, dispatch event */ > if (ret > 0) { > for (i =3D 0; i < npfd; i++) { >=20 > i.e. right after poll. As poll has exited, it can't be blocking the > thread anymore. Stefan, please let me send v3 on Monday. Sure. Stefan --UugvWAfsgieZRqgk Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJVqL9GAAoJEJykq7OBq3PILxAH/0e60OUJUR/fpaInx5gKgcfR ccl3fiPTItJ16RlsLPT62vVajXgeTAPOuv4EioE33xP0sKJis7gQNzlLaMLbaX/9 /LwClu1Ry1WhATpL49/32JecWaxRdCBrySWe4T8L1meaNQN67EtD2KWuxaCa1YKU qn9x+rVamKv1e3eeGLLIYme6PDSSu7TVA67h7ykOH/bcIHjdcu/ZAvfG5duStset 2uA3D8HZuJ0KldSlrgnq3Zo9axkOs7WRpX71B8UcF2ZT6zIYpKcFUbnL5reScM7T QNGz3pJ4FNpBJsFrs5Is4mq39Ts1GmYKvSMO/vcAncmvJbx7d1clAqBC4Xci8t8= =+/ax -----END PGP SIGNATURE----- --UugvWAfsgieZRqgk--