From: Peter Zijlstra <peterz@infradead.org>
To: Zhao Forrest <forrest.zhao@gmail.com>
Cc: linux-kernel@vger.kernel.org, kvm-devel@lists.sourceforge.net
Subject: Re: Can Linux kernel handle unsynced TSC?
Date: Fri, 29 Feb 2008 15:27:21 +0100 [thread overview]
Message-ID: <1204295241.6243.108.camel@lappy> (raw)
In-Reply-To: <ac8af0be0802290620q208cf4b0sd672cf18594074eb@mail.gmail.com>
On Fri, 2008-02-29 at 22:20 +0800, Zhao Forrest wrote:
> On 2/29/08, Peter Zijlstra <peterz@infradead.org> wrote:
> >
> > On Fri, 2008-02-29 at 16:55 +0800, Zhao Forrest wrote:
> > > Sorry for reposting it.
> > >
> > > For example,
> > > 1 rdtsc() is invoked on CPU0
> > > 2 process is migrated to CPU1, and rdtsc() is invoked on CPU1
> > > 3 if TSC on CPU1 is slower than TSC on CPU0, can kernel guarantee
> > > that the second rdtsc() doesn't return a value smaller than the one
> > > returned by the first rdtsc()?
> >
> > No, rdtsc() goes directly to the hardware. You need a (preferably cheap)
> > clock abstraction layer on top if you need this.
>
> Thank you for the clarification. I think gettimeofday() is such kind
> of clock abstraction layer, am I right?
Yes, gtod is one such a layer, however it fails the 'cheap' test for
many definitions of cheap.
WARNING: multiple messages have this Message-ID (diff)
From: Peter Zijlstra <peterz@infradead.org>
To: Zhao Forrest <forrest.zhao@gmail.com>
Cc: kvm-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org
Subject: Re: Can Linux kernel handle unsynced TSC?
Date: Fri, 29 Feb 2008 15:27:21 +0100 [thread overview]
Message-ID: <1204295241.6243.108.camel@lappy> (raw)
In-Reply-To: <ac8af0be0802290620q208cf4b0sd672cf18594074eb@mail.gmail.com>
On Fri, 2008-02-29 at 22:20 +0800, Zhao Forrest wrote:
> On 2/29/08, Peter Zijlstra <peterz@infradead.org> wrote:
> >
> > On Fri, 2008-02-29 at 16:55 +0800, Zhao Forrest wrote:
> > > Sorry for reposting it.
> > >
> > > For example,
> > > 1 rdtsc() is invoked on CPU0
> > > 2 process is migrated to CPU1, and rdtsc() is invoked on CPU1
> > > 3 if TSC on CPU1 is slower than TSC on CPU0, can kernel guarantee
> > > that the second rdtsc() doesn't return a value smaller than the one
> > > returned by the first rdtsc()?
> >
> > No, rdtsc() goes directly to the hardware. You need a (preferably cheap)
> > clock abstraction layer on top if you need this.
>
> Thank you for the clarification. I think gettimeofday() is such kind
> of clock abstraction layer, am I right?
Yes, gtod is one such a layer, however it fails the 'cheap' test for
many definitions of cheap.
-------------------------------------------------------------------------
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/
next prev parent reply other threads:[~2008-02-29 14:27 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-29 8:55 Can Linux kernel handle unsynced TSC? Zhao Forrest
2008-02-29 8:55 ` Zhao Forrest
2008-02-29 10:43 ` Peter Zijlstra
2008-02-29 10:43 ` Peter Zijlstra
2008-02-29 14:20 ` Zhao Forrest
2008-02-29 14:20 ` Zhao Forrest
2008-02-29 14:27 ` Peter Zijlstra [this message]
2008-02-29 14:27 ` Peter Zijlstra
-- strict thread matches above, loose matches on Subject: below --
2008-02-29 8:43 Zhao Forrest
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=1204295241.6243.108.camel@lappy \
--to=peterz@infradead.org \
--cc=forrest.zhao@gmail.com \
--cc=kvm-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
/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.