From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43828) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c7KRv-00089m-7V for qemu-devel@nongnu.org; Thu, 17 Nov 2016 06:01:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c7KRo-0007N3-W3 for qemu-devel@nongnu.org; Thu, 17 Nov 2016 06:01:47 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:37136 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c7KRo-0007Mj-QK for qemu-devel@nongnu.org; Thu, 17 Nov 2016 06:01:40 -0500 Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id uAHAwmGN043989 for ; Thu, 17 Nov 2016 06:01:40 -0500 Received: from e06smtp06.uk.ibm.com (e06smtp06.uk.ibm.com [195.75.94.102]) by mx0b-001b2d01.pphosted.com with ESMTP id 26s789kg90-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 17 Nov 2016 06:01:39 -0500 Received: from localhost by e06smtp06.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 17 Nov 2016 11:01:38 -0000 Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id 751AD219005E for ; Thu, 17 Nov 2016 11:00:44 +0000 (GMT) Received: from d06av09.portsmouth.uk.ibm.com (d06av09.portsmouth.uk.ibm.com [9.149.37.250]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id uAHB1Vlw51839026 for ; Thu, 17 Nov 2016 11:01:31 GMT Received: from d06av09.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av09.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id uAHB1V85015350 for ; Thu, 17 Nov 2016 04:01:31 -0700 References: <1479333189-20082-1-git-send-email-stefanha@redhat.com> From: Christian Borntraeger Date: Thu, 17 Nov 2016 12:01:30 +0100 MIME-Version: 1.0 In-Reply-To: <1479333189-20082-1-git-send-email-stefanha@redhat.com> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 8bit Message-Id: Subject: Re: [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: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: zhunxun@gmail.com, Fam Zheng , Paolo Bonzini , "Michael S. Tsirkin" , Kevin Wolf On 11/16/2016 10:53 PM, Stefan Hajnoczi wrote: > 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. I have trouble seeing any difference in terms of performances or CPU load (other than a reduced number of kicks). I was expecting some benefit by reducing the spinlock hold times in virtio-blk, but this needs some more setups to actually find the sweet spot. Maybe it will show its benefit with the polling thing? > > 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(-) >