Root/Documentation/power/pm_qos_interface.txt

1PM Quality Of Service Interface.
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
10Each parameters have defined units:
11 * latency: usec
12 * timeout: usec
13 * throughput: kbs (kilo bit / sec)
14
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
21For each parameter a list of performance requests is maintained along with
22an aggregated target value. The aggregated target value is updated with
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
25in the parameter list elements.
26
27From kernel mode the use of this interface is simple:
28
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.
34
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.
44
45
46From user mode:
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:
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
55request on the parameter.
56
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.
61
62To remove the user mode request for a target value simply close the device
63node.
64
65
66
67

Archive Download this file



interactive