This disclosure relates generally to data processing devices and, more particularly, to user space based performance state switching of a processor of a data processing device.
A data processing device (e.g., a desktop computer, a laptop computer, a notebook computer, a server, a mobile device) may include a processor communicatively coupled to a memory. The processor may execute a number of application programs thereon. The utilization of the processor due to the aforementioned execution may be monitored through executing, for example, test instructions thereon, based on which a current performance state of the processor may be transitioned to a lower or a higher power state thereof. However, in order to ensure continued presence of the processor in a current state of utilization, the test instructions related to the transitioning may not be executed for a period of time (e.g., 30 seconds). The aforementioned period of time may contribute to a latency associated with the performance state switching.
Disclosed are a method, a device and/or a system of user space based performance state switching of a processor of a data processing device.
In one aspect, a method includes capturing an interaction of a user of a data processing device therewith at a level of a user space through a process executing on the data processing device. The user space is associated with locations of a memory of the data processing device in which non-core processes are configured to execute on the data processing device. The user space is distinct from a kernel space. The kernel space is associated with locations of the memory in which a kernel of an operating system is configured to reside and execute on the data processing device. The method also includes communicating, through the execution of the process, the captured user interaction as an event from the user space to the kernel space, and incorporating, through the kernel space, the communicated event as a feedback to an algorithm executing on a processor of the data processing device communicatively coupled to the memory.
The algorithm is configured to modify a current performance state of the processor based on threshold levels of utilization of the processor. Further, the method includes automatically switching, based on the execution of the algorithm, the current performance state of the processor to a higher power state or a lower power state thereof additionally in accordance with the communicated event.
In another aspect, a non-transitory medium, readable through a data processing device and including instructions embodied therein that are executable through the data processing device, is disclosed. The non-transitory medium includes instructions to capture an interaction of a user of the data processing device therewith at a level of a user space through a process executing on the data processing device. The user space is associated with locations of a memory of the data processing device in which non-core processes are configured to execute on the data processing device. The user space is distinct from a kernel space. The kernel space is associated with locations of the memory in which a kernel of an operating system is configured to reside and execute on the data processing device. The non-transitory medium also includes instructions to communicate, through the execution of the process, the captured user interaction as an event from the user space to the kernel space, and instructions to incorporate, through the kernel space, the communicated event as a feedback to an algorithm executing on a processor of the data processing device communicatively coupled to the memory.
The algorithm is configured to modify a current performance state of the processor based on threshold levels of utilization of the processor. Further, the non-transitory medium includes instructions to automatically switch, based on the execution of the algorithm, the current performance state of the processor to a higher power state or a lower power state thereof additionally in accordance with the communicated event.
In yet another aspect, a data processing device includes a memory, and a processor communicatively coupled to the memory. The processor is configured to execute instructions to capture an interaction of a user of the data processing device therewith at a level of a user space through a process executing on the data processing device. The user space is associated with locations of the memory in which non-core processes are configured to execute on the data processing device. The user space is distinct from a kernel space. The kernel space is associated with locations of the memory in which a kernel of an operating system is configured to reside and execute on the data processing device. Through the execution of the process, the captured user interaction is communicated as an event from the user space to the kernel space.
Through the kernel space, the communicated event is incorporated as a feedback to an algorithm executing on the processor. The algorithm is configured to modify a current performance state of the processor based on threshold levels of utilization of the processor. Based on the execution of the algorithm, the current performance state of the processor is configured to be automatically switched to a higher power state or a lower power state thereof additionally in accordance with the communicated event.
The methods and systems disclosed herein may be implemented in any means for achieving various aspects, and may be executed in a form of a machine-readable medium embodying a set of instructions that, when executed by a machine, cause the machine to perform any of the operations disclosed herein. Other features will be apparent from the accompanying drawings and from the detailed description that follows.
The embodiments of this invention are illustrated by way of example and not limitation in the figures of the accompanying drawings, in which like references indicate similar elements and in which:
Other features of the present embodiments will be apparent from the accompanying drawings and from the detailed description that follows.
Example embodiments, as described below, may be used to provide a method, a device and/or a system of user space based performance state switching of a processor of a data processing device. Although the present embodiments have been described with reference to specific example embodiments, it will be evident that various modifications and changes may be made to these embodiments without departing from the broader spirit and scope of the various embodiments.
It is obvious that an operating system 110 may execute on data processing device 100.
In one or more embodiments, user-space component 202 may reside in a user space (e.g., associated with a user 150 of data processing device 100) of a system memory (e.g., memory 104) associated with operating system 110 and kernel-space component 204 may reside in a kernel space of the system memory. In one or more embodiments, the kernel space is associated with memory locations in which the kernel, or, the core of operating system 110, resides and executes; the kernel (not shown) may provide services therefrom. In one or more embodiments, the user space may be associated with memory locations in which non-core processes (e.g., application programs) execute. In one or more embodiments, a key responsibility of the kernel may be to prevent individual processes from interfering with one another.
In an example embodiment, performance of data processing device 100 may be indicated through power consumption and capability states of processor 102. The performance states may be represented as Px, where x=0 . . . N. In the P0 state, data processing device 100/processor 102 may be at a maximum performance capability thereof; the aforementioned state may also be associated with maximum power consumption. The P1 state may be associated with a lower performance and power consumption than the P0 state. In accordance with the hierarchy, the PN state may be associated with the lowest performance and the lowest power consumption. In one example implementation, there may be a maximum of 16 performance states; in other words, N=15.
Typically, performance state switching may be completely based on utilization of processor 102. Processor 102 may execute a number of engines 1401-M (e.g., video memory engine, display engine; engines 1401-M are shown as being stored in memory 104 to be executed on processor 102) thereon. Here, kernel-space component 204 may set up an idle counter (not shown) associated with each engine 1401-M to count clock cycles where the each engine 1401-M is not completely idle. Kernel-space component 204 may then poll the idle counters associated with the number of engines 1401-M to enable calculation of resource (e.g., processor 102, memory 104 including portion (e.g., frame buffer) thereof associated with video/display related processing) utilization associated with data processing device 100. An example of resource utilization may be indicated by instructions executed on processor 102 per clock cycle.
The idle counter mentioned above associated with the each engine 1401-M may be incremented with increasing number of clock cycles and a count value thereof read from a register (not shown) associated with processor 102. The performance monitoring may incorporate one or more threshold values associated with the resource (e.g., processor 102) utilization stored in memory 104. If the resource utilization determined is lesser than a lower bound to the one or more threshold values, kernel-space component 204 may trigger switching of a current performance state to a lower power state thereof. The level of switching may depend on the amount by which the resource utilization falls below the lower bound. In one example scenario, the performance state may be switched from P0 to P4 instead of P0 to P1.
If the resource utilization determined is higher than an upper bound to the one or more threshold values, kernel-space component 204 may trigger switching of the current performance state to a higher power state thereof. For example, the performance state may be switched from P5 to P1, P5 to P4, P7 to P4 etc.
The switching of performance states discussed above may completely rely on utilization of processor 102. The aforementioned process/processes may involve waiting for a period of time (e.g., 30 seconds) before triggering the switching of the performance states to ensure the continued existence of the resource (e.g., processor 102) in the current state of utilization thereof. As kernel-space component 204 (or, kernel-space driver stack) is “closer” to hardware than user 150 and is unaware of application programs executing in the user space, the waiting period of time may be required to ensure consistency of the utilization of processor 102 prior to the switching thereof.
In one or more embodiments, the activity of user 150 may be communicated to kernel-space component 204 in the form of events (e.g., through translatable escape calls, Input/Output (I/O) control calls).
For example, execution of several application programs 3041-P or a computationally intensive application program 3041-P may cause communication of one or more events 306 between user-space component 202 and kernel-space component 204. The incorporation of the one or more events 306 as a feedback into performance state switching algorithm 302 may cause kernel-space component 204 to interpret the one or more events 306 as processor 102 requiring increased power states for optimal execution of the several application programs 3041-P or the computationally intensive application program 3041-P thereon. Thus, kernel-space component 204 may trigger the switching of a current performance state of processor 102 to a higher power state thereof.
In one or more embodiments, kernel-space component 204 may include a process 310 associated therewith to enable capturing of activity of user 150 on data processing device 100. In one or more embodiments, process 310 may then enable communication of events 306 between user-space component 202 and kernel-space component 204. It should be noted that process 310 may be part of an application program 3041-P (or, user-space component 202) executing on data processing device 100 or separate therefrom.
Further, it should be noted that driver component 170 (e.g., kernel-space component 204) may also enable power gating one or more engine(s) 1401-M executing on processor 102 in conjunction with transitioning processor 102 to a lower power performance state thereof. In one alternate embodiment, the aforementioned power gating may be part of the transitioning of the current performance state of processor 102 to the lower power state thereof. Similarly, the transitioning of processor 102 to a higher power performance state thereof may involve restoring the power-gated one or more engine(s) 1401-M. Again, the aforementioned restoration may be part of the transitioning of the current performance state of processor 102 to the higher power state thereof.
Thus, in one or more embodiments, performance state switching decisions may be taken quicker through processor 102. In one or more embodiments, therefore, latency in the performance state switching may be reduced; consequently, a life of a battery (example power source) of data processing device 100 may be increased. It should be noted that user interactive scenarios may not be limited to those discussed above. Other user interactive scenarios incorporated into performance state switching algorithm 302 are within the scope of the exemplary embodiments discussed herein.
In one or more embodiments, operation 504 may involve communicating, through the execution of process 310, the captured user interaction as an event (e.g., event 306) from the user space to the kernel space. In one or more embodiments, operation 506 may involve incorporating, through the kernel space, the communicated event as a feedback to an algorithm (e.g., performance state switching algorithm 302) executing on processor 102. In one or more embodiments, the algorithm may be configured to modify a current performance state of processor 102 based on threshold levels of utilization of processor 102.
In one or more embodiments, operation 508 may then involve automatically switching, based on the execution of the algorithm, the current performance state of processor 102 to a higher power state or a lower power state thereof additionally in accordance with the communicated event.
Although the present embodiments have been described with reference to specific example embodiments, it will be evident that various modifications and changes may be made to these embodiments without departing from the broader spirit and scope of the various embodiments. For example, the various devices and modules described herein may be enabled and operated using hardware circuitry, firmware, software or any combination of hardware, firmware, and software (e.g., embodied in a non-transitory machine-readable medium). For example, the various electrical structures and methods may be embodied using transistors, logic gates, and electrical circuits (e.g., Application Specific Integrated Circuitry (ASIC) and/or Digital Signal Processor (DSP) circuitry).
In addition, it will be appreciated that the various operations, processes, and methods disclosed herein may be embodied in a non-transitory machine-readable medium and/or a machine accessible medium compatible with a data processing system (e.g., data processing device 100), and may be performed in any order (e.g., including using means for achieving the various operations).
Accordingly, the specification and drawings are to be regarded in an illustrative rather than a restrictive sense.