kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dor Laor <dlaor@redhat.com>
To: Avi Kivity <avi@redhat.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>,
	Sheng Yang <sheng@linux.intel.com>,
	kvm@vger.kernel.org
Subject: Re: [PATCH 3/3] KVM: Reset PIT irq injection logic when the PIT IRQ is unmasked
Date: Tue, 06 Jan 2009 11:35:16 +0200	[thread overview]
Message-ID: <496325D4.2090101@redhat.com> (raw)
In-Reply-To: <49631593.6030204@redhat.com>

Avi Kivity wrote:
> 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.
>
It might get too complex. It can be done inside the vcpu_run function too:
An irq needs reinjection if the irq window was not  open  from the  
timer  tick till  the next  timer tick
minus the deschedule time. You also need to know on the right vcpu that 
the pit irq it routed to.

Since scenarios like guests masking their pit and do a lot of work are 
rare and a bad guest behaviour anyway,
I don't think we should special case them. So the pit reset hook is enough.


      reply	other threads:[~2009-01-06  9:34 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-04 16:14 [PATCH 0/3] Reset PIT reinjection logic on irq unmask Avi Kivity
2009-01-04 16:14 ` [PATCH 1/3] KVM: Add CONFIG_HAVE_KVM_IRQCHIP Avi Kivity
2009-01-04 16:14 ` [PATCH 2/3] KVM: Interrupt mask notifiers for ioapic Avi Kivity
2009-01-05  7:06   ` Sheng Yang
2009-01-05 13:24     ` Avi Kivity
2009-01-05 18:29   ` Marcelo Tosatti
2009-01-05 20:57     ` Avi Kivity
2009-01-04 16:14 ` [PATCH 3/3] KVM: Reset PIT irq injection logic when the PIT IRQ is unmasked Avi Kivity
2009-01-05 18:31   ` Marcelo Tosatti
2009-01-05 20:59     ` Avi Kivity
2009-01-05 21:58       ` Marcelo Tosatti
2009-01-06  8:25         ` Avi Kivity
2009-01-06  9:35           ` Dor Laor [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=496325D4.2090101@redhat.com \
    --to=dlaor@redhat.com \
    --cc=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=sheng@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).