All of lore.kernel.org
 help / color / mirror / Atom feed
From: Keir Fraser <keir.fraser@eu.citrix.com>
To: Roger Cruz <rcruz@marathontechnologies.com>, dan.magenheimer@oracle.com
Cc: xen-devel <xen-devel@lists.xensource.com>
Subject: Re: Kernel printk timestamps and walltime drift
Date: Fri, 13 Jun 2008 23:09:25 +0100	[thread overview]
Message-ID: <C478AEA5.19DF4%keir.fraser@eu.citrix.com> (raw)
In-Reply-To: <40B551BEDC7945419A5897958AB3947CB3550C@mtexch.marathontechnologies.com>

On 13/6/08 23:02, "Roger Cruz" <rcruz@marathontechnologies.com> wrote:

> Was I correct in my understanding on how the timestamp is being obtained
> via this call sequence?
> 
> -> vprintk -> printk_clock  -> sched_clock -> rdtscll
> 
> In other words, does your patchset use the rdtscll instruction on an
> i386, pv, 32-bit linux to compute determine that time?  If not, how is
> it derived (what file/function should I look at for sched_clock?).

The guest calculates current Xen system time based on extrapolating from a
Xen-supplied timestamp using current TSC:
 sys_time = sys_timestamp + (RDTSC - tsc_timestamp) * scale_factor

Where three terms on the RHS of the formula are supplied by Xen in the
shared_info page, and the fourth is returned by the RDTSC CPU instruction.

> While you are right that the only artifact that we have observed is the
> drifting timestamps, a future product of ours may need to have an
> accurate TSC presentation to the VM and if the time is being derived
> from the TSC as I'm conjecturing, then this drift is something we're
> going to have to worry about then.

Depends what you mean by accurate. PV guests see the underlying host TSC
directly. In that sense what they see is 100% accurate!

 -- Keir

> Thank you Keir and Dan 

  reply	other threads:[~2008-06-13 22:09 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <B99564216C25704085A82B41C46DD3427B060A@exchange.katana.local>
2008-06-13 17:53 ` Isolation and time Dan Magenheimer
2008-06-13 18:49   ` Kernel printk timestamps and walltime drift Roger Cruz
2008-06-13 19:47     ` Keir Fraser
2008-06-13 20:10       ` Roger Cruz
2008-06-13 20:31         ` Keir Fraser
2008-06-13 20:06     ` Dan Magenheimer
2008-06-13 21:05       ` Roger Cruz
2008-06-13 21:21         ` Dan Magenheimer
2008-06-13 21:36           ` Keir Fraser
2008-06-13 22:02             ` Roger Cruz
2008-06-13 22:09               ` Keir Fraser [this message]
2008-06-13 19:38   ` Isolation and time Keir Fraser
2008-06-14  2:20     ` Dan Magenheimer
2008-06-14  8:59       ` Keir Fraser
2008-06-14 15:16         ` Dan Magenheimer
2008-06-14 15:25           ` Keir Fraser
2008-07-01  0:22             ` Dan Magenheimer

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=C478AEA5.19DF4%keir.fraser@eu.citrix.com \
    --to=keir.fraser@eu.citrix.com \
    --cc=dan.magenheimer@oracle.com \
    --cc=rcruz@marathontechnologies.com \
    --cc=xen-devel@lists.xensource.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.