From patchwork Thu Aug 6 16:35:49 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 30865 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by bilbo.ozlabs.org (Postfix) with ESMTPS id 2E12DB6F1E for ; Fri, 7 Aug 2009 02:36:57 +1000 (EST) Received: from localhost ([127.0.0.1]:58079 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MZ5xT-0003LW-Cv for incoming@patchwork.ozlabs.org; Thu, 06 Aug 2009 12:36:51 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MZ5wf-00039b-Np for qemu-devel@nongnu.org; Thu, 06 Aug 2009 12:36:01 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MZ5wc-00037y-2h for qemu-devel@nongnu.org; Thu, 06 Aug 2009 12:36:01 -0400 Received: from [199.232.76.173] (port=46788 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MZ5wb-00037p-Jx for qemu-devel@nongnu.org; Thu, 06 Aug 2009 12:35:57 -0400 Received: from verein.lst.de ([213.95.11.210]:50263) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA1:24) (Exim 4.60) (envelope-from ) id 1MZ5wa-0002tR-DN for qemu-devel@nongnu.org; Thu, 06 Aug 2009 12:35:57 -0400 Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id n76GZnVL026118 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Thu, 6 Aug 2009 18:35:49 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-7.2) id n76GZnuv026117; Thu, 6 Aug 2009 18:35:49 +0200 Date: Thu, 6 Aug 2009 18:35:49 +0200 From: Christoph Hellwig To: kvm@vger.kernel.org Message-ID: <20090806163549.GA25594@lst.de> Mime-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.3.28i X-Spam-Score: 0 () X-Scanned-By: MIMEDefang 2.39 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Cc: qemu-devel@nongnu.org Subject: [Qemu-devel] virtio-blk performance and MSI X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Michael suggested to me a while ago to try MSI with virtio-blk and I played with this small patch: which gave about 5% speedups on 4k sized reads and writes, see the full iozone output I attached. Now getting the information about using multiple MSI vectors from the command line to virtio-blk similar to how virtio-net does seems extremly messy right now. Waiting for Gerd's additional qdev patches to make it easier as a qdev property. File size set to 131072 KB Record Size 4 KB O_DIRECT feature enabled Command line used: iozone -s 128m -r 4k -I -f /dev/sdb Output is in Kbytes/sec Time Resolution = 0.000001 seconds. Processor cache size set to 1024 Kbytes. Processor cache line size set to 32 bytes. File stride size set to 17 * record size. random random bkwd record stride KB reclen write rewrite read reread read write read rewrite read fwrite frewrite fread freread native 131072 4 11428 11847 25110 25302 24415 10904 25051 12146 24859 978572 1224433 1974096 2086567 131072 4 11812 11784 24941 25209 24325 10776 24814 12271 24907 959819 1208770 1977191 2103138 131072 4 11834 11892 25270 25347 24427 10839 24571 12161 24558 958934 1213707 1959754 2100647 131072 4 11688 11914 25102 25100 24514 10855 24787 12237 24738 987739 1218774 1985245 2085435 131072 4 11768 11910 24986 25087 24342 10819 24687 12304 24711 974889 1221511 2027124 2102430 qemu 131072 4 8752 9137 14020 14181 13924 8491 14158 8215 13816 378448 1498838 2117166 2341281 131072 4 9113 9097 14019 14187 14024 8536 14153 8243 14132 1194485 1506540 2053520 2333202 131072 4 9082 9128 14001 14232 13971 8541 14113 8216 14103 1260659 1464543 2101490 2335442 131072 4 9103 9163 14373 14149 13983 8523 14171 8242 14026 1278104 1503047 2127449 2334738 131072 4 9084 9128 14103 14212 13980 8519 14064 8260 13810 1204696 1497434 2053129 2334362 qemu+msi 131072 4 9466 9726 15339 15225 14845 8884 15159 8631 14460 375140 1488522 2066115 2337399 131072 4 9541 9590 15025 15059 15010 8852 15007 8677 14736 1142718 1491640 2111847 2332153 131072 4 9492 9621 14831 15093 14792 8895 14849 8452 14976 1163760 1461825 2118741 2337985 131072 4 9519 9615 14954 14950 14713 8915 15229 8547 14854 1212529 1490471 2091894 2343676 131072 4 9527 9576 14872 14828 14741 8880 14891 8769 14502 1253559 1436703 2127827 2344256 Index: qemu-kvm/hw/virtio-blk.c =================================================================== --- qemu-kvm.orig/hw/virtio-blk.c +++ qemu-kvm/hw/virtio-blk.c @@ -416,6 +416,7 @@ VirtIODevice *virtio_blk_init(DeviceStat s->vdev.get_config = virtio_blk_update_config; s->vdev.get_features = virtio_blk_get_features; s->vdev.reset = virtio_blk_reset; + s->vdev.nvectors = 2; s->bs = bs; s->rq = NULL; if (strlen(ps = (char *)drive_get_serial(bs)))