Skip to contentSkip to conversation

PROBLEM: Celeron Core

DISCUSSION Chodorenko Michail 6 participants 14 messages Jan 18, 2008 – Jan 20, 2008

lore
Share & tools
lore
#0 lore raw

I have a laptop "Extensa 5220", with the processor Celeron based on 'core' technology.
There is ~ / arch/i386/kernel/cpu/cpufreq/p4-clockmod.c in the kernel source code
but there's no line identification of my CPU for apply freqency change need to add a ID line 0х16

    "that instead of p4-clockmod, if possible.\n");
               switch (c->x86_model) {
               case 0x0E: /* Core */
+              case 0x16: /* Celeron Core */
               case 0x0F: /* Core Duo */
                      p4clockmod_driver.flags |= CPUFREQ_CONST_LOOPS;
                      return

speedstep_get_processor_frequency(SPEEDSTEP_PROCESSOR_PCORE);

#1 lore raw
Quoted 6 lines · Chodorenko Michail

I have a laptop "Extensa 5220", with the processor Celeron based on 'core' technology.
There is ~ / arch/i386/kernel/cpu/cpufreq/p4-clockmod.c in the kernel source code
but there's no line identification of my CPU for apply freqency change need to add a ID line 0х16

Note that driver will likely do clock throttling on your CPU. Using that is usually a bad idea because it does not actually safe power. It's only intended to let the CPU cool down in some situations.

-Andi

#2 lore raw
Quoted 9 lines · Andi Kleen
Quoted 6 lines · Chodorenko Michail

I have a laptop "Extensa 5220", with the processor Celeron based on 'core' technology.
There is ~ / arch/i386/kernel/cpu/cpufreq/p4-clockmod.c in the kernel source code
but there's no line identification of my CPU for apply freqency change need to add a ID line 0х16

Quoted 3 lines

Note that driver will likely do clock throttling on your CPU. Using that is usually a bad idea because it does not actually safe power. It's only intended to let the CPU cool down in some situations.

Power consumption is more or less exactly equal to heat production (that's where the power goes, after all!), so either clock throttling DOES save power or it DOES NOT cool the CPU.

Signature · 1 line
Mathematics is the supreme nostalgia of our time.
#3 lore raw
Quoted 11 lines · Matt Mackall
Quoted 9 lines · Andi Kleen
Quoted 6 lines · Chodorenko Michail

I have a laptop "Extensa 5220", with the processor Celeron based on 'core' technology.
There is ~ / arch/i386/kernel/cpu/cpufreq/p4-clockmod.c in the kernel source code
but there's no line identification of my CPU for apply freqency change need to add a ID line 0х16

Quoted 7 lines
Quoted 3 lines

Note that driver will likely do clock throttling on your CPU. Using that is usually a bad idea because it does not actually safe power. It's only intended to let the CPU cool down in some situations.

Power consumption is more or less exactly equal to heat production (that's where the power goes, after all!), so either clock throttling DOES save power or it DOES NOT cool the CPU.

No actually the way it works on modern x86 CPUs is that the best strategy for saving power is to do things quickly and then idle longer. That means on anything that has reasonably deep sleep modi e.g. on older server/desktop systems things might be slightly different because they had very little power saving features enabled, but it's definitely true for all laptop systems from the last several years. But even
on desktop/server throttling tends to be a bad idea.

Intel style throttling makes the CPU skip cycles so the maximum built up heat for a time unit is less, but it will run active for longer that makes it overall take more power for a given work unit.

Here's a better description from Dominik:

http://article.gmane.org/gmane.linux.kernel.cpufreq/3497

Note the conditions he describes are quite common. Also the OP CPU likely has C2 and even deeper sleep modi.

Another problem with throttling / p4-clockmod is that on at least some CPUs (not necessarily P-M, but we saw this on some P4s) is that they can create quite long user visible latencies. You might actually get "hanging mouse pointers" from it if you use it with an aggressive governour like ondemand.

The normal use case for Intel throttling is to just do an emergency cool down in case the CPU fails (down to thermal shutdown). And that is done transparently behind Linux's back.

-Andi

#4 lore raw
Quoted 20 lines · Andi Kleen
Quoted 11 lines · Matt Mackall
Quoted 9 lines · Andi Kleen
Quoted 6 lines · Chodorenko Michail

I have a laptop "Extensa 5220", with the processor Celeron based on 'core' technology.
There is ~ / arch/i386/kernel/cpu/cpufreq/p4-clockmod.c in the kernel source code
but there's no line identification of my CPU for apply freqency change need to add a ID line 0х16

Quoted 7 lines
Quoted 3 lines

Note that driver will likely do clock throttling on your CPU. Using that is usually a bad idea because it does not actually safe power. It's only intended to let the CPU cool down in some situations.

Power consumption is more or less exactly equal to heat production (that's where the power goes, after all!), so either clock throttling DOES save power or it DOES NOT cool the CPU.

Quoted 8 lines

No actually the way it works on modern x86 CPUs is that the best strategy for saving power is to do things quickly and then idle longer. That means on anything that has reasonably deep sleep modi e.g. on older server/desktop systems things might be slightly different because they had very little power saving features enabled, but it's definitely true for all laptop systems from the last several years. But even
on desktop/server throttling tends to be a bad idea.

Dominik is measuring energy expended (watts * seconds) vs work done (CPU cycles). But your claim above is "clock throttling...does not save power [but it lets] the CPU cool down", which talks about power (watts) and heat (also watts, in fact the *very same* watts) and is physically impossible. A CPU turns power into heat. Less heat out implies less power in.

So while throttling may be less efficient in terms of watt seconds used to compile something than running at full speed, it is incorrect to say it uses less power. One machine running for an hour throttled to 50% uses less power (and therefore less battery and cooling) than another running at full speed for that same hour.

The first machine may take significantly longer to complete its task (or it may not, if the task is reading email or watching video), but that's another matter entirely. And whether it's more or less efficient than other power-saving approaches is also another matter. Throttling does save power.

Signature · 1 line
Mathematics is the supreme nostalgia of our time.
#5 lore raw
Quoted 5 lines

So while throttling may be less efficient in terms of watt seconds used to compile something than running at full speed, it is incorrect to say it uses less power. One machine running for an hour throttled to 50% uses less power (and therefore less battery and cooling) than another running at full speed for that same hour.

Not for the same unit of work. If you just run endless loops you might be true, but most systems don't do that.

In terms of laptops (or rather in most other systems too) you usually care about battery life time while the system is mostly idling (waiting for your key strokes etc.). In this case enabling throttling as a cpufreq driver will not make your battery last longer.

Also skipping the clocks does not actually safe all very much power compared to the other measures C-states or speedstep do (like dropping voltage)

This means enabling it will likely make your laptop battery last shorter.

-Andi

#6 lore raw
Quoted 8 lines · Andi Kleen
Quoted 5 lines

So while throttling may be less efficient in terms of watt seconds used to compile something than running at full speed, it is incorrect to say it uses less power. One machine running for an hour throttled to 50% uses less power (and therefore less battery and cooling) than another running at full speed for that same hour.

Not for the same unit of work. If you just run endless loops you might be true, but most systems don't do that.

Yes, most systems idle.

Quoted 4 lines

In terms of laptops (or rather in most other systems too) you usually care about battery life time while the system is mostly idling (waiting for your key strokes etc.). In this case enabling throttling as a cpufreq driver will not make your battery last longer.

It will relative to not throttling.

You made a claim that is -physically impossible- as stated, a claim I've seen here before and I'm correcting it. If something reduces heat, it must save power *by the definition of heat and power*. And if you reduce power usage, you will make your battery last longer.

Make any other statement you want about the efficiency of throttling per unit work or the effectiveness of throttling relavite to other methods, just stop repeating the claim that "throttling reduces heat but doesn't save power". It goes against the law of conservation of energy.

Signature · 1 line
Mathematics is the supreme nostalgia of our time.
#7 lore raw
Quoted 1 line

It will relative to not throttling.

No it will not. Please reread Dominik's mail I linked to. It explains it clearly.

Quoted 4 lines

You made a claim that is -physically impossible- as stated, a claim I've seen here before and I'm correcting it. If something reduces heat, it must save power *by the definition of heat and power*. And if you reduce power usage, you will make your battery last longer.

I think the misunderstanding on your side is relative to what there is less heat. Throttling essentially reduces temporary heat spikes on the silicon, but does not make the system overall take less power or generate less heat as measured over a longer time because it will be idle less.

-Andi

#8 lore raw
Quoted 6 lines · Andi Kleen

I think the misunderstanding on your side is relative to what there is less heat. Throttling essentially reduces temporary heat spikes on the silicon, but does not make the system overall take less power or generate less heat as measured over a longer time because it will be idle less.

I don't understand this, and it seems wrong. Most machines spend most of their time doing nothing, or as close to nothing as they're allowed. Idle, in other words. Isn't it the case that an idle machine will use less power when throttled than when not?

#9 lore raw
Quoted 2 lines

Isn't it the case that an idle machine will use
less power when throttled than when not?

No that is not the case (not even on old CPUs)

-Andi

#10 lore raw
Quoted 6 lines · Andi Kleen
Quoted 3 lines

Isn't it the case that an idle machine will use
less power when throttled than when not?

No that is not the case (not even on old CPUs)

Then why would it run cooler? What generates the heat when not throttled? What stops generating heat when throttled? And you say this happens without reducing power consumption? I'm not convinced. I'm a long way from that.

#11 lore raw
Quoted 8 lines · David Newall
Quoted 6 lines · Andi Kleen
Quoted 3 lines

Isn't it the case that an idle machine will use
less power when throttled than when not?

No that is not the case (not even on old CPUs)

Then why would it run cooler?

Ok for one more (but last) time:

Throttling just lowers the short term heat spikes to prevent short term damage to the silicon. For that it focusses on lowering the absolute temperature at a given point. That only applies when the CPU is busy.

But for total power consumption (or rather more concretly conserving your battery) you don't care about absolute temperature at a given point (as long as it is not high enough that it destroys the CPU) you care about how much power is consumed (and heat generated from that) averaged out over a longer time.

And for most typical workloads (not running endless loops; significant idle time) throttling makes no difference and in fact often (especially on laptop CPUs with deeper sleep modi like the original reported had one) makes it likely worse (see previous mails for details why)

Quoted 1 line

I'm not convinced. I'm along way from that.

Frankly that's fine for me. I don't really feel any need to convince you. I can live with your metal model of CPU physics not being accurate.

-Andi (feeling a bit like a broken record)

Quoted 1 line
#12 lore raw
In reply to David Newall
Quoted 4 lines · David Newall

Then why would it run cooler? What generates the heat when not throttled? What stops generating heat when throttled? And you say this happens without reducing power consumption? I'm not convinced. I'm a long way from that.

If your P4 runs along at 100% and starts getting hot it can start throthling to only run half the clock cycles. This of course makes the task running take twice as long to complete, but will reduce the heat produced by the chip to perhaps 60 or 70% of what it was at 100% load at normal speed. This lets the chip cool of a bit although the user won't appreaciate the fact their program now runs slower, but such was life with the P4 (at least if you didn't have a good cooling system in place).

In cases where your system is not running at 100% load, but perhaps only 50% load you can instead save some power (and hence heat production) if you slow the actual clock rate of the cpu and lower the voltage at the same time, both things the throthling on the P4 did not do, since your task only neds the chip running at 50% of normal speed in order to complete the task in the minimum amount of time.

The throthling is about protecting the CPU from damage, not about saving power (since it does cause the work to take longer to complete preventing the cpu from going back to idling for a longer period of time), while the other case is all about saving power when the system isn't under enough load to require the full performance. Throthling had nothing to do with an idle CPU where it should make no difference (although it may actually affect in negatively), it was only about what to do when under high load and getting too hot.

Sure the power consumption dropped while throthlin was active, since the idea was to reduce heat output, but the performance dropped more than the power consumption.

If you have a CPU that uses 100W at full load at full clock rate, and uses 5W when idle, and uses 70W when throthled 50% under full load, then a program using the cpu for full load for an hour without throthling and then idles for an hour, would use less overall power than if you throthled the system 50% and the program finishes in 2 hours. 100W for an hour + 5W for an hour = 105Wh while 70W for two hours = 140Wh.

If you only need 50% then a modern CPU should use less than 50% of its maximum power if you drop it's clock frequency to half and at the same time reduce it's core voltage a bit. It may be able to run 50% load with power management in 30W or 40W instead, which is much better than what throthling did and it only does it when the cpu load is low enough to not slow down the user, while throughling only applied when it would slow down the user while under high load.

--
Len Sorensen

#13 lore raw
In reply to Andi Kleen
Quoted 8 lines · Andi Kleen
Quoted 5 lines

So while throttling may be less efficient in terms of watt seconds used to compile something than running at full speed, it is incorrect to say it uses less power. One machine running for an hour throttled to 50% uses less power (and therefore less battery and cooling) than another running at full speed for that same hour.

Not for the same unit of work. If you just run endless loops you might be true, but most systems don't do that.

So you mean energy (measured in J).
Power is energy/time unit (measured in W, i.e. J/s).

So I guess what you really want to say is: throttling decreases power consumption, but on modern CPUs it increases the amount of energy needed to perform the task.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds