public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* CPU offline but power consumption increased?
@ 2007-04-07  4:23 Andika Triwidada
  2007-04-07 23:38 ` Andi Kleen
  0 siblings, 1 reply; 4+ messages in thread
From: Andika Triwidada @ 2007-04-07  4:23 UTC (permalink / raw)
  To: linux-kernel

http://andika-lives-here.blogspot.com/2007/03/eksperimen-cpu-hotplug-dan-konsumsi.html

* initial setup:
root@hokage:~# cpufreq-set -d 1.666g
root@hokage:~# cpufreq-set -u 1.666g
root@hokage:~# cpufreq-set -g userspace
root@hokage:~# cpufreq-info
cpufrequtils 002: cpufreq-info (C) Dominik Brodowski 2004-2006
Report errors and bugs to linux@brodo.de, please.
analyzing CPU 0:
  driver: acpi-cpufreq
  CPUs which need to switch frequency at the same time: 0 1
  hardware limits: 1000 MHz - 1.67 GHz
  available frequency steps: 1.67 GHz, 1.33 GHz, 1000 MHz
  available cpufreq governors: userspace, powersave, ondemand,
conservative, performance
  current policy: frequency should be within 1.67 GHz and 1.67 GHz.
                  The governor "userspace" may decide which speed to use
                  within this range.
  current CPU frequency is 1.67 GHz (asserted by call to hardware).
analyzing CPU 1:
  driver: acpi-cpufreq
  CPUs which need to switch frequency at the same time: 0 1
  hardware limits: 1000 MHz - 1.67 GHz
  available frequency steps: 1.67 GHz, 1.33 GHz, 1000 MHz
  available cpufreq governors: userspace, powersave, ondemand,
conservative, performance
  current policy: frequency should be within 1.67 GHz and 1.67 GHz.
                  The governor "userspace" may decide which speed to use
                  within this range.
  current CPU frequency is 1.67 GHz (asserted by call to hardware).

root@hokage:~# grep rate /proc/acpi/battery/BAT1/state
present rate:            1693 mA


* turn off CPU#1
root@hokage:~# echo 0 > /sys/devices/system/cpu/cpu1/online
root@hokage:~# grep rate /proc/acpi/battery/BAT1/state
present rate:            2084 mA

* turn CPU#1 back on:
root@hokage:~# echo 1 > /sys/devices/system/cpu/cpu1/online
root@hokage:~# grep processor /proc/cpuinfo
processor       : 0
processor       : 1
root@hokage:~# grep rate /proc/acpi/battery/BAT1/state
present rate:            1653 mA


Question: is that normal? I thought power consumption will be
automatically reduced if one core offlined.

Thanks.
Andika

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: CPU offline but power consumption increased?
  2007-04-07  4:23 CPU offline but power consumption increased? Andika Triwidada
@ 2007-04-07 23:38 ` Andi Kleen
  2007-04-10  8:13   ` Len Brown
  0 siblings, 1 reply; 4+ messages in thread
From: Andi Kleen @ 2007-04-07 23:38 UTC (permalink / raw)
  To: Andika Triwidada; +Cc: linux-kernel, linux-acpi

"Andika Triwidada" <andika@gmail.com> writes:

[cc linux-acpi]
 
> Question: is that normal? I thought power consumption will be
> automatically reduced if one core offlined.

The current cpu offline essentially just runs a special idle loop.
The standard idle loop is even a bit more aggressive on some systems
because it knows about the deeper ACPI sleep modi.

There are also dependencies between cores because current CPUs
have shared power planes between cores.

I suppose in the future when a whole socket goes off line one could
implement special code to turn off the CPU further. But it likely
won't work on older hardware.

-Andi

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: CPU offline but power consumption increased?
  2007-04-07 23:38 ` Andi Kleen
@ 2007-04-10  8:13   ` Len Brown
  2007-04-10 13:44     ` Andi Kleen
  0 siblings, 1 reply; 4+ messages in thread
From: Len Brown @ 2007-04-10  8:13 UTC (permalink / raw)
  To: Andi Kleen; +Cc: Andika Triwidada, linux-kernel, linux-acpi

On Saturday 07 April 2007 19:38, Andi Kleen wrote:
> "Andika Triwidada" <andika@gmail.com> writes:
> 
> [cc linux-acpi]
>  
> > Question: is that normal? I thought power consumption will be
> > automatically reduced if one core offlined.

Known?  Yes.
What people would expect? No.

http://bugzilla.kernel.org/show_bug.cgi?id=5471

> The current cpu offline essentially just runs a special idle loop.
> The standard idle loop is even a bit more aggressive on some systems
> because it knows about the deeper ACPI sleep modi.
> 
> There are also dependencies between cores because current CPUs
> have shared power planes between cores.
> 
> I suppose in the future when a whole socket goes off line one could
> implement special code to turn off the CPU further. But it likely
> won't work on older hardware.

Speaking for all Intel hardware implemented from pre-history until now,
deep C-states is the best you can do, and there is no special offline
mode to save more power.

If you really want to not use a core and the above bug isn't fixed in linux,
you can use maxcpus=1 to never bring the other core on-line in the first place,
and if the BIOS is implemented properly, the core will be spinning in the
deepest available C-state.  Of course, it would probably be more interesting
to simply leave the core on-line and let it go idle...

-Len

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: CPU offline but power consumption increased?
  2007-04-10  8:13   ` Len Brown
@ 2007-04-10 13:44     ` Andi Kleen
  0 siblings, 0 replies; 4+ messages in thread
From: Andi Kleen @ 2007-04-10 13:44 UTC (permalink / raw)
  To: Len Brown; +Cc: Andi Kleen, Andika Triwidada, linux-kernel, linux-acpi

> Speaking for all Intel hardware implemented from pre-history until now,
> deep C-states is the best you can do, and there is no special offline
> mode to save more power.

We don't use deep c states currently; just HLT.

Right now it doesn't make much difference because no multi socket
servers do deep C states and secondary cores can normally not go
deep on their own; but if any of this changes this code would
need to be fixed.

But cpu off line is really a special case -- maybe it is even 
possible to do something better on current hardware.

> and if the BIOS is implemented properly, the core will be spinning in the
> deepest available C-state.  Of course, it would probably be more interesting
> to simply leave the core on-line and let it go idle...

I don't see any BIOS call in play_dead()

-Andi


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-04-10 13:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-07  4:23 CPU offline but power consumption increased? Andika Triwidada
2007-04-07 23:38 ` Andi Kleen
2007-04-10  8:13   ` Len Brown
2007-04-10 13:44     ` Andi Kleen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox