From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47325) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X74Xz-00015d-Gs for qemu-devel@nongnu.org; Tue, 15 Jul 2014 11:21:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X74Xq-0002Tm-Fd for qemu-devel@nongnu.org; Tue, 15 Jul 2014 11:21:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39847) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X74Xq-0002SW-6v for qemu-devel@nongnu.org; Tue, 15 Jul 2014 11:21:30 -0400 Message-ID: <53C546F1.1090003@redhat.com> Date: Tue, 15 Jul 2014 17:21:21 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1405077612-7806-1-git-send-email-stefanha@redhat.com> <1405077612-7806-3-git-send-email-stefanha@redhat.com> <53C39685.2090400@redhat.com> <53C3B5C2.7010001@redhat.com> <20140715143718.GA19441@stefanha-thinkpad.redhat.com> In-Reply-To: <20140715143718.GA19441@stefanha-thinkpad.redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH for-2.1? 2/2] thread-pool: avoid deadlock in nested aio_poll() calls List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Christian Borntraeger , qemu-devel@nongnu.org, Stefan Hajnoczi Il 15/07/2014 16:37, Stefan Hajnoczi ha scritto: >> > This is of course missing here: >> > >> > break; > Let's keep goto restart so we don't use the BH for each completion > callback. We just need the BH scheduled once to protect against the > deadlock. Ah, I missed this remark. Then you could add qemu_bh_cancel at the end of the BH handler. I do find the code a little harder to follow with the "goto" though, as it's not clear who will take care of the rest of the list... Paolo