cpuidle take2: Core cpuidle infrastructure
Subsystems (2)
PATCH 1/3 cpuidle take2: Core cpuidle infrastructure
Announcing 'cpuidle', a new CPU power management infrastructure to manage idle CPUs in a clean and efficient manner.
cpuidle separates out the drivers that can provide support for multiple types of idle states and policy governors that decide on what idle state to use at run time.
A cpuidle driver can support multiple idle states based on parameters like varying power consumption, wakeup latency, etc (ACPI C-states for example). A cpuidle governor can be usage model specific (laptop, server, laptop on battery etc).
Main advantage of the infrastructure being, it allows independent development of drivers and governors and allows for better CPU power management.
A huge thanks to Adam Belay and Shaohua Li who were part of this mini-project since its beginning and are greatly responsible for this patchset.
This patch:
Core cpuidle infrastructure.
Introduces a new abstraction layer for cpuidle:
* which manages drivers that can support multiple idles states. Drivers can be generic or particular to specific hardware/platform
* allows pluging in multiple policy governors that can take idle state policy decision
* The core also has a set of sysfs interfaces with which administrato can know about supported drivers and governors and switch them at run time.
---
Take 2 - Rebased with 2.6.21-rc1.
arch/i386/Kconfig +2 -0
@@ -1066,6 +1066,8 @@ endmenu source "arch/i386/kernel/cpu/cpufreq/Kconfig" +source "drivers/cpuidle/Kconfig" + endmenu menu "Bus options (PCI, PCMCIA, EISA, MCA, ISA)"
arch/x86_64/Kconfig +2 -0
@@ -670,6 +670,8 @@ source "drivers/acpi/Kconfig" source "arch/x86_64/kernel/cpufreq/Kconfig" +source "drivers/cpuidle/Kconfig" + endmenu menu "Bus options (PCI etc.)"
drivers/Makefile +1 -0
@@ -69,6 +69,7 @@ obj-$(CONFIG_EDAC) += edac/ obj-$(CONFIG_MCA) += mca/ obj-$(CONFIG_EISA) += eisa/ obj-$(CONFIG_CPU_FREQ) += cpufreq/ +obj-$(CONFIG_CPU_IDLE) += cpuidle/ obj-$(CONFIG_MMC) += mmc/ obj-$(CONFIG_NEW_LEDS) += leds/ obj-$(CONFIG_INFINIBAND) += infiniband/
drivers/cpuidle/cpuidle.c new file +287 -0
287 lines not on this page · raw message
drivers/cpuidle/cpuidle.h new file +52 -0
52 lines not on this page · raw message
drivers/cpuidle/driver.c new file +219 -0
219 lines not on this page · raw message
drivers/cpuidle/governor.c new file +160 -0
160 lines not on this page · raw message
drivers/cpuidle/governors/ladder.c new file +229 -0
229 lines not on this page · raw message
drivers/cpuidle/governors/Makefile new file +5 -0
@@ -0,0 +1,5 @@ +# +# Makefile for cpuidle governors. +# + +obj-$(CONFIG_CPU_IDLE_GOV_LADDER) += ladder.o
drivers/cpuidle/Kconfig new file +28 -0
@@ -0,0 +1,28 @@ +menu "CPU idle PM support" + +config CPU_IDLE + bool "CPU idle PM support" + help + CPU idle is a generic framework for supporting software-controlled + idle processor power management. It includes modular cross-platform + governors that can be swapped during runtime. + + If you're using a mobile platform that supports CPU idle PM (e.g. + an ACPI-capable notebook), you should say Y here. + +if CPU_IDLE + +comment "Governors" + +config CPU_IDLE_GOV_LADDER + tristate "'ladder' governor" + depends on CPU_IDLE + default y + help + This cpuidle governor promotes and demotes through the supported idle + states using residency time and bus master activity as metrics. This + algorithm was originally introduced in the old ACPI processor driver. + +endif # CPU_IDLE + +endmenu
drivers/cpuidle/Makefile new file +5 -0
@@ -0,0 +1,5 @@ +# +# Makefile for cpuidle. +# + +obj-y += cpuidle.o driver.o governor.o sysfs.o governors/
drivers/cpuidle/sysfs.c new file +340 -0
340 lines not on this page · raw message
include/linux/cpuidle.h new file +160 -0
160 lines not on this page · raw message
Quoted 11 lines · Venkatesh Pallipadi
Announcing 'cpuidle', a new CPU power management infrastructure to manage idle CPUs in a clean and efficient manner.
cpuidle separates out the drivers that can provide support for multiple types of idle states and policy governors that decide on what idle state to use at run time.
A cpuidle driver can support multiple idle states based on parameters like varying power consumption, wakeup latency, etc (ACPI C-states for example). A cpuidle governor can be usage model specific (laptop, server, laptop on battery etc).
Main advantage of the infrastructure being, it allows independent development of drivers and governors and allows for better CPU power management.
I played with this a little, and got puzzled.
My quad core box used exactly the same amount of power whether the 'ladder' governer was loaded & in use or not. In both situations it was exactly the same as a vanilla 2.6.20
I'd have expected it to use more until I loaded up 'ladder' to bring it on par featurewise with 2.6.20. What did I miss?
Dave
Signature · 1 line
http://www.codemonkey.org.uk
Quoted 30 lines
-----Original Message-----
From: Dave Jones [mailto:[email protected]]
Sent: Tuesday, February 27, 2007 8:44 AM
To: Pallipadi, Venkatesh
Cc: linux-kernel; Andrew Morton; [email protected]; Adam Belay; Li, Shaohua; Brown, Len
Subject: Re: [PATCH 1/3]cpuidle take2: Core cpuidle infrastructureQuoted 1 line · Venkatesh Pallipadi
Announcing 'cpuidle', a new CPU power management
infrastructure to manage
Quoted 2 lines
idle CPUs in a clean and efficient manner. cpuidle separates out the drivers that can provide support
for multiple types
Quoted 1 line
of idle states and policy governors that decide on what
idle state to use
Quoted 2 lines
at run time.
A cpuidle driver can support multiple idle states based onparameters like
Quoted 1 line
varying power consumption, wakeup latency, etc (ACPI
C-states for example).
Quoted 3 lines
A cpuidle governor can be usage model specific (laptop, server, laptop on battery etc).
Main advantage of the infrastructure being, it allowsindependent development
Quoted 1 line
of drivers and governors and allows for better CPU power management.
Quoted 8 lines
I played with this a little, and got puzzled.
My quad core box used exactly the same amount of power whether the 'ladder' governer was loaded & in use or not. In both situations it was exactly the same as a vanilla 2.6.20I'd have expected it to use more until I loaded up 'ladder' to bring it on par featurewise with 2.6.20. What did I miss?
Quad core what platform? How many C-states are supported in this platform?
Current ladder is mostly like Policy embedded in ACPI today. But, Adam has
been working on different policies that we want to experiment with as we go along.
Thanks,
Venki
Quoted 9 lines · Venkatesh
Quoted 7 lines
I played with this a little, and got puzzled.
My quad core box used exactly the same amount of power whether the 'ladder' governer was loaded & in use or not. In both situations it was exactly the same as a vanilla 2.6.20I'd have expected it to use more until I loaded up 'ladder' to bring it on par featurewise with 2.6.20. What did I miss?
Quad core what platform?
Glenwood
Quoted 1 line
How many C-states are supported in this platform?
Garg, only C1. That explains a lot.
Quoted 4 lines
Current ladder is mostly like Policy embedded in ACPI today. But, Adam has
been working on different policies that we want to experiment with as we go along.
ok.
Dave
Signature · 1 line
http://www.codemonkey.org.uk