Received: from eggs.gnu.org ([2001:4830:134:3::10]:37926) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XnN9e-0000mO-Vz for qemu-devel@nongnu.org; Sun, 09 Nov 2014 02:43:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XnN9Z-00011D-HO for qemu-devel@nongnu.org; Sun, 09 Nov 2014 02:43:22 -0500 Received: from mail-pd0-f175.google.com ([209.85.192.175]:58192) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XnN9Z-00010Z-CJ for qemu-devel@nongnu.org; Sun, 09 Nov 2014 02:43:17 -0500 Received: by mail-pd0-f175.google.com with SMTP id y13so5899543pdi.20 for ; Sat, 08 Nov 2014 23:43:14 -0800 (PST) From: Ming Lei Date: Sun, 9 Nov 2014 15:42:45 +0800 Message-Id: <1415518978-2837-1-git-send-email-ming.lei@canonical.com> Subject: [Qemu-devel] [PATCH 00/13] linux-aio/virtio-scsi: support AioContext wide IO submission as batch List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, Peter Maydell , Paolo Bonzini , Stefan Hajnoczi , Kevin Wolf Cc: Fam Zheng This patch implements AioContext wide IO submission as batch, and the idea behind is very simple: - linux native aio(io_submit) supports to enqueue read/write requests to different files - in one AioContext, I/O requests from VM can be submitted to different backend in host, one typical example is multi-lun scsi This patch changes 'struct qemu_laio_state' as per AioContext, and multiple 'bs' can be associted with one single instance of 'struct qemu_laio_state', then AioContext wide IO submission as batch becomes easy to implement. One simple test in my laptop shows ~20% throughput improvement on randread from VM(using AioContext wide IO batch vs. not using io batch) with below config: -drive id=drive_scsi1-0-0-0,if=none,format=raw,cache=none,aio=native,file=/dev/nullb2 \ -drive id=drive_scsi1-0-0-1,if=none,format=raw,cache=none,aio=native,file=/dev/nullb3 \ -device virtio-scsi-pci,num_queues=4,id=scsi1,addr=07,iothread=iothread0 \ -device scsi-disk,bus=scsi1.0,channel=0,scsi-id=1,lun=0,drive=drive_scsi1-0-0-0,id=scsi1-0-0-0 \ -device scsi-disk,bus=scsi1.0,channel=0,scsi-id=1,lun=1,drive=drive_scsi1-0-0-1,id=scsi1-0-0-1 \ BTW, maybe more boost can be obtained since ~33K/sec write() system call can be observed when this test case is running, and it might be a recent regression(BH?). This patchset can be found on below tree too: git://kernel.ubuntu.com/ming/qemu.git aio-io-batch.2 and these patches depend on "linux-aio: fix batch submission" patches in below link: http://marc.info/?l=qemu-devel&m=141528663106557&w=2 Any comments and suggestions are welcome. async.c | 1 + block.c | 16 +++ block/linux-aio.c | 251 ++++++++++++++++++++++++++++++--------- block/raw-aio.h | 6 +- block/raw-posix.c | 4 +- hw/scsi/virtio-scsi-dataplane.c | 8 ++ hw/scsi/virtio-scsi.c | 2 - include/block/aio.h | 27 +++++ include/block/block.h | 3 + 9 files changed, 259 insertions(+), 59 deletions(-) Thanks, Ming Lei