From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:54218) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R8Ynl-0000Zz-Ii for qemu-devel@nongnu.org; Tue, 27 Sep 2011 10:38:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R8Ynk-0004Z6-Kk for qemu-devel@nongnu.org; Tue, 27 Sep 2011 10:38:29 -0400 Received: from mail-yi0-f45.google.com ([209.85.218.45]:56464) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R8Ynk-0004YN-IE for qemu-devel@nongnu.org; Tue, 27 Sep 2011 10:38:28 -0400 Received: by yib2 with SMTP id 2so6908361yib.4 for ; Tue, 27 Sep 2011 07:38:28 -0700 (PDT) Message-ID: <4E81DFE1.2090805@codemonkey.ws> Date: Tue, 27 Sep 2011 09:38:25 -0500 From: Anthony Liguori MIME-Version: 1.0 References: <4E78C42D.5030207@siemens.com> <20110921080600.GA9847@stefanha-thinkpad.localdomain> <4E80B50B.9000301@siemens.com> <4E80B55F.5020203@redhat.com> <4E80BFF3.8000907@us.ibm.com> <4E8190BE.3000801@redhat.com> <4E81D609.1060203@siemens.com> <4E81D88B.4020504@codemonkey.ws> <4E81D99C.4060102@redhat.com> <4E81DB75.9030301@codemonkey.ws> <4E81DC35.2040007@siemens.com> In-Reply-To: <4E81DC35.2040007@siemens.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] Use qemu_eventfd for POSIX AIO List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: Kevin Wolf , Anthony Liguori , Stefan Hajnoczi , Marcelo Tosatti , qemu-devel , Avi Kivity On 09/27/2011 09:22 AM, Jan Kiszka wrote: > On 2011-09-27 16:19, Anthony Liguori wrote: >> On 09/27/2011 09:11 AM, Avi Kivity wrote: >>> On 09/27/2011 05:07 PM, Anthony Liguori wrote: >>>> >>>> You don't expect to handle EAGAIN with eventfd() whereas you have to handle it >>>> with pipe(). >>>> >>>> Moreover, the eventfd() counter is not lossy (practically speaking) whereas if >>>> you use pipe() as a counter, it will be lossy in practice. >>>> >>>> This is why posix aio uses pipe() and not eventfd(). >>> >>> We could define a qemu_event mechanism that satisfies the least common >>> denominator, and is implemented by eventfd when available. >>> >>> qemu_event_create() >>> qemu_event_signal() >>> qemu_event_wait() >>> qemu_event_poll_add() // registers in main loop >>> qemu_event_poll_del() >> >> See hw/event_notifier.[ch]. > > That code looks suspicious, btw. It claims things ("we use > EFD_SEMAPHORE") it does not do. Indeed. But the interface appears to be the right one IMHO. Regards, Anthony Liguori > > Jan >