From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44591) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1ZTQ-0000LX-9g for qemu-devel@nongnu.org; Mon, 30 Jun 2014 07:10:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X1ZTH-0005zF-8X for qemu-devel@nongnu.org; Mon, 30 Jun 2014 07:10:12 -0400 Received: from mail-wg0-x232.google.com ([2a00:1450:400c:c00::232]:62876) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1ZTH-0005ws-1T for qemu-devel@nongnu.org; Mon, 30 Jun 2014 07:10:03 -0400 Received: by mail-wg0-f50.google.com with SMTP id m15so7767417wgh.33 for ; Mon, 30 Jun 2014 04:10:02 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <53B14588.5040807@redhat.com> Date: Mon, 30 Jun 2014 13:10:00 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1404121756-14544-1-git-send-email-ming.lei@canonical.com> In-Reply-To: <1404121756-14544-1-git-send-email-ming.lei@canonical.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 0/3] block: introduce submit I/O at batch List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Ming Lei , Peter Maydell , qemu-devel@nongnu.org, Stefan Hajnoczi Cc: Kevin Wolf , Fam Zheng , "Michael S. Tsirkin" Il 30/06/2014 11:49, Ming Lei ha scritto: > Hi, > > The commit 580b6b2aa2(dataplane: use the QEMU block layer for I/O) > introduces ~40% throughput regression on virtio-blk dataplane, and > one of causes is that submitting I/O at batch is removed. > > This patchset trys to introduce this mechanism on block, at least, > linux-aio can benefit from that. > > With these patches, it is observed that thoughout on virtio-blk > dataplane can be improved a lot, see data in commit log of patch > 3/3. > > It should be possible to apply the batch mechanism to other devices > (such as virtio-scsi) too. The basic idea of the code is great, however I do not think it is necessary to add the logic in AioContext. You are right that io_submit supports multiple I/O, but right now we have one io_context_t per BlockDriverState so it is somewhat premature. Note that AioContext in QEMU means something else than io_context_t. I don't think it's necessary to walk backing_hd too (especially because we're close to release and this cannot be a regression---dataplane in 2.0 didn't support backing files at all!). We need to keep the patches as simple as possible. You can just add bdrv_plug/bdrv_unplug callbacks to block/linux-aio.c and, in block.c, something like BlockDriver *drv = bs->drv; if (drv && drv->bdrv_plug) { drv->bdrv_plug(bdrv); } else if (bs->file) { bdrv_plug(bs->file); } and place all the queuing logic in linux-aio.c. It should be obvious to the reviewer that the patch only affects dataplane. (Also, note that QEMU doesn't use __ as the prefix for internal function). Thanks for the patch! Paolo