From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: Re: [PATCH][RFC] Refactor AIO to allow multiple AIO implementations Date: Thu, 11 Sep 2008 07:45:54 -0500 Message-ID: <48C91302.70207@us.ibm.com> References: <1221061788-26166-1-git-send-email-aliguori@us.ibm.com> <48C8CD4E.1020705@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: qemu-devel@nongnu.org, Ryan Harper , kvm@vger.kernel.org To: Gerd Hoffmann Return-path: Received: from e35.co.us.ibm.com ([32.97.110.153]:48299 "EHLO e35.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752389AbYIKMrA (ORCPT ); Thu, 11 Sep 2008 08:47:00 -0400 Received: from d03relay04.boulder.ibm.com (d03relay04.boulder.ibm.com [9.17.195.106]) by e35.co.us.ibm.com (8.13.8/8.13.8) with ESMTP id m8BCkxqG020137 for ; Thu, 11 Sep 2008 08:46:59 -0400 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d03relay04.boulder.ibm.com (8.13.8/8.13.8/NCO v9.1) with ESMTP id m8BCkxL4137434 for ; Thu, 11 Sep 2008 06:46:59 -0600 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id m8BIkwQ2019354 for ; Thu, 11 Sep 2008 12:46:59 -0600 In-Reply-To: <48C8CD4E.1020705@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Gerd Hoffmann wrote: > Anthony Liguori wrote: > >> This patch refactors the AIO layer to allow multiple AIO implementations. It's >> only possible because of the recent signalfd() patch. >> >> Right now, the AIO infrastructure is pretty specific to the block raw backend. >> For other block devices to implement AIO, the qemu_aio_wait function must support >> registration. This patch introduces a new function, qmeu_aio_set_fd_handler, which >> can be used to register a file descriptor to be called back. qemu_aio_wait() now >> polls a set of file descriptors registered with this function until one becomes >> readable or writable. >> > > Hmm, what is the long-term plan for this? Step one is to move the generic aio bits out of block-raw-posix (which this patch does). Step two is to move the posix-aio routines out of block-raw-posix. Step three would be to add a generic interface to allow block-raw-posix to use multiple aio implementations Step four would be to add a new aio implementation (I think the best route is a thread-pool based implementation). Regards, Anthony Liguori > Separating out the completion > notification is a nice first step. Most of the aio infrastructure is > still in the block raw backend though. IMHO it doesn't belong there. > > The aio implementation(s) should be a separate entity usable by all > block backends to invoke aio requests, without having to care about how > this is actually implemented (threads, linux aio, posix aio, whatever). > > cheers, > Gerd > >