From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: Re: [PATCH v2 0/5] ioapic/lapic/msi cleanup Date: Thu, 5 Mar 2009 19:34:36 -0300 Message-ID: <20090305223436.GA7818@amt.cnet> References: <20090305143438.31443.51019.stgit@dhcp-1-237.tlv.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: avi@redhat.com, kvm@vger.kernel.org To: Gleb Natapov Return-path: Received: from mx2.redhat.com ([66.187.237.31]:44325 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753421AbZCEWfb (ORCPT ); Thu, 5 Mar 2009 17:35:31 -0500 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n25MZS48012397 for ; Thu, 5 Mar 2009 17:35:28 -0500 Content-Disposition: inline In-Reply-To: <20090305143438.31443.51019.stgit@dhcp-1-237.tlv.redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Thu, Mar 05, 2009 at 04:34:38PM +0200, Gleb Natapov wrote: > There are many code/logic duplications throughout ioapic/lapic/msi device > emulation. Try to consolidate as much code as possible. > > --- > > Gleb Natapov (5): > Get rid of deliver_bitmask. > Change the way how lowest priority vcpu is calculated. > Consolidate ioapic/ipi interrupt delivery logic. > ioapic/msi interrupt delivery consolidation. > Make kvm_apic_set_irq() deliver all kinds of interrupts. Applied and pushed, thanks. There is one issue with the new low prio selection though. Say you have an interrupt whose load is shared between all vcpus in the guest. The first vcpu which has its counter overflowed will then handle the int load by itself until it approximates to the counter of the other vcpus. Same happens with cpu hotplug. Not sure that the best way is to fix that. Perhaps reset all online vcpus to 0 on overflow/cpu-hotplug ? Or max the counter to a smaller value like 64 or something.