public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jamie Lokier <lk@tantalophile.demon.co.uk>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: Padraig Brady <padraig@antefacto.com>, linux-kernel@vger.kernel.org
Subject: Re: CPU frequency shifting "problems"
Date: Fri, 28 Sep 2001 09:55:09 +0100	[thread overview]
Message-ID: <20010928095509.A11996@kushida.degree2.com> (raw)
In-Reply-To: <3BB319ED.5020406@antefacto.com> <Pine.LNX.4.33.0109271619250.25667-100000@penguin.transmeta.com>
In-Reply-To: <Pine.LNX.4.33.0109271619250.25667-100000@penguin.transmeta.com>; from torvalds@transmeta.com on Thu, Sep 27, 2001 at 04:23:38PM -0700

Linus Torvalds wrote:
> With a CPU that does makes TSC appear constant-frequency, the fact that
> the CPU itself can go faster/slower doesn't matter - from a kernel
> perspective that's pretty much equivalent to the different speeds you get
> from cache miss behaviour etc.

On a Transmeta chip, does the TSC clock advance _exactly_ uniformly, or
is there a cumulative error due to speed changes?

I'll clarify.  I imagine that the internal clocks are driven by PLLs,
DLLs or something similar.  Unless multiple oscillators are used, this
means that speed switching is gradual, over several hundred or many more
clock cycles.

You said that Crusoe does a floating point op to scale the TSC value.
Now suppose I have a 600MHz Crusoe.  I calibrate the clock and it comes
out as 600.01MHz.

I can now use `rdtsc' to measure time in userspace, rather more
accurately than gettimeofday().  (In fact I have worked with programs
that do this, for network traffic injection.).  I can do this over a
period of minutes, expecting the clock to match "wall clock" time
reasonably accurately.

Suppose the CPU clock speed changes.  Can I be confident that
600.01*10^6 (+/- small tolerance) cycles will still be counted per
second, or is there a cumulative error due to the gradual clock speed
change and the floating-point scale factor not integrating the gradual
change precisely?

(One hardware implementation that doesn't have this problem is to run a
small counter, say 3 or 4 bits, at the nominal clock speed all the time,
and have the slower core sample that.  But it may use a little more
power, and your note about FP scaling tells me you don't do that).

thanks,
-- Jamie

  parent reply	other threads:[~2001-09-28  8:56 UTC|newest]

Thread overview: 69+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-09-25 17:49 Locking comment on shrink_caches() Marcelo Tosatti
2001-09-25 19:57 ` David S. Miller
2001-09-25 18:40   ` Marcelo Tosatti
2001-09-25 20:15     ` David S. Miller
2001-09-25 19:02       ` Marcelo Tosatti
2001-09-25 20:29         ` David S. Miller
2001-09-25 21:00           ` Benjamin LaHaise
2001-09-25 21:55             ` David S. Miller
2001-09-25 22:16               ` Benjamin LaHaise
2001-09-25 22:28                 ` David S. Miller
2001-09-26 16:40                   ` Alan Cox
2001-09-26 17:25                     ` Linus Torvalds
2001-09-26 17:40                       ` Alan Cox
2001-09-26 17:44                         ` Linus Torvalds
2001-09-26 18:01                           ` Benjamin LaHaise
2001-09-26 18:01                         ` Dave Jones
2001-09-26 20:20                         ` Vojtech Pavlik
2001-09-26 20:24                           ` Vojtech Pavlik
2001-09-26 17:43                       ` Richard Gooch
2001-09-26 18:24                         ` Benjamin LaHaise
2001-09-26 18:48                           ` Richard Gooch
2001-09-26 18:58                             ` Davide Libenzi
2001-09-26 17:45                       ` Dave Jones
2001-09-26 17:50                       ` Alan Cox
2001-09-26 17:59                         ` Dave Jones
2001-09-26 18:07                           ` Alan Cox
2001-09-26 18:09                           ` Padraig Brady
2001-09-26 18:22                             ` Dave Jones
2001-09-26 18:24                           ` Linus Torvalds
2001-09-26 18:40                             ` Dave Jones
2001-09-26 19:12                               ` Linus Torvalds
2001-09-27 12:22                                 ` CPU frequency shifting "problems" Padraig Brady
2001-09-27 12:44                                   ` Dave Jones
2001-09-27 23:23                                   ` Linus Torvalds
2001-09-28  0:55                                     ` Alan Cox
2001-09-28  2:12                                       ` Stefan Smietanowski
2001-09-28  8:55                                     ` Jamie Lokier [this message]
2001-09-28 16:11                                       ` Linus Torvalds
2001-09-28 20:29                                         ` Eric W. Biederman
2001-09-28 22:24                                           ` Jamie Lokier
2001-09-26 19:04                             ` Locking comment on shrink_caches() George Greer
2001-09-26 18:59                         ` George Greer
2001-09-26 23:26                       ` David S. Miller
2001-09-27 12:10                         ` Alan Cox
2001-09-27 15:38                           ` Linus Torvalds
2001-09-27 17:44                             ` Ingo Molnar
2001-09-27 19:41                           ` David S. Miller
2001-09-27 22:59                             ` Alan Cox
2001-09-25 22:03             ` Andrea Arcangeli
2001-09-25 20:24       ` Rik van Riel
2001-09-25 20:28         ` David S. Miller
2001-09-25 21:05           ` Andrew Morton
2001-09-25 21:48             ` David S. Miller
     [not found]         ` <200109252215.f8PMFDa02034@eng2.beaverton.ibm.com>
2001-09-25 22:26           ` David S. Miller
2001-09-26 17:42             ` Ingo Molnar
2001-09-25 22:01       ` Andrea Arcangeli
2001-09-25 22:03         ` David S. Miller
2001-09-25 22:59           ` Andrea Arcangeli
2001-09-25 20:40     ` Josh MacDonald
2001-09-25 19:25       ` Marcelo Tosatti
2001-09-25 21:57   ` Andrea Arcangeli
  -- strict thread matches above, loose matches on Subject: below --
2001-09-28  1:24 CPU frequency shifting "problems" Grover, Andrew
2001-09-28 21:54 ` Linus Torvalds
2001-09-29  0:37   ` Jonathan Morton
2001-09-28 22:30 ` Alan Cox
2001-10-01  9:28 ` Pavel Machek
2001-09-28 22:47 Grover, Andrew
2001-09-29  1:10 ` Gerhard Mack
     [not found] <8FB7D6BCE8A2D511B88C00508B68C2081971E4@orsmsx102.jf.intel.com>
2001-09-28 23:09 ` Alan Cox

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=20010928095509.A11996@kushida.degree2.com \
    --to=lk@tantalophile.demon.co.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=padraig@antefacto.com \
    --cc=torvalds@transmeta.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