public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Masami Hiramatsu <mhiramat@redhat.com>
Cc: Mathieu Desnoyers <compudj@krystal.dyndns.org>,
	        Martin Bligh <mbligh@google.com>,
	        Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	        Thomas Gleixner <tglx@linutronix.de>,
	        Steven Rostedt <rostedt@goodmis.org>,
	darren@dvhart.com,         "Frank Ch. Eigler" <fche@redhat.com>,
	        systemtap-ml <systemtap@sources.redhat.com>
Subject: Re: Unified tracing buffer
Date: Tue, 23 Sep 2008 16:02:00 -0000	[thread overview]
Message-ID: <alpine.LFD.1.10.0809230847360.3265@nehalem.linux-foundation.org> (raw)
In-Reply-To: <48D90B84.4030905@redhat.com>



On Tue, 23 Sep 2008, Masami Hiramatsu wrote:
> 
> 2.00GHz is the maximum(model) frequency. And 'cpu MHz' means
> current frequency. (yep, now I'm using cpufreq)
> Anyway, when I measured TSC drift, I killed cpuspeed service and
> fixed freq to 2000. ;-)

Ahh. I have an idea..

Maybe that thing does thermal throttling? 

Fixing the frequency at the highest setting is actually one of the worst 
things you can do, because if the device is thermally limited, it will 
still do the whole throttling thing, but now it won't do it by changing 
the frequency any more, it will do it by essentially forxing the external 
frequency down.

And that is going to be *very* inefficient. You really really don't want 
that. Your performance will actually be _worse_ than if the CPU went to a 
lower frequency. And it might explain the unreliable TSC too, because I 
suspect constant TSC is really constant only wrt the bus clock to the CPU.

The termal throttling thing is a "protect the CPU from overheating" last 
ditch effort, and because it doesn't lower voltage, it isn't actually at 
all as efficient at saving power (and thus cooling the CPU) as a real 
frequency change event would be.

And fixing the frequency to the highest frequency in a tight laptop 
enclosure is the best way to force that behavior (in contrast - in a 
desktop system with sufficient cooling, it's usually not a problem at all 
to just say "run at highest frequency").

And btw, that also explains why you had so *big* changes in frequency: the 
throttling I think happens with a 1/8 duty cycle thing, iirc.

It's supposed to be very rare with Core 2. Thermal throttling was quite 
common with the P4 one, and was the main overheating protection initially. 
These days, you should only see it for really badly designed devices that 
simply don't have enough thermal cooling, but if the design calls for 
mostly running at low frequency because it's some thing-and-light notebook 
with insufficient cooling (or some thick-and-heavy thing that is just 
total crap), and you force it to always run at full speed, I can imagine 
it kicking in to protect the CPU.

It's obviously also going to be much easier to see if the ambient 
temperature is high. If you want to get best peformance, take one of those 
compressed-air spray-cans, and spray on the laptop with the can held 
upside down (the can will generally tell you _not_ to do that, because 
then you'll get the liquid itself rather than gas, but that's what you 
want for cooling).

So if you can test this, try it with 
 (a) cpufreq at a fixed _low_ value (to not cause overheating)
 (b) with the spray-can cooling the thing and cpufreq at a fixed high 
     value
and see if the TSC is constant then.

			Linus

  reply	other threads:[~2008-09-23 16:02 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <33307c790809191433w246c0283l55a57c196664ce77@mail.gmail.com>
2008-09-22 19:47 ` Masami Hiramatsu
2008-09-22 20:14   ` Martin Bligh
2008-09-22 22:27     ` Masami Hiramatsu
2008-09-22 23:12       ` Darren Hart
2008-09-23  0:06         ` Masami Hiramatsu
2008-09-22 23:17       ` Martin Bligh
2008-09-23  0:07         ` Masami Hiramatsu
2008-09-23  0:13           ` Martin Bligh
2008-09-23 14:51             ` Masami Hiramatsu
2008-09-23 15:09               ` Mathieu Desnoyers
2008-09-23 15:32                 ` Masami Hiramatsu
2008-09-23 16:02                   ` Linus Torvalds [this message]
2008-09-23 17:07                     ` Masami Hiramatsu
2008-09-23 17:33                       ` Thomas Gleixner
2008-09-23 19:03                         ` Masami Hiramatsu
2008-09-23 19:37                           ` Thomas Gleixner
2008-09-23 19:39                             ` Martin Bligh
2008-09-23 19:42                               ` Thomas Gleixner
2008-09-23 19:51                                 ` Martin Bligh
2008-09-23 20:05                                   ` Thomas Gleixner
2008-09-23 21:02                                     ` Martin Bligh
2008-09-23 20:06                             ` Masami Hiramatsu
2008-09-23 20:09                               ` Thomas Gleixner
2008-09-23 15:48               ` Linus Torvalds
2008-09-23  0:41           ` Linus Torvalds
2008-09-23  1:28             ` Roland Dreier
2008-09-23  1:40               ` Steven Rostedt
2008-09-23  2:08               ` Mathieu Desnoyers
2008-09-23  2:27                 ` Darren Hart
2008-09-23  2:32                   ` Mathieu Desnoyers
2008-09-23  3:29               ` Linus Torvalds
2008-09-23  3:42                 ` Mathieu Desnoyers
2008-09-23  4:06                   ` Linus Torvalds
2008-09-23  3:44                 ` Steven Rostedt
2008-09-23  4:12                   ` Masami Hiramatsu
2008-09-23  4:18                     ` Martin Bligh
2008-09-23 15:25                       ` Masami Hiramatsu
2008-09-23 10:54                     ` Steven Rostedt
2008-09-23  4:20                   ` Linus Torvalds
2008-09-23 14:13                     ` Mathieu Desnoyers
2008-09-23  2:31             ` Mathieu Desnoyers
2008-09-23  3:07             ` Masami Hiramatsu
2008-09-23 14:38       ` KOSAKI Motohiro
2008-09-23 15:04         ` Frank Ch. Eigler
2008-09-23 15:23         ` Masami Hiramatsu
2008-09-23 18:04           ` KOSAKI Motohiro
2008-09-23 18:29             ` Martin Bligh

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=alpine.LFD.1.10.0809230847360.3265@nehalem.linux-foundation.org \
    --to=torvalds@linux-foundation.org \
    --cc=compudj@krystal.dyndns.org \
    --cc=darren@dvhart.com \
    --cc=fche@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mbligh@google.com \
    --cc=mhiramat@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=systemtap@sources.redhat.com \
    --cc=tglx@linutronix.de \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).