From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38730) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V1u4X-00034B-JO for qemu-devel@nongnu.org; Wed, 24 Jul 2013 04:05:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V1u4V-0003YO-I3 for qemu-devel@nongnu.org; Wed, 24 Jul 2013 04:05:21 -0400 Received: from mail.avalus.com ([2001:41c8:10:1dd::10]:37800) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V1u4V-0003YE-DE for qemu-devel@nongnu.org; Wed, 24 Jul 2013 04:05:19 -0400 Date: Wed, 24 Jul 2013 09:05:03 +0100 From: Alex Bligh Message-ID: <82CDEC496AE9AD63FCCEBD0C@nimrod.local> In-Reply-To: <20130724075439.GC31445@stefanha-thinkpad.muc.redhat.com> References: <26DE76D4FD616A2955DC1732@nimrod.local> <20130723121825.GB20857@stefanha-thinkpad.redhat.com> <2B93060044B2D160D39B27F0@nimrod.local> <20130724075439.GC31445@stefanha-thinkpad.muc.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Subject: Re: [Qemu-devel] Question on aio_poll Reply-To: Alex Bligh List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: qemu-devel@nongnu.org, Alex Bligh Stefan, --On 24 July 2013 09:54:39 +0200 Stefan Hajnoczi wrote: >> I left this how it was in the end (I think), and got round it by >> creating a bogus pipe for the test to listen to. > > Doing that requires the changes in my patch series, otherwise you break > aio_poll() loops that are waiting for pending I/O requests. They don't > want to wait for timers. Sorry I meant leaving the main code as is, and creating the bogus pipe solely in tests/test-aio.c in my new test that tests a timer attached to AioContext - no changes elsewhere. > I hope we can eventually unify event loops and then the select function > should behave as you described. For now though, we need to keep the > current behavior until my .io_flush() removal series or something > equivalent is merged, at least. OK. That's pretty much the way I went with the PATCHv2 series. >> I note you now have: >> if (ctx->pollfds->len == 1) { >> return progress; >> } >> >> Is the '1' there the event notifier? How do we know there is only >> one of them? > > There many be many EventNotifier instances. That's not what matters. > > Rather, it's about the aio_notify() EventNotifier. Each AioContext has > its own EventNotifier which can be signalled with aio_notify(). The > purpose of this function is to kick an event loop that is blocking in > select()/poll(). This is necessary when another thread modifies > something that the AioContext needs to act upon, such as adding/removing > an fd. Thanks -- Alex Bligh