From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Williamson Subject: Re: The smp_affinity cannot work correctly on guest os when PCI passthrough device using msi/msi-x with KVM Date: Mon, 26 Nov 2012 12:29:46 -0700 Message-ID: <1353958186.1809.116.camel@bling.home> References: <1353943686.1809.32.camel@bling.home> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: kvm@vger.kernel.org To: yi li Return-path: Received: from mx1.redhat.com ([209.132.183.28]:9570 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755496Ab2KZT3r (ORCPT ); Mon, 26 Nov 2012 14:29:47 -0500 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On Tue, 2012-11-27 at 00:47 +0800, yi li wrote: > hi Alex, >=20 > the qemu-kvm version 1.2. And is the device making use of MSI-X or MSI interrupts. MSI-X should work on 1.2, MSI does not yet support vector updates for affinity, but patches are welcome. Thanks, Alex > 2012/11/26 Alex Williamson : > > On Fri, 2012-11-23 at 11:06 +0800, yi li wrote: > >> Hi Guys, > >> > >> there have a issue about smp_affinity cannot work correctly on gue= st > >> os when PCI passthrough device using msi/msi-x with KVM. > >> > >> My reason: > >> pcpu will occur a lot of ipi interrupt to find the vcpu to handle = the > >> irq. so the guest os will VM_EXIT frequelty. right? > >> > >> if smp_affinity can work correctly on guest os, the best way is t= hat > >> the vcpu handle the irq is cputune at the pcpu which handle the > >> kvm:pci-bus irq on the host.but unfortunly, i find that smp_affin= ity > >> can not work correctly on guest os when msi/msi-x. > >> > >> how to reproduce: > >> 1: passthrough a netcard (Brodcom BCM5716S) to the guest os > >> > >> 2: ifup the netcard, the card will use msi-x interrupt default, an= d close the > >> irqbalance service > >> > >> 3: echo 4 > cat /proc/irq/NETCARDIRQ/smp_affinity, so we assume t= he vcpu2 > >> handle the irq. > >> > >> 4: we have set and set the irq = kvm:pci-bus to > >> the pcpu1 on the host. > >> > >> we think this configure will reduce the ipi interrupt when inject = interrupt to > >> the guest os. but this irq is not only handle on vcpu2. maybe it i= s > >> not our expect=E3=80=82 > > > > What version of qemu-kvm/qemu are you using? There's been some wor= k > > recently specifically to enable this. Thanks, > > > > Alex > >