From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57329) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZtFEo-0005v1-ES for qemu-devel@nongnu.org; Mon, 02 Nov 2015 08:33:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZtFEn-00052O-Jb for qemu-devel@nongnu.org; Mon, 02 Nov 2015 08:33:30 -0500 Date: Mon, 2 Nov 2015 21:33:19 +0800 From: Fam Zheng Message-ID: <20151102133319.GA10611@ad.usersys.redhat.com> References: <1446177989-6702-1-git-send-email-famz@redhat.com> <1446177989-6702-4-git-send-email-famz@redhat.com> <20151030100724.GG4227@stefanha-x1.localdomain> <20151102023254.GA9184@ad.usersys.redhat.com> <20151102131916.GD10139@stefanha-x1.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151102131916.GD10139@stefanha-x1.localdomain> Subject: Re: [Qemu-devel] [Qemu-block] [PATCH v4 3/3] aio: Introduce aio-epoll.c List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Kevin Wolf , pbonzini@redhat.com, qemu-block@nongnu.org, qemu-devel@nongnu.org, Stefan Hajnoczi On Mon, 11/02 13:19, Stefan Hajnoczi wrote: > On Mon, Nov 02, 2015 at 10:32:54AM +0800, Fam Zheng wrote: > > On Fri, 10/30 10:07, Stefan Hajnoczi wrote: > > > On Fri, Oct 30, 2015 at 12:06:29PM +0800, Fam Zheng wrote: > > > > To comply with aio_{disable,enable}_external, we always use ppoll when > > > > aio_external_disabled() is true. > > > > > > All file descriptors are added to the epoll fd. Does that mean epoll > > > will report the same fds again after we come out of > > > ppoll()/aio_external_disabled()? > > > > > > The two constraints to think about: > > > 1. Ideally there should be no duplicated events. > > > 2. There absolutely cannot be any missed events. > > > > > > > I'm not sure I understood your question. The file descriptors added to epollfd > > are always in sync with ppoll, so there is no difference between calling > > epoll_wait and ppoll. When we come out of aio_external_disabled(), the same set > > of fds will be polled, but the events got by ppoll should already be handled. > > > > What am I missing? > > I'm asking about duplicated events. The epoll fd monitors the same set > of fds as ppoll(). When we come out of aio_external_disabled() will > epoll fd see the old events that have already been handled by ppoll()? No, we don't get duplicated events. epoll fd will only see unhandled (new) events. Fam