From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 3/3] KVM: Reset PIT irq injection logic when the PIT IRQ is unmasked Date: Tue, 06 Jan 2009 10:25:55 +0200 Message-ID: <49631593.6030204@redhat.com> References: <1231085685-32201-1-git-send-email-avi@redhat.com> <1231085685-32201-4-git-send-email-avi@redhat.com> <20090105183159.GC5592@amt.cnet> <49627495.9020203@redhat.com> <20090105215850.GA22009@amt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Sheng Yang , kvm@vger.kernel.org To: Marcelo Tosatti Return-path: Received: from mx2.redhat.com ([66.187.237.31]:50783 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750944AbZAFIZk (ORCPT ); Tue, 6 Jan 2009 03:25:40 -0500 In-Reply-To: <20090105215850.GA22009@amt.cnet> Sender: kvm-owner@vger.kernel.org List-ID: Marcelo Tosatti wrote: >> >> I'm worried about: >> >> - boot guest using local apic timer >> - reset >> - boot with pit timer >> - a zillion interrupts >> >> So at the very least, we need a limiter. >> > > Or have a new notifier on kvm_pic_reset, instead of simply acking one > pending irq? That seems the appropriate place to zero the counter. > Clearing the counter on reset is good, but it doesn't solve the underlying problem, which is that there are two separate cases that appear to the host as the same thing: - guest masks irqs, does a lot of work, unmasks irqs - host deschedules guest, does a lot of work, reschedules guest Right now we assume any missed interrupts are due to host load. In the reboot case, that's clearly wrong, but that is only an example. Maybe we can use preempt notifiers to detect whether the timer tick happened while the guest was scheduled or not. -- I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain.