Vsphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget*/translations/zh_CN/power/pm_qos_interfacemodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget*/translations/zh_TW/power/pm_qos_interfacemodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget*/translations/it_IT/power/pm_qos_interfacemodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget*/translations/ja_JP/power/pm_qos_interfacemodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget*/translations/ko_KR/power/pm_qos_interfacemodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget*/translations/sp_SP/power/pm_qos_interfacemodnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhsection)}(hhh](htitle)}(hPM Quality Of Service Interfaceh]hPM Quality Of Service Interface}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhD/var/lib/git/docbuild/linux/Documentation/power/pm_qos_interface.rsthKubh paragraph)}(hThis interface provides a kernel and user mode interface for registering performance expectations by drivers, subsystems and user space applications on one of the parameters.h]hThis interface provides a kernel and user mode interface for registering performance expectations by drivers, subsystems and user space applications on one of the parameters.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubhdefinition_list)}(hhh]hdefinition_list_item)}(hTwo different PM QoS frameworks are available: * CPU latency QoS. * The per-device PM QoS framework provides the API to manage the per-device latency constraints and PM QoS flags. h](hterm)}(h.Two different PM QoS frameworks are available:h]h.Two different PM QoS frameworks are available:}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK hhubh definition)}(hhh]h bullet_list)}(hhh](h list_item)}(hCPU latency QoS.h]h)}(hhh]hCPU latency QoS.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK hhubah}(h]h ]h"]h$]h&]uh1hhhubh)}(hpThe per-device PM QoS framework provides the API to manage the per-device latency constraints and PM QoS flags. h]h)}(hoThe per-device PM QoS framework provides the API to manage the per-device latency constraints and PM QoS flags.h]hoThe per-device PM QoS framework provides the API to manage the per-device latency constraints and PM QoS flags.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK hjubah}(h]h ]h"]h$]h&]uh1hhhubeh}(h]h ]h"]h$]h&]bullet*uh1hhhhK hhubah}(h]h ]h"]h$]h&]uh1hhhubeh}(h]h ]h"]h$]h&]uh1hhhhK hhubah}(h]h ]h"]h$]h&]uh1hhhhhhNhNubh)}(hHThe latency unit used in the PM QoS framework is the microsecond (usec).h]hHThe latency unit used in the PM QoS framework is the microsecond (usec).}(hj7hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hhh](h)}(h1. PM QoS frameworkh]h1. PM QoS framework}(hjHhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjEhhhhhKubh)}(hXAA global list of CPU latency QoS requests is maintained along with an aggregated (effective) target value. The aggregated target value is updated with changes to the request list or elements of the list. For CPU latency QoS, the aggregated target value is simply the min of the request values held in the list elements.h]hXAA global list of CPU latency QoS requests is maintained along with an aggregated (effective) target value. The aggregated target value is updated with changes to the request list or elements of the list. For CPU latency QoS, the aggregated target value is simply the min of the request values held in the list elements.}(hjVhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjEhhubh)}(hNote: the aggregated target value is implemented as an atomic variable so that reading the aggregated value does not require any locking mechanism.h]hNote: the aggregated target value is implemented as an atomic variable so that reading the aggregated value does not require any locking mechanism.}(hjdhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjEhhubh)}(h6From kernel space the use of this interface is simple:h]h6From kernel space the use of this interface is simple:}(hjrhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjEhhubh)}(hhh](h)}(hXnvoid cpu_latency_qos_add_request(handle, target_value): Will insert an element into the CPU latency QoS list with the target value. Upon change to this list the new target is recomputed and any registered notifiers are called only if the target value is now different. Clients of PM QoS need to save the returned handle for future use in other PM QoS API functions. h](h)}(h7void cpu_latency_qos_add_request(handle, target_value):h]h7void cpu_latency_qos_add_request(handle, target_value):}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK$hjubh)}(hhh]h)}(hX5Will insert an element into the CPU latency QoS list with the target value. Upon change to this list the new target is recomputed and any registered notifiers are called only if the target value is now different. Clients of PM QoS need to save the returned handle for future use in other PM QoS API functions.h]hX5Will insert an element into the CPU latency QoS list with the target value. Upon change to this list the new target is recomputed and any registered notifiers are called only if the target value is now different. Clients of PM QoS need to save the returned handle for future use in other PM QoS API functions.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK hjubah}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]uh1hhhhK$hjubh)}(hvoid cpu_latency_qos_update_request(handle, new_target_value): Will update the list element pointed to by the handle with the new target value and recompute the new aggregated target, calling the notification tree if the target is changed. h](h)}(h>void cpu_latency_qos_update_request(handle, new_target_value):h]h>void cpu_latency_qos_update_request(handle, new_target_value):}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK)hjubh)}(hhh]h)}(hWill update the list element pointed to by the handle with the new target value and recompute the new aggregated target, calling the notification tree if the target is changed.h]hWill update the list element pointed to by the handle with the new target value and recompute the new aggregated target, calling the notification tree if the target is changed.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK'hjubah}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]uh1hhhhK)hjhhubh)}(hvoid cpu_latency_qos_remove_request(handle): Will remove the element. After removal it will update the aggregate target and call the notification tree if the target was changed as a result of removing the request. h](h)}(h,void cpu_latency_qos_remove_request(handle):h]h,void cpu_latency_qos_remove_request(handle):}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK.hjubh)}(hhh]h)}(hWill remove the element. After removal it will update the aggregate target and call the notification tree if the target was changed as a result of removing the request.h]hWill remove the element. After removal it will update the aggregate target and call the notification tree if the target was changed as a result of removing the request.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK,hjubah}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]uh1hhhhK.hjhhubh)}(hSint cpu_latency_qos_limit(): Returns the aggregated value for the CPU latency QoS. h](h)}(hint cpu_latency_qos_limit():h]hint cpu_latency_qos_limit():}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK1hjubh)}(hhh]h)}(h5Returns the aggregated value for the CPU latency QoS.h]h5Returns the aggregated value for the CPU latency QoS.}(hj%hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK1hj"ubah}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]uh1hhhhK1hjhhubh)}(hint cpu_latency_qos_request_active(handle): Returns if the request is still active, i.e. it has not been removed from the CPU latency QoS list. h](h)}(h+int cpu_latency_qos_request_active(handle):h]h+int cpu_latency_qos_request_active(handle):}(hjChhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK6hj?ubh)}(hhh]h)}(hcReturns if the request is still active, i.e. it has not been removed from the CPU latency QoS list.h]hcReturns if the request is still active, i.e. it has not been removed from the CPU latency QoS list.}(hjThhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK4hjQubah}(h]h ]h"]h$]h&]uh1hhj?ubeh}(h]h ]h"]h$]h&]uh1hhhhK6hjhhubeh}(h]h ]h"]h$]h&]uh1hhjEhhhhhNubh)}(hFrom user space:h]hFrom user space:}(hjthhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK8hjEhhubh)}(hZThe infrastructure exposes one device node, /dev/cpu_dma_latency, for the CPU latency QoS.h]hZThe infrastructure exposes one device node, /dev/cpu_dma_latency, for the CPU latency QoS.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK:hjEhhubh)}(hOnly processes can register a PM QoS request. To provide for automatic cleanup of a process, the interface requires the process to register its parameter requests as follows.h]hOnly processes can register a PM QoS request. To provide for automatic cleanup of a process, the interface requires the process to register its parameter requests as follows.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK=hjEhhubh)}(hjTo register the default PM QoS target for the CPU latency QoS, the process must open /dev/cpu_dma_latency.h]hjTo register the default PM QoS target for the CPU latency QoS, the process must open /dev/cpu_dma_latency.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKAhjEhhubh)}(h_As long as the device node is held open that process has a registered request on the parameter.h]h_As long as the device node is held open that process has a registered request on the parameter.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKDhjEhhubh)}(hX To change the requested target value, the process needs to write an s32 value to the open device node. Alternatively, it can write a hex string for the value using the 10 char long format e.g. "0x12345678". This translates to a cpu_latency_qos_update_request() call.h]hXTo change the requested target value, the process needs to write an s32 value to the open device node. Alternatively, it can write a hex string for the value using the 10 char long format e.g. “0x12345678”. This translates to a cpu_latency_qos_update_request() call.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKGhjEhhubh)}(hPTo remove the user mode request for a target value simply close the device node.h]hPTo remove the user mode request for a target value simply close the device node.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKLhjEhhubeh}(h]pm-qos-frameworkah ]h"]1. pm qos frameworkah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(h02. PM QoS per-device latency and flags frameworkh]h02. PM QoS per-device latency and flags framework}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKQubh)}(hX$For each device, there are three lists of PM QoS requests. Two of them are maintained along with the aggregated targets of resume latency and active state latency tolerance (in microseconds) and the third one is for PM QoS flags. Values are updated in response to changes of the request list.h]hX$For each device, there are three lists of PM QoS requests. Two of them are maintained along with the aggregated targets of resume latency and active state latency tolerance (in microseconds) and the third one is for PM QoS flags. Values are updated in response to changes of the request list.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKShjhhubh)}(hX8The target values of resume latency and active state latency tolerance are simply the minimum of the request values held in the parameter list elements. The PM QoS flags aggregate value is a gather (bitwise OR) of all list elements' values. One device PM QoS flag is defined currently: PM_QOS_FLAG_NO_POWER_OFF.h]hX:The target values of resume latency and active state latency tolerance are simply the minimum of the request values held in the parameter list elements. The PM QoS flags aggregate value is a gather (bitwise OR) of all list elements’ values. One device PM QoS flag is defined currently: PM_QOS_FLAG_NO_POWER_OFF.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKXhjhhubh)}(hNote: The aggregated target values are implemented in such a way that reading the aggregated value does not require any locking mechanism.h]hNote: The aggregated target values are implemented in such a way that reading the aggregated value does not require any locking mechanism.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK]hjhhubh)}(h