From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kdmrz-0002Fc-Nt for qemu-devel@nongnu.org; Thu, 11 Sep 2008 10:10:03 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kdmry-0002Du-OL for qemu-devel@nongnu.org; Thu, 11 Sep 2008 10:10:03 -0400 Received: from [199.232.76.173] (port=53663 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kdmry-0002Db-Kx for qemu-devel@nongnu.org; Thu, 11 Sep 2008 10:10:02 -0400 Received: from e33.co.us.ibm.com ([32.97.110.151]:40019) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Kdmry-00006m-3E for qemu-devel@nongnu.org; Thu, 11 Sep 2008 10:10:02 -0400 Received: from d03relay04.boulder.ibm.com (d03relay04.boulder.ibm.com [9.17.195.106]) by e33.co.us.ibm.com (8.13.8/8.13.8) with ESMTP id m8BE9xd4021335 for ; Thu, 11 Sep 2008 10:09:59 -0400 Received: from d03av04.boulder.ibm.com (d03av04.boulder.ibm.com [9.17.195.170]) by d03relay04.boulder.ibm.com (8.13.8/8.13.8/NCO v9.1) with ESMTP id m8BE9pqV128054 for ; Thu, 11 Sep 2008 08:09:53 -0600 Received: from d03av04.boulder.ibm.com (loopback [127.0.0.1]) by d03av04.boulder.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id m8BE9pR0003588 for ; Thu, 11 Sep 2008 08:09:51 -0600 Message-ID: <48C9267E.5050202@us.ibm.com> Date: Thu, 11 Sep 2008 09:09:02 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] Re: [PATCH][RFC] Refactor AIO to allow multiple AIO implementations References: <1221061788-26166-1-git-send-email-aliguori@us.ibm.com> <48C8CD4E.1020705@redhat.com> <48C91302.70207@us.ibm.com> <48C91A00.3060403@redhat.com> <20080911132831.GD16427@shareable.org> In-Reply-To: <20080911132831.GD16427@shareable.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jamie Lokier Cc: Ryan Harper , qemu-devel@nongnu.org, kvm@vger.kernel.org Jamie Lokier wrote: > I'm under the impression that linux-aio is better in every way, as > I think Anthony Liguori posted a while back: > > >>>> Threads are a poor substitute for a proper AIO interface. >>>> linux-aio gives you everything you could possibly want in an >>>> interface since it allows you to submit multiple vectored operations >>>> in a single syscall, use an fd to signal request completion, >>>> complete multiple requests in a single syscall, and inject barriers >>>> via fdsync. >>>> Well that Anthony Liguori guy is obviously smoking crack. The problem with linux-aio is that it doesn't work unless you open a file with O_DIRECT. There is no simple way to make it work with buffered files either because of the silliness of the vfs interface. I know buffered vs. unbuffered IO is a source of contention for some but if you're doing largely homogeneous virtualization, and you happen to have common storage (either via a common backing file or something more sophisticated), buffered IO is going to make a big difference. There are at least three thread pool implementations in the kernel to allow asynchronous IO to buffered files. If the kernel is doing this internally, userspace has no hope of being able to do it differently. BTW, my current thinking for a thread pool implementation would actually use linux-aio in each thread, but using it to emulate preadv/pwritev. Regards, Anthony Liguori > But knowing about request in flight, I/O ordering etc. seem equally > available via posix-aio on a distro where that calls linux-aio > (i.e. not the Glibc implementation). > > -- Jamie >