Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MmAzN-0001Dh-Ct for qemu-devel@nongnu.org; Fri, 11 Sep 2009 14:36:53 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MmAzI-00018S-HV for qemu-devel@nongnu.org; Fri, 11 Sep 2009 14:36:52 -0400 Received: from [199.232.76.173] (port=42556 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MmAzI-00018H-AK for qemu-devel@nongnu.org; Fri, 11 Sep 2009 14:36:48 -0400 Received: from verein.lst.de ([213.95.11.210]:37346) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA1:24) (Exim 4.60) (envelope-from ) id 1MmAzH-0008AO-Pz for qemu-devel@nongnu.org; Fri, 11 Sep 2009 14:36:48 -0400 Date: Fri, 11 Sep 2009 20:36:45 +0200 From: Christoph Hellwig Subject: Re: [Qemu-devel] [PATCH v3 1/2] Add bdrv_aio_multiwrite Message-ID: <20090911183645.GB13621@lst.de> References: <1252511618-19497-1-git-send-email-kwolf@redhat.com> <1252511618-19497-2-git-send-email-kwolf@redhat.com> <20090910224401.GB25700@lst.de> <4AA9EE35.9020900@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4AA9EE35.9020900@redhat.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: Christoph Hellwig , qemu-devel@nongnu.org On Fri, Sep 11, 2009 at 08:29:09AM +0200, Kevin Wolf wrote: > Am 11.09.2009 00:44, schrieb Christoph Hellwig: > > One thing that concerns me here is that we keep adding more memory > > allocations to the I/O path. At least on fast SSDs even kernel memory > > allocations are a performance problem and they're much faster than > > userspace ones. > > In the non-merging case we have one additional allocation, the one for > mcb. Maybe we could do something like the AIOPool here to avoid some > mallocs. > > In the merging case we need to allocate new IO vectors. I don't see a > way around this, though, and I hope that the benefit of a saved write > request outweighs the malloc costs. If not, it probably was a bad idea > to accept your suggestion to make it generic code instead of just > merging requests for qcow2. Right now I'm just thinking about the potential issues. The problem is that the trade offs maybe be very different for different scenarios. For a normal disk which is by far the most common option (and will be for a long time) the merging is a clear benefit. For SSDs we might have to do different optimizations. If it's not a big issue avoiding too many memory allocations and rather doing fewer larger ones is in general a good thing, though.