public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Padraig Brady <padraig@antefacto.com>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: linux-kernel@vger.kernel.org
Subject: CPU frequency shifting "problems"
Date: Thu, 27 Sep 2001 13:22:05 +0100	[thread overview]
Message-ID: <3BB319ED.5020406@antefacto.com> (raw)
In-Reply-To: <Pine.LNX.4.33.0109261123380.8558-100000@penguin.transmeta.com> <Pine.LNX.4.30.0109262036480.8655-100000@Appserv.suse.de> <9ot9bm$8gu$1@penguin.transmeta.com>

  Linus Torvalds wrote:

>In article <Pine.LNX.4.30.0109262036480.8655-100000@Appserv.suse.de>,
>Dave Jones  <davej@suse.de> wrote:
>
>>On Wed, 26 Sep 2001, Linus Torvalds wrote:
>>
>>>>>cpuid: 72 cycles
>>>>>
>>>>cpuid: 79 cycles
>>>>Only slightly worse, but I'd not expected this.
>>>>
>>>That difference can easily be explained by the compiler and options.
>>>
>>Actually repeated runs of the test on that box show it deviating by up
>>to 10 cycles, making it match the results that Alan posted.
>>-O2 made no difference, these deviations still occur. They seem more
>>prominent on the C3 than other boxes I've tried, even with the same
>>compiler toolchain.
>>
>
>Does the C3 do any kind of frequency shifting?
>
Not automatic, but you can set the multiplier dynamically by setting the 
msr.
Russell King has been working on an arch independent framework for this
kind of thing and support for the C3 has recently been added by Dave Jones.
The code is available @:
cvs -d :pserver:cvs@pubcvs.arm.linux.org.uk:/mnt/src/cvsroot login
cvs -d :pserver:cvs@pubcvs.arm.linux.org.uk:/mnt/src/cvsroot co cpufreq

>
>For example, on a transmeta CPU, the TSC will run at a constant
>"nominal" speed (the highest the CPU can go), although the real CPU
>speed will depend on the load of the machine and temperature etc.
>
As does the P4 from what I understand. So a question..
What are the software dependencies on this auto/manual frequency shifting?
The code referenced above scales jiffies appropriately when a manual
frequency change is requested. I'm not sure about the possible consequences
of this for e.g. could there be races introduced with various busy loop 
locking etc.
A quick check for the use of jiffies in the kernel:
[padraig@pixelbeat linux]$ find -name "*.[ch]" | xargs grep jiffies | wc -l
   3992

Also with the auto shifting of the transmeta/P4, wont this invalidate 
the jiffies
value? Also how does this affect the rtLinux guys (and realtime software
in general).

cheers,
Padraig.

>  So on
>a crusoe CPU you'll see varying speeds (and it depends on the speed
>grade, because that in turn depends on how many longrun steps are being
>actively used). 
>
>For example, on a mostly idle machine I get
>
>	torvalds@kiwi:~ > ./a.out 
>	nothing: 54 cycles
>	locked add: 54 cycles
>	cpuid: 91 cycles
>
>while if I have another window that does an endless loop to keep the CPU
>busy, the _real_ frequency of the CPU scales up, and the machine
>basically becomes faster:
>
>	torvalds@kiwi:~ > ./a.out 
>	nothing: 36 cycles
>	locked add: 36 cycles
>	cpuid: 54 cycles
>
>(The reason why the "nothing" TSC read is expensive on crusoe is because
>of the scaling of the TSC - rdtsc literally has to do a floating point
>multiply-add to scale the clock to the right "nominal" frequency.  Of
>course, "expensive" is still a lot less than the inexplicable 80 cycles
>on a P4). 
>
>(That's a 600MHz part 
>going down to to 400MHz in idle, btw)
>
>On a 633MHz part (I don't actually have access to any of the high speed
>grades ;) it ends up being 
>
>fast:
>	nothing: 39 cycles
>	locked add: 40 cycles
>	cpuid: 68 cycles
>
>slow: 
>	nothing: 82 cycles
>	locked add: 84 cycles
>	cpuid: 122 cycles
>
>which corresponds to a 633MHz part going down to 300MHz in idle.
>
>And of course, you can get pretty much anything in between, depending on
>what the load is...
>
>		Linus
>





  reply	other threads:[~2001-09-27 12:27 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                                 ` Padraig Brady [this message]
2001-09-27 12:44                                   ` CPU frequency shifting "problems" 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
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=3BB319ED.5020406@antefacto.com \
    --to=padraig@antefacto.com \
    --cc=linux-kernel@vger.kernel.org \
    --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