On Thu, Mar 05, 2009 at 07:34:36PM -0300, Marcelo Tosatti wrote: > 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. > I took this in account. The priority counter is signed, so if say vcpu1 counter is overflows to 0x7fffffff + 1 and the vcpu2 counter is still 0x7fffffff then vcpu1 - vcpu2 = 1 and vcpu2 will be chosen to deliver interrupts. > Same happens with cpu hotplug. > For got about hotplug :( > Not sure that the best way is to fix that. Perhaps reset all online > vcpus to 0 on overflow/cpu-hotplug ? > Yes, rest counters on hotplug should work and is rare event. > Or max the counter to a smaller value like 64 or something. I'll try this and see how well interrupts will be spread between CPUs. -- Gleb. -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html