aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVenkatesh Pallipadi <venkatesh.pallipadi@intel.com>2008-02-14 00:16:13 -0500
committerLen Brown <len.brown@intel.com>2008-02-14 00:16:13 -0500
commitfe8e288a63f2f3c51c288500282d0eb5cd26a534 (patch)
treef2d0178448df4367ce3692e4b0a4ebb3f7dcbd4e
parent4fcb2fcd4d0678b8ae103d257dcb28074cbfc7fa (diff)
cpuidle: Add Documentation
Documentation for cpuidle infrastructure. (resend) Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> Reviewed-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Len Brown <len.brown@intel.com>
-rw-r--r--Documentation/00-INDEX2
-rw-r--r--Documentation/cpuidle/core.txt23
-rw-r--r--Documentation/cpuidle/driver.txt31
-rw-r--r--Documentation/cpuidle/governor.txt29
-rw-r--r--Documentation/cpuidle/sysfs.txt79
5 files changed, 164 insertions, 0 deletions
diff --git a/Documentation/00-INDEX b/Documentation/00-INDEX
index 8d556707bb68..30b327a116ea 100644
--- a/Documentation/00-INDEX
+++ b/Documentation/00-INDEX
@@ -109,6 +109,8 @@ cpu-hotplug.txt
109 - document describing CPU hotplug support in the Linux kernel. 109 - document describing CPU hotplug support in the Linux kernel.
110cpu-load.txt 110cpu-load.txt
111 - document describing how CPU load statistics are collected. 111 - document describing how CPU load statistics are collected.
112cpuidle/
113 - info on CPU_IDLE, CPU idle state management subsystem.
112cpusets.txt 114cpusets.txt
113 - documents the cpusets feature; assign CPUs and Mem to a set of tasks. 115 - documents the cpusets feature; assign CPUs and Mem to a set of tasks.
114cputopology.txt 116cputopology.txt
diff --git a/Documentation/cpuidle/core.txt b/Documentation/cpuidle/core.txt
new file mode 100644
index 000000000000..63ecc5dc9d8a
--- /dev/null
+++ b/Documentation/cpuidle/core.txt
@@ -0,0 +1,23 @@
1
2 Supporting multiple CPU idle levels in kernel
3
4 cpuidle
5
6General Information:
7
8Various CPUs today support multiple idle levels that are differentiated
9by varying exit latencies and power consumption during idle.
10cpuidle is a generic in-kernel infrastructure that separates
11idle policy (governor) from idle mechanism (driver) and provides a
12standardized infrastructure to support independent development of
13governors and drivers.
14
15cpuidle resides under drivers/cpuidle.
16
17Boot options:
18"cpuidle_sysfs_switch"
19enables current_governor interface in /sys/devices/system/cpu/cpuidle/,
20which can be used to switch governors at run time. This boot option
21is meant for developer testing only. In normal usage, kernel picks the
22best governor based on governor ratings.
23SEE ALSO: sysfs.txt in this directory.
diff --git a/Documentation/cpuidle/driver.txt b/Documentation/cpuidle/driver.txt
new file mode 100644
index 000000000000..7a9e09ece931
--- /dev/null
+++ b/Documentation/cpuidle/driver.txt
@@ -0,0 +1,31 @@
1
2
3 Supporting multiple CPU idle levels in kernel
4
5 cpuidle drivers
6
7
8
9
10cpuidle driver hooks into the cpuidle infrastructure and handles the
11architecture/platform dependent part of CPU idle states. Driver
12provides the platform idle state detection capability and also
13has mechanisms in place to support actual entry-exit into CPU idle states.
14
15cpuidle driver initializes the cpuidle_device structure for each CPU device
16and registers with cpuidle using cpuidle_register_device.
17
18It can also support the dynamic changes (like battery <-> AC), by using
19cpuidle_pause_and_lock, cpuidle_disable_device and cpuidle_enable_device,
20cpuidle_resume_and_unlock.
21
22Interfaces:
23extern int cpuidle_register_driver(struct cpuidle_driver *drv);
24extern void cpuidle_unregister_driver(struct cpuidle_driver *drv);
25extern int cpuidle_register_device(struct cpuidle_device *dev);
26extern void cpuidle_unregister_device(struct cpuidle_device *dev);
27
28extern void cpuidle_pause_and_lock(void);
29extern void cpuidle_resume_and_unlock(void);
30extern int cpuidle_enable_device(struct cpuidle_device *dev);
31extern void cpuidle_disable_device(struct cpuidle_device *dev);
diff --git a/Documentation/cpuidle/governor.txt b/Documentation/cpuidle/governor.txt
new file mode 100644
index 000000000000..12c6bd50c9f6
--- /dev/null
+++ b/Documentation/cpuidle/governor.txt
@@ -0,0 +1,29 @@
1
2
3
4 Supporting multiple CPU idle levels in kernel
5
6 cpuidle governors
7
8
9
10
11cpuidle governor is policy routine that decides what idle state to enter at
12any given time. cpuidle core uses different callbacks to the governor.
13
14* enable() to enable governor for a particular device
15* disable() to disable governor for a particular device
16* select() to select an idle state to enter
17* reflect() called after returning from the idle state, which can be used
18 by the governor for some record keeping.
19
20More than one governor can be registered at the same time and
21users can switch between drivers using /sysfs interface (when enabled).
22More than one governor part is supported for developers to easily experiment
23with different governors. By default, most optimal governor based on your
24kernel configuration and platform will be selected by cpuidle.
25
26Interfaces:
27extern int cpuidle_register_governor(struct cpuidle_governor *gov);
28extern void cpuidle_unregister_governor(struct cpuidle_governor *gov);
29struct cpuidle_governor
diff --git a/Documentation/cpuidle/sysfs.txt b/Documentation/cpuidle/sysfs.txt
new file mode 100644
index 000000000000..50d7b1642759
--- /dev/null
+++ b/Documentation/cpuidle/sysfs.txt
@@ -0,0 +1,79 @@
1
2
3 Supporting multiple CPU idle levels in kernel
4
5 cpuidle sysfs
6
7System global cpuidle related information and tunables are under
8/sys/devices/system/cpu/cpuidle
9
10The current interfaces in this directory has self-explanatory names:
11* current_driver
12* current_governor_ro
13
14With cpuidle_sysfs_switch boot option (meant for developer testing)
15following objects are visible instead.
16* current_driver
17* available_governors
18* current_governor
19In this case users can switch the governor at run time by writing
20to current_governor.
21
22
23Per logical CPU specific cpuidle information are under
24/sys/devices/system/cpu/cpuX/cpuidle
25for each online cpu X
26
27--------------------------------------------------------------------------------
28# ls -lR /sys/devices/system/cpu/cpu0/cpuidle/
29/sys/devices/system/cpu/cpu0/cpuidle/:
30total 0
31drwxr-xr-x 2 root root 0 Feb 8 10:42 state0
32drwxr-xr-x 2 root root 0 Feb 8 10:42 state1
33drwxr-xr-x 2 root root 0 Feb 8 10:42 state2
34drwxr-xr-x 2 root root 0 Feb 8 10:42 state3
35
36/sys/devices/system/cpu/cpu0/cpuidle/state0:
37total 0
38-r--r--r-- 1 root root 4096 Feb 8 10:42 desc
39-r--r--r-- 1 root root 4096 Feb 8 10:42 latency
40-r--r--r-- 1 root root 4096 Feb 8 10:42 name
41-r--r--r-- 1 root root 4096 Feb 8 10:42 power
42-r--r--r-- 1 root root 4096 Feb 8 10:42 time
43-r--r--r-- 1 root root 4096 Feb 8 10:42 usage
44
45/sys/devices/system/cpu/cpu0/cpuidle/state1:
46total 0
47-r--r--r-- 1 root root 4096 Feb 8 10:42 desc
48-r--r--r-- 1 root root 4096 Feb 8 10:42 latency
49-r--r--r-- 1 root root 4096 Feb 8 10:42 name
50-r--r--r-- 1 root root 4096 Feb 8 10:42 power
51-r--r--r-- 1 root root 4096 Feb 8 10:42 time
52-r--r--r-- 1 root root 4096 Feb 8 10:42 usage
53
54/sys/devices/system/cpu/cpu0/cpuidle/state2:
55total 0
56-r--r--r-- 1 root root 4096 Feb 8 10:42 desc
57-r--r--r-- 1 root root 4096 Feb 8 10:42 latency
58-r--r--r-- 1 root root 4096 Feb 8 10:42 name
59-r--r--r-- 1 root root 4096 Feb 8 10:42 power
60-r--r--r-- 1 root root 4096 Feb 8 10:42 time
61-r--r--r-- 1 root root 4096 Feb 8 10:42 usage
62
63/sys/devices/system/cpu/cpu0/cpuidle/state3:
64total 0
65-r--r--r-- 1 root root 4096 Feb 8 10:42 desc
66-r--r--r-- 1 root root 4096 Feb 8 10:42 latency
67-r--r--r-- 1 root root 4096 Feb 8 10:42 name
68-r--r--r-- 1 root root 4096 Feb 8 10:42 power
69-r--r--r-- 1 root root 4096 Feb 8 10:42 time
70-r--r--r-- 1 root root 4096 Feb 8 10:42 usage
71--------------------------------------------------------------------------------
72
73
74* desc : Small description about the idle state (string)
75* latency : Latency to exit out of this idle state (in microseconds)
76* name : Name of the idle state (string)
77* power : Power consumed while in this idle state (in milliwatts)
78* time : Total time spent in this idle state (in microseconds)
79* usage : Number of times this state was entered (count)