From: Anthony Liguori Subject: Re: [PATCH] qemu-kvm: Switch POSIX compat AIO implementation to upstream Date: Mon, 26 Sep 2011 13:09:55 -0500 Message-ID: <4E80BFF3.8000907@us.ibm.com> References: <4E78C42D.5030207@siemens.com> <20110921080600.GA9847@stefanha-thinkpad.localdomain> <4E80B50B.9000301@siemens.com> <4E80B55F.5020203@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Jan Kiszka , Stefan Hajnoczi , Marcelo Tosatti , kvm , Kevin Wolf To: Avi Kivity Return-path: Received: from e6.ny.us.ibm.com ([32.97.182.146]:46759 "EHLO e6.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751788Ab1IZSKA (ORCPT ); Mon, 26 Sep 2011 14:10:00 -0400 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by e6.ny.us.ibm.com (8.14.4/8.13.1) with ESMTP id p8QHjmki022568 for ; Mon, 26 Sep 2011 13:45:48 -0400 Received: from d03av04.boulder.ibm.com (d03av04.boulder.ibm.com [9.17.195.170]) by d01relay04.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p8QI9wPs241230 for ; Mon, 26 Sep 2011 14:09:58 -0400 Received: from d03av04.boulder.ibm.com (loopback [127.0.0.1]) by d03av04.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p8QI9vC3004808 for ; Mon, 26 Sep 2011 12:09:58 -0600 In-Reply-To: <4E80B55F.5020203@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 09/26/2011 12:24 PM, Avi Kivity wrote: > On 09/26/2011 08:23 PM, Jan Kiszka wrote: >> > >> > Perhaps qemu_eventfd() can be used in the future instead of an explicit >> > pipe. Then Linux will do eventfd while other OSes will fall back to >> > pipes. >> >> Basically simpler code, or does this also have runtime benefits? >> > > In corner cases, the completion can block on the write() with pipes, but not > eventfd. The pipe is O_NONBLOCK and the only thing the caller cares about is whether there is *some* data in the PIPE so it can happily ignore EAGAIN. So the pipe implementation never blocks on write() either. It may require multiple reads to drain the queue though whereas eventfd would only require a single read to drain the queue. Regards, Anthony Liguori >