From: Ben-Ami Yassour Subject: Re: PCI passthrough with VT-d - native performance Date: Wed, 16 Jul 2008 18:18:50 +0300 Message-ID: <1216221530.31546.274.camel@cluwyn.haifa.ibm.com> References: <1216214225-18030-1-git-send-email-benami@il.ibm.com> <487E076D.4050306@qumranet.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: amit.shah@qumranet.com, kvm@vger.kernel.org, Muli Ben-Yehuda , weidong.han@intel.com, anthony@codemonkey.ws To: Avi Kivity Return-path: Received: from mtagate8.uk.ibm.com ([195.212.29.141]:37296 "EHLO mtagate8.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760120AbYGPPT1 (ORCPT ); Wed, 16 Jul 2008 11:19:27 -0400 Received: from d06nrmr1407.portsmouth.uk.ibm.com (d06nrmr1407.portsmouth.uk.ibm.com [9.149.38.185]) by mtagate8.uk.ibm.com (8.13.8/8.13.8) with ESMTP id m6GFIsYc516112 for ; Wed, 16 Jul 2008 15:18:54 GMT Received: from d06av04.portsmouth.uk.ibm.com (d06av04.portsmouth.uk.ibm.com [9.149.37.216]) by d06nrmr1407.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v9.0) with ESMTP id m6GFIrUH2769028 for ; Wed, 16 Jul 2008 16:18:53 +0100 Received: from d06av04.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av04.portsmouth.uk.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id m6GFIqo9021503 for ; Wed, 16 Jul 2008 16:18:53 +0100 In-Reply-To: <487E076D.4050306@qumranet.com> Sender: kvm-owner@vger.kernel.org List-ID: On Wed, 2008-07-16 at 17:36 +0300, Avi Kivity wrote: > Ben-Ami Yassour wrote: > > In last few tests that we made with PCI-passthrough and VT-d using > > iperf, we were able to get the same throughput as on native OS with= a 1G > > NIC >=20 > Excellent! >=20 > > (with higher CPU utilization). > > =20 >=20 > How much higher? Here are some numbers for running iperf -l 1M: e1000 NIC (behind a PCI bridge) Bandwidth (Mbit/sec) CPU utilization Native OS 771 18% Native OS with VT-d 760 18%=20 KVM VT-d 390 95%=20 =EF=BB=BFKVM VT-d with direct mmio 770 84% KVM emulated 57 100% =20 Comment: its not clear to me why the native linux can not get closer to= 1G for this NIC, (I verified that its not external network issues). But clearly we shoul= dn't hope to=20 get more then the host does with a KVM guest (especially if the guest a= nd host are the=20 same OS as in this case...). e1000e NIC (onboard) Bandwidth (Mbit/sec) CPU utilization Native OS 915 18% Native OS with VT-d 915 18% =EF=BB=BFKVM VT-d with direct mmio 914 98% Clearly we need to try and improve the CPU utilization, but I think tha= t this is good enough=20 for the first phase. >=20 > > The following patches are the PCI-passthrough patches that Amit sen= t > > (re-based on the last kvm tree), followed by a few improvements and= the > > VT-d extension. > > I am also sending the userspace patches: the patch that Amit sent f= or > > PCI passthrough and the direct-mmio extension for userspace (note t= hat > > without the direct mmio extension we get less then half the through= put). > > =20 >=20 > Is mmio passthrough the reason for the performance improvement? If n= ot,=20 > what was the problem? >=20 Direct mmio was definitely a major improvement, without it we got half = the throughput, as you can see above. In addition patch 4/8 improves the interrupt handling and removes unnec= essary locks, and I assume that it also fixed performance issues (I did not investiga= te exactly in what way). Regards, Ben