From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36931) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZAYuz-0006pb-J9 for qemu-devel@nongnu.org; Thu, 02 Jul 2015 03:28:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZAYuv-0003z6-4X for qemu-devel@nongnu.org; Thu, 02 Jul 2015 03:28:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49413) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZAYuu-0003ya-VK for qemu-devel@nongnu.org; Thu, 02 Jul 2015 03:28:17 -0400 Date: Thu, 2 Jul 2015 15:17:40 +0800 From: Fam Zheng Message-ID: <20150702071740.GB31230@ad.nay.redhat.com> References: <1435818839-5376-1-git-send-email-famz@redhat.com> <5594E43E.1040400@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5594E43E.1040400@redhat.com> Subject: Re: [Qemu-devel] [PATCH] thread-pool: Notify AIO context upon completion List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Kevin Wolf , borntraeger@de.ibm.com, qemu-devel@nongnu.org, Stefan Hajnoczi On Thu, 07/02 09:11, Paolo Bonzini wrote: > > > On 02/07/2015 08:33, Fam Zheng wrote: > > bdrv_flush() uses a loop like > > > > while (rwco.ret == NOT_DONE) { > > aio_poll(aio_context, true); > > } > > > > to wait for thread pool, which may not get notified about the scheduled > > BH right away, if there is no new event that wakes up a blocking > > qemu_poll_ns(). > > That translates to "the dispatching optimization does not work". :) I > do not think that is the problem. I must be missing something. I see a hang locally with some AioContext patches I'm testing, and this does fix it. I traced that qemu_bh_schedule does call aio_notify and event_notifier_set, so it's curious. Still looking. Fam