public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Dor Laor <dor.laor@gmail.com>
To: Avi Kivity <avi@qumranet.com>
Cc: kvm-devel@lists.sourceforge.net, Ryota OZAKI <ozaki.ryota@gmail.com>
Subject: Re: question: HPET for multiple VMs
Date: Sun, 23 Mar 2008 11:03:14 +0200	[thread overview]
Message-ID: <1206262994.18800.8.camel@localhost.localdomain> (raw)
In-Reply-To: <47E61524.9050202@qumranet.com>


On Sun, 2008-03-23 at 10:30 +0200, Avi Kivity wrote:
> Anthony Liguori wrote:
> > Avi Kivity wrote:
> >>> And I would like to ask right and wrong to
> >>> implement the functionality in terms of need
> >>> and efficiency (scalability and time accuracy).
> >>>     
> >>
> >> I think that for newer kernels we already have the desired accuracy.  
> >> We're not always good at exploiting that accuracy; hence the recent 
> >> movement of the PIT implementation from userspace to the kernel.  But 
> >> recent discussion leads me to believe it could have been implemented 
> >> with the userspace PIT as well.
> >>   
> >
> > What do you think is needed to get the same accuracy in userspace as 
> > in kernelspace?  
> 
> Some mechanism that allows us to implement kvm_inject_pit_timer_irqs() 
> and kvm_pit_timer_intr_post().  Specifically, information about whether 
> an interrupt was actually processed, and a window for injecting missed 
> ticks.
> 
> > Better yet, do you think there is a reasonable kvmctl harness we could 
> > write to quantify the PIT accuracy?
> 
> kvmctl doesn't implement a pit, so no.  Of course we can test any 
> infrastructure for counting missed interrupts.
> 
> >
> > It's easy enough to count timer interrupts and use compare that to an 
> > external time source to get some notion of accuracy (on varying 
> > frequencies of course).  I know you mentioned before that guest CPU 
> > consumption also comes into play... I'm not quite sure why though so 
> > I'm not sure how to simulate that.
> 
> It's not so easy, the code is quite tricky since the cpu processes 
> vectors, not interrupt lines.  It's also heuristic; if the guest 
> programs some random device to share interrupts with the pit, the 
> heursitic breaks down.  This never happens in practice, though.
> 
> Problems show up when both the guest and host are loaded, as then the 
> cpu is timesliced instead of being available on demand.
> 

I have patches that works for the rtc case with acpi windows, just
cleaning and sending for a review.
The same method should work for the pit as well.

> >
> > The nice thing about the CAP infrastructure is we can always move the 
> > PIT back to userspace.  I'll happily invest some cycles here as I'm a 
> > big fan of getting rid of unneeded kernel code :-)
> 
> Yes.
> 


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

  reply	other threads:[~2008-03-23  9:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-22 16:16 question: HPET for multiple VMs Ryota OZAKI
2008-03-22 21:56 ` Avi Kivity
2008-03-23  1:08   ` Anthony Liguori
2008-03-23  8:30     ` Avi Kivity
2008-03-23  9:03       ` Dor Laor [this message]
2008-03-23 15:32   ` Ryota OZAKI
2008-03-23 22:33     ` Dor Laor
2008-03-24  6:31       ` Ryota OZAKI

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=1206262994.18800.8.camel@localhost.localdomain \
    --to=dor.laor@gmail.com \
    --cc=avi@qumranet.com \
    --cc=dor.laor@qumranet.com \
    --cc=kvm-devel@lists.sourceforge.net \
    --cc=ozaki.ryota@gmail.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