]> bbs.cooldavid.org Git - net-next-2.6.git/blame - Documentation/power/pm_qos_interface.txt
ipv6: AF_INET6 link address family
[net-next-2.6.git] / Documentation / power / pm_qos_interface.txt
CommitLineData
bf1db69f 1PM Quality Of Service Interface.
d82b3518
MG
2
3This interface provides a kernel and user mode interface for registering
4performance expectations by drivers, subsystems and user space applications on
5one of the parameters.
6
7Currently we have {cpu_dma_latency, network_latency, network_throughput} as the
8initial set of pm_qos parameters.
9
bf1db69f
RH
10Each parameters have defined units:
11 * latency: usec
12 * timeout: usec
13 * throughput: kbs (kilo bit / sec)
14
d82b3518
MG
15The infrastructure exposes multiple misc device nodes one per implemented
16parameter. The set of parameters implement is defined by pm_qos_power_init()
17and pm_qos_params.h. This is done because having the available parameters
18being runtime configurable or changeable from a driver was seen as too easy to
19abuse.
20
ed77134b 21For each parameter a list of performance requests is maintained along with
d82b3518 22an aggregated target value. The aggregated target value is updated with
ed77134b
MG
23changes to the request list or elements of the list. Typically the
24aggregated target value is simply the max or min of the request values held
d82b3518
MG
25in the parameter list elements.
26
27From kernel mode the use of this interface is simple:
d82b3518 28
ed77134b
MG
29handle = pm_qos_add_request(param_class, target_value):
30Will insert an element into the list for that identified PM_QOS class with the
31target value. Upon change to this list the new target is recomputed and any
32registered notifiers are called only if the target value is now different.
33Clients of pm_qos need to save the returned handle.
d82b3518 34
ed77134b
MG
35void pm_qos_update_request(handle, new_target_value):
36Will update the list element pointed to by the handle with the new target value
37and recompute the new aggregated target, calling the notification tree if the
38target is changed.
39
40void pm_qos_remove_request(handle):
41Will remove the element. After removal it will update the aggregate target and
42call the notification tree if the target was changed as a result of removing
43the request.
d82b3518
MG
44
45
46From user mode:
ed77134b
MG
47Only processes can register a pm_qos request. To provide for automatic
48cleanup of a process, the interface requires the process to register its
49parameter requests in the following way:
d82b3518
MG
50
51To register the default pm_qos target for the specific parameter, the process
52must open one of /dev/[cpu_dma_latency, network_latency, network_throughput]
53
54As long as the device node is held open that process has a registered
ed77134b 55request on the parameter.
d82b3518 56
ed77134b
MG
57To change the requested target value the process needs to write an s32 value to
58the open device node. Alternatively the user mode program could write a hex
59string for the value using 10 char long format e.g. "0x12345678". This
60translates to a pm_qos_update_request call.
d82b3518
MG
61
62To remove the user mode request for a target value simply close the device
63node.
64
65
66