1. 18 7月, 2007 2 次提交
    • J
      xen: Account for stolen time · f91a8b44
      Jeremy Fitzhardinge 提交于
      This patch accounts for the time stolen from our VCPUs.  Stolen time is
      time where a vcpu is runnable and could be running, but all available
      physical CPUs are being used for something else.
      
      This accounting gets run on each timer interrupt, just as a way to get
      it run relatively often, and when interesting things are going on.
      Stolen time is not really used by much in the kernel; it is reported
      in /proc/stats, and that's about it.
      Signed-off-by: NJeremy Fitzhardinge <jeremy@xensource.com>
      Acked-by: NChris Wright <chrisw@sous-sol.org>
      Cc: john stultz <johnstul@us.ibm.com>
      Cc: Rik van Riel <riel@redhat.com>
      f91a8b44
    • J
      xen: time implementation · 15c84731
      Jeremy Fitzhardinge 提交于
      Xen maintains a base clock which measures nanoseconds since system
      boot.  This is provided to guests via a shared page which contains a
      base time in ns, a tsc timestamp at that point and tsc frequency
      parameters.  Guests can compute the current time by reading the tsc
      and using it to extrapolate the current time from the basetime.  The
      hypervisor makes sure that the frequency parameters are updated
      regularly, paricularly if the tsc changes rate or stops.
      
      This is implemented as a clocksource, so the interface to the rest of
      the kernel is a simple clocksource which simply returns the current
      time directly in nanoseconds.
      
      Xen also provides a simple timer mechanism, which allows a timeout to
      be set in the future.  When that time arrives, a timer event is sent
      to the guest.  There are two timer interfaces:
       - An old one which also delivers a stream of (unused) ticks at 100Hz,
         and on the same event, the actual timer events.  The 100Hz ticks
         cause a lot of spurious wakeups, but are basically harmless.
       - The new timer interface doesn't have the 100Hz ticks, and can also
         fail if the specified time is in the past.
      
      This code presents the Xen timer as a clockevent driver, and uses the
      new interface by preference.
      Signed-off-by: NJeremy Fitzhardinge <jeremy@xensource.com>
      Signed-off-by: NChris Wright <chrisw@sous-sol.org>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      15c84731