public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Marcelo Tosatti <mtosatti@redhat.com>
To: Zachary Amsden <zamsden@redhat.com>
Cc: Chris Lalancette <clalance@redhat.com>,
	kvm@vger.kernel.org, avi@redhat.com
Subject: Re: [RFC][PATCH 1/3] Introduce a workqueue to deliver PIT timer interrupts.
Date: Thu, 10 Jun 2010 13:18:11 -0300	[thread overview]
Message-ID: <20100610161811.GA5191@amt.cnet> (raw)
In-Reply-To: <4C1004F5.3020703@redhat.com>

On Wed, Jun 09, 2010 at 11:17:41AM -1000, Zachary Amsden wrote:
> On 06/09/2010 03:23 AM, Marcelo Tosatti wrote:
> >On Tue, Jun 08, 2010 at 04:36:16PM -1000, Zachary Amsden wrote:
> >>>+	pt->timer.function = pit_timer_fn;
> >>>
> >>I am happy to see this.  I thought kvm_timer_fn was a step
> >>backwards; it was too general of a function to justify the savings
> >>of 20 some odd lines of code.
> >This was not done to save 20 lines of code:
> >
> >http://www.mail-archive.com/kvm@vger.kernel.org/msg18640.html
> >
> >>Is there any chance that using a workqueue might help the problem of
> >>hrtimers firing too quickly?  I wanted to return HR_NORESTART from
> >>pit_timer_fn always, then restart the hrtimer on delivery, but
> >>because of unreliable delivery, it wasn't clear how to do that.
> >>
> >>Perhaps the workqueue can be used to restart the timer instead,
> >>avoiding problems of impossibly small timeouts causing hrtimers to
> >>run amok.
> >It should be rearmed on ACK ideally. How come delivery is unreliable?
> 
> Due to the various ways IRQ can be latched or not with different
> routing.  If you program a very short timeout, it should fire even
> if the guest is slow to respond:
> 
> i..i..i..i..i..i..i
> ..a...a...a...a
> 
> if you don't restart right away, only on ack, you can risk the
> refire of the interrupt getting lost, especially if the guest
> happens to reprogram the PIT while this is happening...
> 
> Of course, it can be tracked properly, but it requires quite a few
> more state variables and some careful reasoning to make sure it
> doesn't drop irqs.
> 
> This patch series looks as if it will make that sort of reasoning
> easier to do :)
> 
> >BTW, a massive amount of hrtimers (_single_ non-tickless 32-vcpu guest
> >with LAPIC) results in:
> >
> >hrtimer: interrupt took 122448 ns
> >
> >in the host. So don't even need impossibly small timeouts :(
> 32-vcpu on how many pcpu?

8


  parent reply	other threads:[~2010-06-10 16:18 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-08 17:55 [RFC][PATCH 0/3]: Fixes to IRQ routing Chris Lalancette
2010-06-08 17:55 ` [RFC][PATCH 1/3] Introduce a workqueue to deliver PIT timer interrupts Chris Lalancette
2010-06-09  2:36   ` Zachary Amsden
2010-06-09 13:23     ` Marcelo Tosatti
2010-06-09 14:16       ` Avi Kivity
2010-06-09 14:40         ` Marcelo Tosatti
2010-06-09 21:17       ` Zachary Amsden
2010-06-10  9:24         ` Avi Kivity
2010-06-10 19:17           ` Zachary Amsden
2010-06-10 16:18         ` Marcelo Tosatti [this message]
2010-06-09 10:55   ` Avi Kivity
2010-06-09 13:49   ` Marcelo Tosatti
2010-06-09 14:20     ` Avi Kivity
2010-06-08 17:55 ` [RFC][PATCH 2/3] Allow any LAPIC to accept PIC interrupts Chris Lalancette
2010-06-08 17:55 ` [RFC][PATCH 3/3] In DM_LOWEST, only deliver interrupts to vcpus with enabled LAPIC's Chris Lalancette
2010-06-09 11:01   ` Gleb Natapov
2010-06-09 11:08     ` Avi Kivity
2010-06-09 11:20       ` Gleb Natapov
2010-06-09 11:22         ` Avi Kivity
2010-06-09 11:02 ` [RFC][PATCH 0/3]: Fixes to IRQ routing Avi Kivity

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=20100610161811.GA5191@amt.cnet \
    --to=mtosatti@redhat.com \
    --cc=avi@redhat.com \
    --cc=clalance@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=zamsden@redhat.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