From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56923) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c788r-0003Ur-JK for qemu-devel@nongnu.org; Wed, 16 Nov 2016 16:53:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c788m-0006Pn-N7 for qemu-devel@nongnu.org; Wed, 16 Nov 2016 16:53:17 -0500 Received: from mx1.redhat.com ([209.132.183.28]:39540) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c788m-0006PR-HY for qemu-devel@nongnu.org; Wed, 16 Nov 2016 16:53:12 -0500 From: Stefan Hajnoczi Date: Wed, 16 Nov 2016 21:53:06 +0000 Message-Id: <1479333189-20082-1-git-send-email-stefanha@redhat.com> Subject: [Qemu-devel] [PATCH 0/3] virtio: disable notifications in blk and scsi List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: zhunxun@gmail.com, Fam Zheng , Christian Borntraeger , Paolo Bonzini , "Michael S. Tsirkin" , Kevin Wolf , Stefan Hajnoczi Disabling notifications during virtqueue processing reduces the number of exits. The virtio-net device already uses virtio_queue_set_notifications() but virtio-blk and virtio-scsi do not. The following benchmark shows a 15% reduction in virtio-blk-pci MMIO exits: (host)$ qemu-system-x86_64 \ -enable-kvm -m 1024 -cpu host \ -drive if=virtio,id=drive0,file=f24.img,format=raw,\ cache=none,aio=native (guest)$ fio # jobs=4, iodepth=8, direct=1, randread (host)$ sudo perf record -a -e kvm:kvm_fast_mmio Number of kvm_fast_mmio events: Unpatched: 685k Patched: 592k (-15%, lower is better) Note that a workload with iodepth=1 and a single thread will not benefit - this is a batching optimization. The effect should be strongest with large iodepth and multiple threads submitting I/O. The guest I/O scheduler also affects the optimization. Stefan Hajnoczi (3): virtio: add missing vdev->broken check virtio-blk: suppress virtqueue kick during processing virtio-scsi: suppress virtqueue kick during processing hw/block/virtio-blk.c | 18 ++++++++++++------ hw/scsi/virtio-scsi.c | 36 +++++++++++++++++++++--------------- hw/virtio/virtio.c | 4 ++++ 3 files changed, 37 insertions(+), 21 deletions(-) -- 2.7.4