2003-02-03 15:38:28

by Joeri Belis

[permalink] [raw]
Subject:

unsubscribe [email protected]



2003-02-03 16:45:13

by Seamus

[permalink] [raw]
Subject: CPU throttling??

Just a simple question,

Would it be possible to throttle cpu when machine is in idle mode in
Linux? or is it purely a BIOS and motherboard functionality.

As you know some modern laptops in order to save power, throttle cpu
(lower the cpu clock cycles per sec) when in idle mode.

Thanks,

Seamus

2003-02-03 16:55:00

by Martin Hermanowski

[permalink] [raw]
Subject: Re: CPU throttling??

On Mon, Feb 03, 2003 at 04:55:13PM +0000, Seamus wrote:
> Just a simple question,
>
> Would it be possible to throttle cpu when machine is in idle mode in
> Linux? or is it purely a BIOS and motherboard functionality.
>
> As you know some modern laptops in order to save power, throttle cpu
> (lower the cpu clock cycles per sec) when in idle mode.

http://www.brodo.de/cpufreq/

Works well with my P3m

Regards,
Martin


Attachments:
(No filename) (422.00 B)
(No filename) (232.00 B)
Download all attachments

2003-02-03 16:54:09

by Dave Jones

[permalink] [raw]
Subject: Re: CPU throttling??

On Mon, Feb 03, 2003 at 04:55:13PM +0000, Seamus wrote:

> Would it be possible to throttle cpu when machine is in idle mode in
> Linux? or is it purely a BIOS and motherboard functionality.
>
> As you know some modern laptops in order to save power, throttle cpu
> (lower the cpu clock cycles per sec) when in idle mode.

ACPI does this, CPUFreq does this, and if you're really lucky,
there are some APM implementations that do it.

Dave

--
| Dave Jones. http://www.codemonkey.org.uk
| SuSE Labs

2003-02-03 17:02:39

by John Bradford

[permalink] [raw]
Subject: Re: CPU throttling??

> Just a simple question,
>
> Would it be possible to throttle cpu when machine is in idle mode in
> Linux? or is it purely a BIOS and motherboard functionality.
>
> As you know some modern laptops in order to save power, throttle cpu
> (lower the cpu clock cycles per sec) when in idle mode.

CPU speed throttling is is something is that is currently being worked
on.

Incidently, Linux has always halted the processor, rather than spun in
an idle loop, which saves power.

John.

2003-02-03 18:48:12

by Valdis Klētnieks

[permalink] [raw]
Subject: Re: CPU throttling??

On Mon, 03 Feb 2003 17:13:02 GMT, John Bradford said:

> Incidently, Linux has always halted the processor, rather than spun in
> an idle loop, which saves power.

It's conceivable that a CPU halted at 1.2Gz takes less power than one
at 1.6Gz - anybody have any actual data on this? Alternately phrased,
does CPU throttling save power over and above what the halt does?
--
Valdis Kletnieks
Computer Systems Senior Engineer
Virginia Tech


Attachments:
(No filename) (226.00 B)

2003-02-03 18:56:08

by Dave Jones

[permalink] [raw]
Subject: Re: CPU throttling??

On Mon, Feb 03, 2003 at 01:57:17PM -0500, [email protected] wrote:

> It's conceivable that a CPU halted at 1.2Gz takes less power than one
> at 1.6Gz - anybody have any actual data on this? Alternately phrased,
> does CPU throttling save power over and above what the halt does?

Given that most decent implementations scale voltage as well as
frequency, yes, a lower speed will save more power.

Dave

--
| Dave Jones. http://www.codemonkey.org.uk

2003-02-03 19:00:09

by Martin Hermanowski

[permalink] [raw]
Subject: Re: CPU throttling??

On Mon, Feb 03, 2003 at 01:57:17PM -0500, [email protected] wrote:
> On Mon, 03 Feb 2003 17:13:02 GMT, John Bradford said:
>
> > Incidently, Linux has always halted the processor, rather than spun in
> > an idle loop, which saves power.
>
> It's conceivable that a CPU halted at 1.2Gz takes less power than one
> at 1.6Gz - anybody have any actual data on this? Alternately phrased,
> does CPU throttling save power over and above what the halt does?

If I slow down my 1GHz CPU to 732MHz, I get 15min more (195min total).
So it is not much, but noticeable.

Regards,
Martin


Attachments:
(No filename) (584.00 B)
(No filename) (232.00 B)
Download all attachments

2003-02-03 19:05:51

by Matt Reppert

[permalink] [raw]
Subject: Re: CPU throttling??

On Mon, 03 Feb 2003 13:57:17 -0500
[email protected] wrote:

> On Mon, 03 Feb 2003 17:13:02 GMT, John Bradford said:
>
> > Incidently, Linux has always halted the processor, rather than spun in
> > an idle loop, which saves power.
>
> It's conceivable that a CPU halted at 1.2Gz takes less power than one
> at 1.6Gz - anybody have any actual data on this? Alternately phrased,
> does CPU throttling save power over and above what the halt does?

Yes. I have a powerpc laptop that runs at 700 MHz. If I throttle the CPU clock
speed down to 400 MHz and change nothing else the battery has noticeably longer
life; since it's running slower, it takes less power when it's active (not
halted).

Matt

2003-02-03 19:10:19

by John Bradford

[permalink] [raw]
Subject: Re: CPU throttling??

> > > Incidently, Linux has always halted the processor, rather than spun in
> > > an idle loop, which saves power.
> >
> > It's conceivable that a CPU halted at 1.2Gz takes less power than one
> > at 1.6Gz - anybody have any actual data on this? Alternately phrased,
> > does CPU throttling save power over and above what the halt does?
>
> If I slow down my 1GHz CPU to 732MHz, I get 15min more (195min total).
> So it is not much, but noticeable.

Does anybody have any data on frequency throttling on non-X86
architectures?

John.

2003-02-03 19:15:17

by Valdis Klētnieks

[permalink] [raw]
Subject: Re: CPU throttling??

On Mon, 03 Feb 2003 13:14:56 CST, Matt Reppert said:

> Yes. I have a powerpc laptop that runs at 700 MHz. If I throttle the CPU cloc
k
> speed down to 400 MHz and change nothing else the battery has noticeably long
er
> life; since it's running slower, it takes less power when it's active (not
> halted).

I knew that. The question I asked was whether halted at 700Mhz takes more
power than halted at 400Mhz...


Attachments:
(No filename) (226.00 B)

2003-02-03 21:04:58

by Andrew Grover

[permalink] [raw]
Subject: RE: CPU throttling??

> From: Dave Jones [mailto:[email protected]]
> [email protected] wrote:
>
> > It's conceivable that a CPU halted at 1.2Gz takes less
> power than one
> > at 1.6Gz - anybody have any actual data on this?
> Alternately phrased,
> > does CPU throttling save power over and above what the halt does?
>
> Given that most decent implementations scale voltage as well as
> frequency, yes, a lower speed will save more power.

You save the most power when the CPU is at the lowest voltage level, and
in the deepest CPU sleep state (aka CPU C state).

Throttling offers a linear power/perf tradeoff if your system doesn't
have C state support (or if you aren't using it) but really it is
preferable to keep the CPU at its nominal speed, get the work done
sooner, and start sleeping right away. The quote above makes it sound
like the voltage is scaled when throttling, and that isn't accurate -
voltage is scaled when sleeping (to counteract leakage current), at
least on modern Intel mobile processors.

Valdis, you may want to try compiling in ACPI and ACPI Processor support
in 2.5.latest and see what happens to your battery life (if you haven't
tried already). (A caveat - ACPI still doesn't work for everyone, but if
it does, you should see a power savings.)

Regards -- Andy

2003-02-03 21:13:49

by Dave Jones

[permalink] [raw]
Subject: Re: CPU throttling??

On Mon, Feb 03, 2003 at 01:14:18PM -0800, Grover, Andrew wrote:

> You save the most power when the CPU is at the lowest voltage level, and
> in the deepest CPU sleep state (aka CPU C state).
>
> Throttling offers a linear power/perf tradeoff if your system doesn't
> have C state support (or if you aren't using it) but really it is
> preferable to keep the CPU at its nominal speed, get the work done
> sooner, and start sleeping right away. The quote above makes it sound
> like the voltage is scaled when throttling, and that isn't accurate -
> voltage is scaled when sleeping (to counteract leakage current), at
> least on modern Intel mobile processors.

Most (all?[1]) other modern x86 mobile processors behave the way I mentioned.
AMD Powernow (K6 and K7), VIA longhaul/powersaver all have optimal voltages
they can be run at when clocked to different speeds. By way of example, a table from
my mobile athlon..

FID: 0x12 (4.0x [532MHz]) VID: 0x13 (1.200V)
FID: 0x4 (5.0x [665MHz]) VID: 0x13 (1.200V)
FID: 0x6 (6.0x [798MHz]) VID: 0x13 (1.200V)
FID: 0xa (8.0x [1064MHz]) VID: 0xd (1.350V)
FID: 0xf (10.5x [1396MHz]) VID: 0x9 (1.550V)

Sure I *could* run that at 523MHz and still pump 1.550V into it,
but why would I want to do that ?

Dave

[1] Unsure about the crusoe.

--
| Dave Jones. http://www.codemonkey.org.uk

2003-02-03 21:31:18

by John Bradford

[permalink] [raw]
Subject: Re: CPU throttling??

> Sure I *could* run that at 523MHz and still pump 1.550V into it,
> but why would I want to do that ?

If you were using a laptop in a very cold climate.

John.

2003-02-03 22:05:22

by H. Peter Anvin

[permalink] [raw]
Subject: Re: CPU throttling??

Followup to: <[email protected]>
By author: Dave Jones <[email protected]>
In newsgroup: linux.dev.kernel
>
> Most (all?[1]) other modern x86 mobile processors behave the way I mentioned.
> AMD Powernow (K6 and K7), VIA longhaul/powersaver all have optimal voltages
> they can be run at when clocked to different speeds. By way of example, a table from
> my mobile athlon..
>
> FID: 0x12 (4.0x [532MHz]) VID: 0x13 (1.200V)
> FID: 0x4 (5.0x [665MHz]) VID: 0x13 (1.200V)
> FID: 0x6 (6.0x [798MHz]) VID: 0x13 (1.200V)
> FID: 0xa (8.0x [1064MHz]) VID: 0xd (1.350V)
> FID: 0xf (10.5x [1396MHz]) VID: 0x9 (1.550V)
>
> Sure I *could* run that at 523MHz and still pump 1.550V into it,
> but why would I want to do that ?
>
> Dave
>
> [1] Unsure about the crusoe.
>

Crusoe changes frequency and voltages on the fly, transparently to the
operating system.

-hpa
--
<[email protected]> at work, <[email protected]> in private!
"Unix gives you enough rope to shoot yourself in the foot."
Architectures needed: cris ia64 m68k mips64 ppc ppc64 s390 s390x sh v850 x86-64

2003-02-03 22:21:51

by Ville Herva

[permalink] [raw]
Subject: Re: CPU throttling??

On Mon, Feb 03, 2003 at 01:14:18PM -0800, you [Grover, Andrew] wrote:
> > From: Dave Jones [mailto:[email protected]]
> > [email protected] wrote:
> >
> > > It's conceivable that a CPU halted at 1.2Gz takes less
> > power than one
> > > at 1.6Gz - anybody have any actual data on this?
> > Alternately phrased,
> > > does CPU throttling save power over and above what the halt does?
> >
> > Given that most decent implementations scale voltage as well as
> > frequency, yes, a lower speed will save more power.
>
> You save the most power when the CPU is at the lowest voltage level, and
> in the deepest CPU sleep state (aka CPU C state).
>
> Throttling offers a linear power/perf tradeoff if your system doesn't
> have C state support (or if you aren't using it) but really it is
> preferable to keep the CPU at its nominal speed, get the work done
> sooner, and start sleeping right away. The quote above makes it sound
> like the voltage is scaled when throttling, and that isn't accurate -
> voltage is scaled when sleeping (to counteract leakage current), at
> least on modern Intel mobile processors.

Interesting.

So, what sw does one need for this CPU C state? Which kernels support it /
which patches are needed? 2.5 only?

Also, which CPUs support it? Am I out of luck with my measly 1.4 Celeron
Tualatin?

So far I've only been doing "Make CPU Idle calls when idle", which I gather
is far from optimal?


-- v --

[email protected]

2003-02-03 22:40:13

by Andrew Grover

[permalink] [raw]
Subject: RE: CPU throttling??

> From: Dave Jones [mailto:[email protected]]
> > Throttling offers a linear power/perf tradeoff if your
> system doesn't
> > have C state support (or if you aren't using it) but really it is
> > preferable to keep the CPU at its nominal speed, get the work done
> > sooner, and start sleeping right away. The quote above
> makes it sound
> > like the voltage is scaled when throttling, and that isn't
> accurate -
> > voltage is scaled when sleeping (to counteract leakage current), at
> > least on modern Intel mobile processors.
>
> Most (all?[1]) other modern x86 mobile processors behave the
> way I mentioned.
> AMD Powernow (K6 and K7), VIA longhaul/powersaver all have
> optimal voltages
> they can be run at when clocked to different speeds. By way
> of example, a table from
> my mobile athlon..
>
> FID: 0x12 (4.0x [532MHz]) VID: 0x13 (1.200V)
> FID: 0x4 (5.0x [665MHz]) VID: 0x13 (1.200V)
> FID: 0x6 (6.0x [798MHz]) VID: 0x13 (1.200V)
> FID: 0xa (8.0x [1064MHz]) VID: 0xd (1.350V)
> FID: 0xf (10.5x [1396MHz]) VID: 0x9 (1.550V)
>
> Sure I *could* run that at 523MHz and still pump 1.550V into it,
> but why would I want to do that ?

Voltage scaling. Yes, it's widespread. I was referring to an additional
capability to lower voltage while the CPU is sleeping. But I digress.

But this whole thread didn't start as a discussion of voltage scaling,
it started as a discussion of throttling - e.g. keeping your system at
1400MHz 1.550V and simulating a slower processor by toggling the STPCLK#
pin. And you're exactly right that no you *wouldn't* want to do that.

I think we are in agreement. ;-)

Regards -- Andy

2003-02-04 10:11:58

by Seamus

[permalink] [raw]
Subject: RE: CPU throttling??

On Mon, 2003-02-03 at 21:14, Grover, Andrew wrote:
> > From: Dave Jones [mailto:[email protected]]
> > [email protected] wrote:
> >
> > > It's conceivable that a CPU halted at 1.2Gz takes less
> > power than one
> > > at 1.6Gz - anybody have any actual data on this?
> > Alternately phrased,
> > > does CPU throttling save power over and above what the halt does?
> >
> > Given that most decent implementations scale voltage as well as
> > frequency, yes, a lower speed will save more power.
>
> You save the most power when the CPU is at the lowest voltage level, and
> in the deepest CPU sleep state (aka CPU C state).
>
> Throttling offers a linear power/perf tradeoff if your system doesn't
> have C state support (or if you aren't using it) but really it is
> preferable to keep the CPU at its nominal speed, get the work done
> sooner, and start sleeping right away. The quote above makes it sound
> like the voltage is scaled when throttling, and that isn't accurate -
> voltage is scaled when sleeping (to counteract leakage current), at
> least on modern Intel mobile processors.
>
> Valdis, you may want to try compiling in ACPI and ACPI Processor support
> in 2.5.latest and see what happens to your battery life (if you haven't
> tried already). (A caveat - ACPI still doesn't work for everyone, but if
> it does, you should see a power savings.)
>
> Regards -- Andy

Hmmm, it seems most of these apply to mobile processors.
I'm using AMD 1.4 Athlon Thunderbird on a desktop, as you know my
processor was the one before release low power AMD XP processors.
It uses a savage amount of power, and operates well into 60 and 70
degrees celcius.

I'm not a big linux head, can someone through me an ACPI link, related
to this issue of CPU C state?

One other thing, apart from saving power on CPU and hard-disk (via
hdparm) is there anything else I can look into ? something worthy
though.

Thanks,

Seamus

2003-02-04 10:21:15

by John Bradford

[permalink] [raw]
Subject: Re: CPU throttling??

> Hmmm, it seems most of these apply to mobile processors.
> I'm using AMD 1.4 Athlon Thunderbird on a desktop, as you know my
> processor was the one before release low power AMD XP processors.
> It uses a savage amount of power, and operates well into 60 and 70
> degrees celcius.

Is that the temperature when it's halted, or when it's in use? I have
never observed the Duron 650 machine that's here get above 30 degrees
C, and the MMX-200 doesn't have a temperature sensor, but I'd estimate
that it never goes above 40.

> One other thing, apart from saving power on CPU and hard-disk (via
> hdparm) is there anything else I can look into ? something worthy
> though.

Well, monitor power saving will save power, but not make the case
temperature drop, which is what I assume you are trying to achieve.

John.

2003-02-04 10:51:11

by Seamus

[permalink] [raw]
Subject: Re: CPU throttling??

On Tue, 2003-02-04 at 10:31, John Bradford wrote:
> > Hmmm, it seems most of these apply to mobile processors.
> > I'm using AMD 1.4 Athlon Thunderbird on a desktop, as you know my
> > processor was the one before release low power AMD XP processors.
> > It uses a savage amount of power, and operates well into 60 and 70
> > degrees celcius.
>
> Is that the temperature when it's halted, or when it's in use? I have
> never observed the Duron 650 machine that's here get above 30 degrees
> C, and the MMX-200 doesn't have a temperature sensor, but I'd estimate
> that it never goes above 40.
>

OK, this is the full story.
I have an AMD 1.4GHz Athlon Thunderbird on ASUS motherboard.
While computer must be up 24/7 there are times that it may not be in use
(at all) for periods as long as 12 hours.
I'd like to minimize power consumption at those times.
So far achieving it by monitor powering off and hard-disk suspending.

I don't know how much I can save on CPU, but when it's completely idle
(normal mode, not halted though) its at 59-61 degrees celcius, when its
at 100% use, it easily reaches 74+. Aparently its normal with AMD Athlon
Thunderbird CPUs !

Now, I want to put CPU into *lowest* power consumption mode (whether
that be CPU C state, halt state, lower freq or lower voltage) at times
when I don't need it (but as you know, at all times there are processes
running, no matter how infrequent and low cpu usage they have, so I can
hardly see ideal "Halt" mode possible), so whats the best action ?

Seamus

2003-02-04 14:02:51

by Erik Mouw

[permalink] [raw]
Subject: Re: CPU throttling??

On Mon, Feb 03, 2003 at 07:20:34PM +0000, John Bradford wrote:
> Does anybody have any data on frequency throttling on non-X86
> architectures?

See http://www.lart.tudelft.nl/projects/scaling/ for papers describing
clock&voltage scaling on StrongARM SA-1100. The same page also has my
OLS 2002 cpufreq overview paper.


Erik

--
J.A.K. (Erik) Mouw
Email: [email protected] [email protected]
WWW: http://www-ict.its.tudelft.nl/~erik/


Attachments:
(No filename) (444.00 B)
(No filename) (189.00 B)
Download all attachments

2003-02-04 15:38:09

by Daniel Egger

[permalink] [raw]
Subject: Re: CPU throttling??

Am Mon, 2003-02-03 um 20.24 schrieb [email protected]:

> I knew that. The question I asked was whether halted at 700Mhz takes more
> power than halted at 400Mhz...

PowerPC CPUs will shut down unneeded units. There's no such things as a
"hlt" instruction. The natural way to slow down the CPU causing more
sparetime to shut down single units is to throttle the dispatching of
instructions for which there's are flags in the control register set.

I've no idea where the frequency scaling should happen but it either
needs some hardware clock control or it's the mentioned dispatch
throttling. In case of the former there'd be some powersave effects
because the power drawn by a CPU is direct proportional to the
frequency. In the latter case the difference between an automatically
sleeping 700Mhz and a throttled 700Mhz cpu at "400Mhz" should be pretty
small, in case the cpu is mostly idle.

--
Servus,
Daniel


Attachments:
signature.asc (189.00 B)
Dies ist ein digital signierter Nachrichtenteil