From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LBCin-0000NJ-0x for qemu-devel@nongnu.org; Fri, 12 Dec 2008 13:26:41 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LBCik-0000MA-R6 for qemu-devel@nongnu.org; Fri, 12 Dec 2008 13:26:39 -0500 Received: from [199.232.76.173] (port=58405 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LBCik-0000M3-KX for qemu-devel@nongnu.org; Fri, 12 Dec 2008 13:26:38 -0500 Received: from mx2.redhat.com ([66.187.237.31]:43291) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LBCik-0002Fu-6Q for qemu-devel@nongnu.org; Fri, 12 Dec 2008 13:26:38 -0500 Date: Fri, 12 Dec 2008 19:26:34 +0100 From: Andrea Arcangeli Subject: Re: [Qemu-devel] [RFC] Replace posix-aio with custom thread pool Message-ID: <20081212182634.GQ6809@random.random> References: <49400F69.8080707@codemonkey.ws> <20081210190810.GG18814@random.random> <20081212142435.GL6809@random.random> <494276CD.6060904@codemonkey.ws> <20081212154418.GM6809@random.random> <49429629.20309@codemonkey.ws> <20081212170916.GO6809@random.random> <49429EA3.8070008@codemonkey.ws> <20081212175213.GP6809@random.random> <4942AAD6.1090408@codemonkey.ws> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4942AAD6.1090408@codemonkey.ws> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , kvm-devel On Fri, Dec 12, 2008 at 12:17:58PM -0600, Anthony Liguori wrote: > You assume that anything using bdrv_aio_readv/writev will be going through > a DMA API. This isn't a safe assumption. Well it's obviously a safe assumption right now... ;) I've an hard time seeing any 'metadata' (because _data_ will be guaranteed to always pass through the dma api if it wants to be vectored) being physically contiguous on disk but not contiguous on ram. > Furthermore, you need some way to communicate the fact that you cannot > handle iovcnt > 1 iovecs in a performant/safe way. assert(iovcnt == 1) will work fine. If somebody changes some backend like qcow2 to call bdrv_aio_readv/writev they'll get an assert and they'll ask for a compatibility layer. I don't see any urgency to add it immediately and I think assert(iovcnt==1) is more preferable until any user emerges asking for bdrv_aio_readv/writev as it'll function as a debug trap to be sure all works right.