From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51526) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZHAPN-0002dW-1W for qemu-devel@nongnu.org; Mon, 20 Jul 2015 08:43:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZHAPI-0000SP-W1 for qemu-devel@nongnu.org; Mon, 20 Jul 2015 08:43:00 -0400 Received: from mx5-phx2.redhat.com ([209.132.183.37]:44218) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZHAPI-0000SB-Oq for qemu-devel@nongnu.org; Mon, 20 Jul 2015 08:42:56 -0400 Date: Mon, 20 Jul 2015 08:42:55 -0400 (EDT) From: Paolo Bonzini Message-ID: <1108497253.1650856.1437396175024.JavaMail.zimbra@redhat.com> In-Reply-To: <20150720100648.GA22650@ad.nay.redhat.com> References: <1437370031-9070-1-git-send-email-pbonzini@redhat.com> <20150720074625.GA20738@ad.nay.redhat.com> <20150720100648.GA22650@ad.nay.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] R: Re: [PATCH v2] AioContext: fix broken placement of event_notifier_test_and_clear List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: kwolf@redhat.com, lersek@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com, rjones@redhat.com > > I'm looking at optimizing it but I don't fully understand the relationship > > between aio_prepare and WaitForMultipleObjects. Do they get the same set of > > events? > > After some reading I think WaitForMultipleObjects is for event notifiers and > aio_prepare is for select() on fd events. > It's a bit trickier than aio-posix, in the first iteration there could be > another event masking ctx->notifier so we don't know if we need to clear it. > Maybe we can reverse events[] so that ctx->notifier will be the 0th one. And I > think we can always remove it after first iteration, am I right? Yes, that would work. I am not sure how complex it would be. You would also need a solution for the GSource and one (probably similar to aio-posix) for your epoll implementation. With ctx->notified at least you can encapsulate it in aio_notify_accept... Stefan, any preferences? Paolo