From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:32822) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X4nGN-0000Tt-6n for qemu-devel@nongnu.org; Wed, 09 Jul 2014 04:30:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X4nGI-0000qQ-Mv for qemu-devel@nongnu.org; Wed, 09 Jul 2014 04:30:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35631) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X4nGI-0000qD-D9 for qemu-devel@nongnu.org; Wed, 09 Jul 2014 04:29:58 -0400 Date: Wed, 9 Jul 2014 10:29:51 +0200 From: Stefan Hajnoczi Message-ID: <20140709082951.GA5152@stefanha-thinkpad.redhat.com> References: <1404834310-12856-1-git-send-email-ming.lei@canonical.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="6TrnltStXW4iwmi0" Content-Disposition: inline In-Reply-To: <1404834310-12856-1-git-send-email-ming.lei@canonical.com> Subject: Re: [Qemu-devel] [PATCH] linux-aio: fix submit aio as a batch List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Ming Lei Cc: Kevin Wolf , Peter Maydell , Fam Zheng , "Michael S. Tsirkin" , qemu-devel@nongnu.org, Paolo Bonzini --6TrnltStXW4iwmi0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Jul 08, 2014 at 11:45:10PM +0800, Ming Lei wrote: > In the enqueue path, we can't complete request, otherwise > "Co-routine re-entered recursively" may be caused, so this > patch fixes the issue with below ideas: Thi probably happens when the caller is in coroutine context and its completion function invokes qemu_coroutine_enter() on itself. The solution is to invoke completions from a BH (other places in the block layer do this too). > - for -EAGAIN, retry the submission in an introduced event handler I agree with Paolo that a BH is appropriate. > - for part of completion, just update the io queue, since it is > moving on after all If we do this then we need to guarantee that io_submit() will be called at some point soon. Otherwise requests could get stuck if the guest doesn't submit any more I/O requests to push the queue. Please split this into separate patches. You're trying to do too much. Overall, I would prefer it if we avoid the extra complexity of deferring io_submit() on EAGAIN and partial submission. Do you understand why the kernel is producing this behavior? Can we set the right capacity in io_setup() so it doesn't happen? > + if (enqueue) > + return ret; Please set up a git hook to run checkpatch.pl. It will alert you when you violate QEMU coding style: http://blog.vmsplice.net/2011/03/how-to-automatically-run-checkpatchpl.html I already mentioned coding style in previous patches, using a git hook will avoid it happening again. --6TrnltStXW4iwmi0 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJTvP1/AAoJEJykq7OBq3PIeH4IALYHKLvHj20wEZ5PvdfWDjFR 8yV+nrTEt5Ne53qPQthGd0giYSj68IWSkQMKm1aSvm7cCy7ulPFbfWA/Tntg8/23 uQW8/Ifyug6Ug0tXaFYXV4x8KSISExHsHlPGYn0txO8Ohhl4MU6mJHwqznAq+W1x mP0Ip36ZIVV8s0vl0brV6fj5J2QkZKeWm4InfhhCLbRrmXbDHHSPasURIQUmp6Rz OdqZnQccSj9GnbwgKiF88OPxwcQbMtTeglBrWPVPWlSskMJcajW9WLphH7fFmvw5 ip+H9V5zb8mPMUY6sOh2MgyLJqKKXFbzorBBZdUyVU9XfL3de27HvfRzQHeB8xA= =/0be -----END PGP SIGNATURE----- --6TrnltStXW4iwmi0--