Central processing units (“CPUs”) of portable computing devices (“PCDs”), like mobile phones and tablet portable computers (“PCs”), typically enter into a sleep state in order to conserve power. Power conservation is a major concern for PCDs since many PCDs receive power from one or more batteries. One problem that exists with conventional PCDs and their CPUs is that prior to entering into sleep state, a CPU usually must perform several different housekeeping tasks before a sleep state, also known as a lower power mode, can be entered/initiated.
These housekeeping tasks, often characterized as overhead, performed by the CPU may consume more precious power than the CPU is intending to conserve. For example, in situations where the CPU is trying to enter into a low power mode in which the CPU is merely halted instead of entering into a deep low power mode, it has been found that the CPU may consume more power to achieve this low power mode than may be necessary.
Specifically, problems have been encountered in PCDs during audio playback. While the CPU is waiting in an idle state for certain interrupts during audio playback, the CPU may consume more power than is necessary because the CPU may attempt to enter into a sleep state during this wait time. Another problem includes increasing the amount of time to download data when a CPU is in an idle state and is trying to either enter into a sleep state or halt its own processes. In some situations, if the CPU has entered into the sleep state, it takes a certain amount of time to exit that sleep state and for the CPU to become active and perform its requisite task(s) for receiving downloaded data.
The CPU typically enters into a single threaded mode so that it may, without interruption, assess what level of low power mode should be entered by the CPU. While in the single threaded mode, a CPU may check on the constraints of the entire PCD. Constraints may include any latency restrictions, detecting what low power modes are enabled, as well as detecting if any other low-power modes have been entered into by other hardware. If there were no constraints required by other elements of the PCD, the CPU would exit the single threaded mode and immediately halt the processor. However, this lengthy process of checking for system constraints and optimal conditions for entering a halt state and/or a deep lower power mode may consume more power than necessary which is a major concern of a PCD powered by batteries.
A method and system for tracking and selecting optimal power conserving modes of a portable computing device (“PCD”) includes detecting enablement or disablement of a reduced power mode and detecting one of a new and a change in a latency restriction. Next, a low power mode which has a minimum entry and exit latency may be identified. Then, it may be determined if a lowest latency restriction is less than the minimum entry and exit latency. After this determination, a function pointer may be adjusted based on the output of the determining step.
The function pointer may reference a halt state and a reduced power state for the PCD. The detection of the enablement or disablement of reduced power mode and the detection of one of a new and a change in a latency restriction may be performed in parallel. Then, a determination if conditions are favorable for at least one of an idle state and a reduced power mode of the PCD may be performed. If conditions are favorable for at least one of an idle state and a reduced power mode for the PCD, then a current state of the function pointer may be read and performed by a processor.
In the figures, like reference numerals refer to like parts throughout the various views unless otherwise indicated. For reference numerals with letter character designations such as “102A” or “102B”, the letter character designations may differentiate two like parts or elements present in the same figure. Letter character designations for reference numerals may be omitted when it is intended that a reference numeral to encompass all parts having the same reference numeral in all figures.
The word “exemplary” is used herein to mean “serving as an example, instance, or illustration.” Any aspect described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other aspects.
In this description, the term “application” may also include files having executable content, such as: object code, scripts, byte code, markup language files, and patches. In addition, an “application” referred to herein, may also include files that are not executable in nature, such as documents that may need to be opened or other data files that need to be accessed.
The term “content” may also include files having executable content, such as: object code, scripts, byte code, markup language files, and patches. In addition, “content” referred to herein, may also include files that are not executable in nature, such as documents that may need to be opened or other data files that need to be accessed.
As used in this description, the terms “component,” “database,” “module,” “system,” and the like are intended to refer to a computer-related entity, either hardware, firmware, a combination of hardware and software, software, or software in execution. For example, a component may be, but is not limited to being, a process running on a processor, a processor, an object, an executable, a thread of execution, a program, and/or a computer. By way of illustration, both an application running on a computing device and the computing device may be a component. One or more components may reside within a process and/or thread of execution, and a component may be localized on one computer and/or distributed between two or more computers. In addition, these components may execute from various computer readable media having various data structures stored thereon. The components may communicate by way of local and/or remote processes such as in accordance with a signal having one or more data packets (e.g., data from one component interacting with another component in a local system, distributed system, and/or across a network such as the Internet with other systems by way of the signal).
In this description, the terms “communication device,” “wireless device,” “wireless telephone,” “wireless communication device,” and “wireless handset” are used interchangeably. With the advent of third generation (“3G”) and fourth generation (“4G”) wireless technology, greater bandwidth availability has enabled more portable computing devices with a greater variety of wireless capabilities.
In this description, the term “portable computing device” (“PCD”) is used to describe any device operating on a limited capacity power supply, such as a battery. Although battery operated PCDs have been in use for decades, technological advances in rechargeable batteries coupled with the advent of third generation (“3G”) and fourth generation (“4G”) wireless technology, have enabled numerous PCDs with multiple capabilities. Therefore, a PCD may be a cellular telephone, a satellite telephone, a pager, a personal digital assistant (“PDA”), a smartphone, a navigation device, a smartbook or reader, a media player, a combination of the aforementioned devices, a tablet personal computer (“PC”), and a laptop computer with a wireless connection, among others.
The CPU 110A may comprise a zeroth core 222, a first core 224, etc., through an Nth core 226, as understood by one of ordinary skill in the art. In alternative embodiments, instead of CPU 110A and a graphics processor 110B, one or more digital signal processors (“DSPs”) may also be employed as understood by one of ordinary skill in the art. Further, in alternative embodiments, two or more multi-core processors may be included.
As illustrated in
A video port 138 is coupled to the video amplifier 136. As depicted in
As further illustrated in
Some of the above-described elements of the PCD 100 may comprise hardware, while others may comprise software, and still others may comprise a combination of hardware and software. The term “resource” is used herein to refer to any such element, whether hardware, software or a combination thereof, that is controllable by a processor. A resource may be defined in one aspect as an encapsulation of the functionality of such an element. Except where it may otherwise be indicated, the term “processor” or “master processor” is used herein to refer to a processor such as the CPU 110, graphics processor 110B, the analog signal processor 126, or to any other processor, controller or similar element that operates under the control of software, firmware, or similar control logic.
As described in further detail below, an example of a resource is a software element that executes on a processor. A thread of execution on a processor, such as, for example, a thread relating to an executing application program, may access a resource by causing a “request” to be issued on the resource. As described below, resource requests are processed through a software-based system referred to in this disclosure as a “framework.”
The term “client” is used broadly in this disclosure to refer to an element that effects the function of requesting a resource. Thus, as the terms are used herein, a thread may create or make use of a client for the purpose of issuing resource requests. It should be noted that, in some instances, a resource may create or use a client, such that a resource may cause a resource request to be issued against another resource. As described in further detail below, such other resource may be referred to herein as a “dependent” resource due to a dependency relationship between the requesting resource and requested resource. Resources and clients may be represented by data structures in memory.
Since resources are controlled by specific processors in a multi-processor PCD 100, not every processor in PCD 100 has access to every resource in PCD 100.
In an instance in which the first processor 202 is executing a thread 208 relating to, for example, a video player application program, the thread 208 may call for adjustment of one or more operating parameters of the first processor 202 that enhance the performance of the first processor 202. (Although thread 208 and the resource power manager 157 are conceptually illustrated as residing in their respective processors 202 and 206 for purposes of clarity, one of ordinary skill in the art understands that such elements are executed or otherwise operated upon by the processor in the processor's memory space in accordance with well understood computing principles.) Such operating parameters may include, for example, clock speed and bus speed.
For example, various processors may use the same bus clock, but only one of the processors may have direct (hardware-level) control of the bus clock. Increasing clock speed may result in better performance by, for example, a video player application program, since the playback of video is generally a more processing power-intensive task than some other tasks. As processing power is commonly expressed in millions of instructions per second (“MIPS”), the thread 208 may issue a call for a certain number of MIPS. The resource power manager 157 may include an algorithm that, in response to a request for a specified number of MIPS, causes changes in signals 210 that may represent clock speed, bus speed or other parameters that promote the first processor 202 operating at the requested MIPS level.
It may be possible for a thread to access the resource power manager 157 through an application program interface (API) specific to a bus or protocol through which the first processor 202 may communicate with the second processor 206. However, the framework described below may provide a more uniform way to handle resource requests than a resource-specific and bus-specific API. As described below, via the framework, resource requests are issued and serviced in a uniform manner without regard to whether the request is against a resource controlled by the same processor from which the resource request is issued or against a resource controlled by a different processor.
A resource controlled by the same processor from which the resource request is issued may be referred to as a “native” resource. A resource controlled by a processor other than that from which the resource request is issued may be referred to herein as a “remote resource” or “distributed resource.”
In addition, issuing a request against a remote resource incurs processing overhead in the form of a time delay or latency. That is, a certain amount of time is required for the message or messages relating to the resource request to be sent between processors. In some instances, a single resource request may result in multiple inter-processor messages.
The CPU 110A controls or has access to the above-referenced resources because the resources are within the memory space of the CPU 110A and no other restrictions, such as security restrictions, exist that would inhibit CPU 110A from accessing those resources. For example, CPU 110A may be capable of controlling or accessing hardware registers of those resources. It should be noted that PCD 100 may include other CPUs 110 (see, e.g.,
A framework manager 440, which may comprise a library of computer instructions, manages nodes that encapsulate functionality of the resources. That is, the nodes may be accessed to indirectly access the resources. For convenience, a node encapsulating the functionality of a resource may be referred to herein as including, comprising, having, etc., the resource. Each node may include one or more resources. The nodes may be defined in software code, firmware, or a similar medium, and instantiated as data structures in, for example, memory 112 (
The nodes 601 may be instantiated during a start-up, power-up, initialization, boot-up, etc., sequence, or at any other suitable time during operation of the PCD 100. It should be noted that a reference herein to instantiating, issuing a request on, or otherwise interacting with a resource should be understood as meaning interacting with a node that includes that resource. For the remainder of this disclosure, a generic or non-specific node will be designated with reference numeral 601 as described below with reference to
Nodes 601 may include, for example, a first node 602 having a single resource that generally corresponds with the first hardware element or central processing unit 110. With the software architecture described in this disclosure, each resource of a node 601 may be provided with a unique name comprising one or more alphanumeric characters. In the exemplary embodiment illustrated in
Nodes 601 may further include, for example, a second node 622 having a plurality of resources. In this exemplary embodiment, the second node 622 has a first resource comprising a single hardware element corresponding to the bus arbiter or scheduler 422. The second resource of the second node 622 comprises a software element generally corresponding to the first software element of the bus program A 444A. The third resource of the second node 622 comprises another software element generally corresponding to the second software element of the bus program B 444B. One of ordinary skill in the art recognizes that any combination and any number of resources and resource types for a given node 601 are well within the scope of this disclosure.
Other relationships displayed in
In
The framework manager 440 is responsible for maintaining the relationships described above, that include, but are not limited to, the client requests 675 and the dependencies 680 illustrated in
As described below in further detail, the framework manager 440 may instantiate a node 601 as soon as the node's dependent nodes are instantiated, i.e., when the dependencies 680 for any given node 601 have been resolved. The framework manager 440 attempts to instantiate all nodes 601 that have been defined in the software architecture of PCD 100. A dependency 680 is completed or resolved when a resource that supports a dependency is in existence or is in a ready state for handling information that relates to the dependency 680.
For example, the first node 602 comprising the single resource “/core/cpu” may not be instantiated by the framework manager 440 if the third node 642 comprising the single resource “/clk/cpu” has not been instantiated because of the dependency relationship 680A that exists between the first node 602 and the third node 642. Once the third node 642 has been instantiated by the framework manager 440, then the framework manager 440 may instantiate the second node 602 because of the dependency relationship 680A.
If the framework manager 440 is unable to instantiate a particular node 601 because one or more of its dependencies 680 are incomplete or unresolved, the framework manager 440 will continue running or executing steps corresponding to those nodes 601 that were instantiated successfully. The framework manger 440 will usually skip over a call for a particular node 601 that may not exist due to incomplete dependencies in which dependent resources have not been created, and return messages to that call which reflect that incomplete status.
In a multi-core environment, such as illustrated in
A remoting framework manager 300 that is similar to the above-described (main) framework manager 440 may exist in parallel with the framework manager 440. The remoting framework manager 300 cooperates with or works with the framework manager 440 to coordinate inter-processor information transfers between nodes 601 on different processors. That is, the remoting framework manager 300 helps framework manager 440 maintain the relationships described above, such as dependencies and client requests, in instances in which the nodes 601 that are involved exist on different processors.
Thus, nodes 601 on one processor may not rendered accessible to nodes 601 on another other processor via the combined effect of framework managers 440 and 300. Moreover, the combination of framework managers 440 and 300 may perform all of the functions ascribed in this disclosure to framework manager 440, whether the nodes 601 that are involved exist on the same processor different processors. In such a multi-processor embodiment, individual copies of the software that framework managers 300 and 440 comprise may reside in the domain of each of the processors. Thus, each processor has access to the same framework manager software.
The acyclic property of the graph is important to prevent deadlocks, since, as described below, each node 601 is locked (in a transaction processing sense) when it is accessed. If two nodes 601 were to depend on each other in an instance in which a first thread were to access and lock one of these two nodes 601 at the same time that a second thread were to access and lock the other of these two nodes 601, both threads would be hung.
However, in the relatively rare instances in which a software developer or other such person involved in defining the software architecture deems it desirable to define in the software architecture two resources that depend on each other, the two (or more) resources may be included in the same node 601 as each other. Two resources in the same node will share the same lock state. It is at least in part for this reason that a software developer or other such person may choose to define a plural-resource node such as node 622 in the architecture.
Although this disclosure may, for purposes of clarity and convenience, reference a “node” 601 rather than a “resource” of the node 601, it should be understood that client requests may be directed to specified resources rather than nodes. In other words, a node 601, which, as described above, may be a data structure encapsulating of the functionality of one or more resources, may be transparent from the perspective of a client or other issuer of a client request such as another node 601. From the perspective of a client, a request is issued against a resource rather than a node. Likewise, from the perspective of a client, a state query, event, or other element of the architecture is associated with a resource rather than a node.
A resource graph such as the exemplary graph 400 is useful for understanding the instantiation of nodes 601 in accordance with dependencies, described below with regard to
In a multi-processor PCD 100, a first processor may have access to or be capable of controlling a first set of nodes 601 in a first resource graph, while a second processor may have access to or be capable of controlling a second set of nodes 601 in a second resource graph, where the first and second resource graphs do not share any resources, i.e., they are mutually exclusive of resources. That is, in such an environment, each processor has its own resource graph that defines relationships among resources and other elements that are not accessible to other processors. The distributed resource management of the present disclosure relates to maintaining the relationships described above, such as dependencies and client requests, in instances in which two or more processors each have access to resources in their own resource graphs and do not have access to resources in other processors' resource graphs.
The above-referenced limitation upon access to resources may, in some embodiments, be limited by hardware configuration. That is, a processor may have no means by which it can affect a hardware device, such as a register, because the hardware device is controlled by or in the memory space of another processor. Alternatively, or in addition, the limitation upon access to resources may be imposed in software, for reasons such as minimizing exposure of a processor to security risks (e.g., a virus that may be infecting another processor).
For example, the first node 602 has a dependency arrow 680B to indicate that the first node 602 is dependent upon the three resources of the second node 622. Similarly, the third resource “/bus/ahb/sysB/” comprising the second software element 444B and generally designated with the reference letter “C” in
The node or resource graphs 500B of
Block 1005 is the first routine of the method or process 1000 for managing resources of a PCD 100. In block 1005, a routine may be executed or run by the framework manager 440 for receiving node structure data. The node structure data may comprise a dependency array that outlines the dependencies a particular node 601 may have with other nodes 601. Further details about node structure data and this routine or submethod 1005 will be described in more detail below in connection with
Next, in block 1010, the framework manager 440 may review the dependency data that is part of the node structure data received in block 1005. In decision block 1015, the framework manager 440 may determine if the node structure data defines a leaf node 601. A leaf node 601 generally means that the node to be created based on the node structure data does not have any dependencies, such as the nodes 642 and 646 in
If the inquiry to decision block 1015 is negative, then the “No” branch is followed to decision block 1020 in which the framework manager determines if all of the hard dependencies within the node structure data exist. A hard dependency may comprise one in which a resource cannot exist without it. Meanwhile, a soft dependency may comprise one in which a resource may use the dependent resource as an optional step. A soft dependency means that a node 601 or resource of the node 601 which has a soft dependency may be created or instantiated within the node architecture even when the soft dependency does not exist.
An example of a soft dependency may comprise an optimization feature that is not critical to the operation for a resource oriented node 601 containing multiple resources. The framework manager 440 may create or instantiate a node or a resource for all hard dependencies that are present even when a soft is dependency is not present for those nodes or resources which have soft dependencies that are not created. A call back feature may be used to reference the soft dependency so that when the soft dependency becomes available to the framework manager 440, the framework manager 440 will inform each callback referencing the soft dependency that the soft dependencies are now available.
If the inquiry to decision block 1020 is negative, then the “No” branch is followed to block 1027 in which the node structure data is stored by the framework manager 440 in temporary storage such as memory and the framework manager 440 creates a call back feature associated with this un-instantiated node.
If the inquiry to decision block 1015 is positive, then the “Yes” branch is followed to routine 1025 in which a node 601 is created or instantiated based on the node structure data received in routine block 1005. Further details of routine block 1025 will be described below in connection with
Referring now to
A second, slightly more complex, implementation is to put all of the notifications onto a separate notification queue, and then run through the queue beginning at a single point in time, i.e., the notifications are performed iteratively. So when node 601B of
Logically, these two implementations are equivalent, but they have different memory consumption properties when implemented. The recursive realization is simple but can consume an arbitrary amount of stack space, with the stack consumption being a function of the depth of the dependency graph. The iterative implementation is slightly more complex and requires a bit more static memory (the notification list), but stack usage is constant irrespective of the depth of a dependency graph, such as illustrated in
Also, notification of node creation in block 1035 is not limited to other nodes. It may also used internally for alias construction. Any arbitrary element in the system 500A may use the same mechanism to request for notification when a node becomes available, not just other nodes. Both nodes and non-nodes may use the same notification mechanism.
In decision block 1040, the framework manager 440 determines if other nodes 601 or soft dependencies are now released for creation or instantiation based on the creation of the current node 601. Decision block 1040 generally determines whether resources may be created because certain dependency relationships 680 have been fulfilled by the current node which has recently undergone creation or instantiation.
If the inquiry to decision block 1040 is positive, then the “Yes” branch is followed back to routine block 1025 in which the released node 601 may now be created or instantiated because of the fulfillment of a dependency by the node 601 that was just created.
If the inquiry to decision block 1040 is negative, then the “No” branch is followed to block 1045 in which the frame work manager 440 may manage communications between elements of the software architecture as illustrated in
Compared to the prior art, this logging of activity in block 1050 that lists unique names assigned to each resource of a system is unique and may provide significant advantages such as used in debugging and error troubleshooting. Another unique aspect of the node architecture 500A is that separate teams may work on different hardware and/or software elements independently of one another in which each team will be able to use resource names that are unique and easy to track without the need for creating tables to translate less meaningful and usually confusing resource names assigned by other teams and/or the original equipment manufacturer (OEM).
Next, in decision block 1055, the framework manager 440 determines if a log of activity recorded by the framework manager 440 has been requested. If the inquiry to decision block 1055 is negative, then the “No” branch is followed to the end of the process in which the process returns back to routine 1005. If the inquiry to decision block 1055 is positive, then the “Yes” branch is followed to block 1060 in which the framework manager 440 sends the activity log comprising meaningful resource names and respective actions performed by the resource names to an output device, such as a printer or a display screen and/or both. The process then returns to routine block 1005 described above.
Block 1105 is the first step in the sub method or routine 1005 of
For convenience, a conventional tree file naming structure or file naming “metaphor” that employs forward slash “/” characters for creating unique names may be employed, such as, but not limited to, “/core/cpu” for CPU 110 and “/clk/cpu” for clock 442. However, as recognized by one of ordinary skill the art, other types of resource names containing any other combination of alphanumeric characters and/or symbols are well within the scope of this disclosure.
Next, in block 1110, the framework manager 440 may receive data for one or more driver functions associated with one or more resources of the node 601 being created. A driver function generally comprises the action to be completed by one or more resources for a particular node 601. For example, in
In block 1115, the framework manager 440 may receive node attribute data. The node attribute data generally comprises data that defines the node policies such as security (can the node be accessed via user space applications), remotability (can the node be accessed from other processors in the system) and accessibility (can the resource support multiple concurrent clients). The framework manager 440 may also define attributes that allow a resource to override default framework behavior, such as request evaluation or logging policy.
Subsequently, in block 1120, the framework manager 440 may receive customized user data for the particular node 601 being created. The user data may comprise a void “star” field as understood by one of ordinary skill in the art with respect to the “C” programming language. User data is also known to one of ordinary skill in the art as a “trust me” field. Exemplary customized user data may include, but is not limited to, tables such as frequency tables, register maps, etc. The user data received in block 1120 is not referenced by the system 500B, but allows for customization of a resource if the customization is not recognized or fully supported by the framework manager 440. This user data structure is a base class in the “C” programming language intended to be extended for particular or specific uses.
One of ordinary skill the art recognizes that other kinds of data structures for extending specific uses of a particular class are within the scope of this disclosure. For example, in the programming language of “C++” (C-plus-plus), an equivalent structure may comprise the key word “public” which would become an extension mechanism for a resource within a node 601.
Next, in block 1125, the framework manager 440 may receive dependency array data. The dependency array data may comprise the unique and specific names of one or more resources 601 on which the node 601 being created is dependent. For example, if the first node 602 of
Subsequently, in block 1130, the framework manager 440 may receive resource array data. The resource array data may comprise parameters for the current node being created, such as parameters relevant to the first node 602 of
In
In block 1210, the framework manager may create or instantiate the one or more resources corresponding to the node structure data of block 705. Next, in block 1215, the framework manager 440 may activate the driver functions received in routine block 1110 of routine block 1005. According to one exemplary aspect, the driver functions may be activated using the maximum values received in the resource array data block 1130 of routine block 1005. According to another, preferred, exemplary aspect, each driver function may be activated with an optional, initial value that is passed along with the node structure data from routine 1005. If initial data is not provided, the driver function is initialized at 0—the minimum value. The driver function is also usually activated in manner such that it is known that it is being initialized. This enables the resource to perform any operations that are specific to initialization, but do not need to be performed during normal or routine operation. The process then returns to step 1030 of
Next, in block 1310, customized user data may be received by the framework manager 440 if there are any particular customizations for this client 648 being created. Block 1310 has been illustrated with dashed lines to indicate that the step is optional. The customized user data of block 1310 is similar to the customized user data discussed above in connection with the creation of resources for nodes 601.
In block 1315, the framework manager 440 receives the client type category assigned to the particular client being created. The client type category as of this writing may comprise one of four types: (a) required, (b) impulse, (c) vector, and (d) isochronous. The client type category list may be expanded depending upon the resources being managed by the system 101 and upon the application programs relying upon the resources of the nodes 601.
The required category generally corresponds with the processing of a scalar value that is passed from the required client 648 to a particular resource 601. For example, a required request may comprise a certain number of millions of instructions per second (MIPs). Meanwhile, the impulse category generally corresponds with the processing of a request to complete some activity within a certain period of time without any designation of a start time or stop time.
An isochronous category generally corresponds with a request for an action that is typically reoccurring and has a well-defined start time and a well-defined end time. A vector category generally corresponds with an array of data that usually is part of multiple actions that are required in series or in parallel.
Subsequently, in block 1320, the framework manager 440 receives data that indicates whether the client 648 has been designated as synchronous or asynchronous. A synchronous client 648 is one that typically requires the framework manager 440 to lock a resource of a node 601 until the resource 601 returns data and an indication that the resource 601 has finished completing the requested task from the synchronous client 648.
On the other hand, an asynchronous client 648 may be handled by one or more threads in parallel which are accessed by the framework manager 440. The framework 440 may create a callback to a thread and may return a value when the callback has been executed by a respective thread. One of ordinary skill the art recognizes that the asynchronous client 648 does not lock up a resource like a synchronous client 648 does when the task of the synchronous client 648 is being executed.
After block 1320, in decision block 1325, the framework manager 440 determines if the resource identified by the client 645 are available. If the inquiry to decision block 1325 is negative, then the “No” branch is followed to block 1330 in which a null value or message is returned to a user indicating that the client 648 cannot be created at this time.
If the inquiry to decision block 1325 is positive, then the “Yes” branch is followed to decision block 1335 in which the framework manager 440 determines if each resource identified by the client 648 supports the client type provided in block 1310. If the inquiry to decision block 1335 is negative, then the “No” branch is followed back to block 1330 in which a null value or message is returned indicating that the client 648 cannot be created at this time.
If the inquiry to decision block 1335 is positive, then the “Yes” branch is followed to block 1340 in which the framework manager 440 creates or instantiates the client 648 in memory. Next, in block 1345, if any customized user data is received in block 1310, such as optional arguments, then these optional arguments may be mapped with their respective resources to a particular node 601. Next, in block 1350, the newly created client 645 is coupled to its corresponding one or more resources in an idle state or on requested state as described above. The process then returns to block 1210 of
Block 1405 is the first step in the method 1400 for creating a client request 675 against the resource 601. This method 1400 will describe how the following three types of client requests 675 are handled by the framework manager 440: (a) required, (b) impulse, and (c) vector. As the names of the requests 675 mentioned above suggest, client requests 675 generally correspond with client types that were created and described above.
In block 1405, the framework manager 440 may receive the data associated with a particular client request 675 such as one of the three mentioned above: (a) required, (b) impulse, and (c) vector. The data associated with a required request generally comprises a scalar value that is passed from the required client 648 to a particular resource 601. For example, a required request may comprise a certain number of millions of instructions per second (MIPs). An impulse request comprises a request to complete some activity within a certain period of time without any designation of a start time or stop time.
Data for a vector request generally comprises an array of multiple actions that are required to be completed in series or in parallel. A vector request may comprise an arbitrary length of values. A vector request usually has a size value and an array of values. Each resource of a node 601 may be extended to have a pointer field in order to support a vector request. In the “C” programming language, the pointer field is supported by the union function as understood by one of ordinary skill in the art.
Next, in block 1410, the framework manager 440 issues the request through the client 648 that was created by the method described above in connection with
For required requests, in this block 1415, values from a prior request are maintained in memory so that the framework manager 440 may determine if there is any difference between the previous requested values in the current set of requested values. For vector requests, prior requests are usually not maintained in memory, although a resource of a node 601 may maintain it as desired for a particular implementation. Therefore, block 1415 is optional for vector types of requests.
In block 1420, the framework manager 440 calculates the delta or difference between the previous set of requested values in the current set of requested values. In decision block 1425, the framework manager determines if the current set of requested values is identical to the previous set of requested values. In other words, the framework manager 440 determines if a difference exists between the current set of requested values and the previous set of requested values. If there is no difference between the current set and previous set of requested values, then the “Yes” branch is followed (which skips blocks 1430 through block 1470) to block 1475 in which the process ends.
If the inquiry to decision block 1425 is negative, meaning that the set of requested values are different relative to the set of pre-previous requested values, then the “No” branch is followed to decision block 1430.
In decision block 1430, the framework manager 440 determines if the current request is an asynchronous request. If the inquiry to decision block 1430 is negative, then the “No” branch is followed to block 1440 in which the resource 601 corresponding to the client request 675 is locked by the framework manager 440. If the inquiry to decision block 1430 is positive, meaning that the current request is asynchronous request type, then the “Yes” branch is followed to block 1435 in which the request may be pushed onto another thread and may be executed by another core if a multi-core system, like that of
Subsequently, in block 1440, the resources 601 corresponding to the request 675 is locked by the framework manager 440. Next, in block 1445, the resource 601 executes the update function which generally corresponds to the plug-in data of the resource array data received in block 1130 of
The update function compares its previous state with the requested state in the client request. If the requested state is greater than the previous state, then the update function will perform the client request. However, if the requested state is equal to or less than the current state and which the resource is operating at, then the client request will not be performed in order to increase the efficiency since the old state achieves or satisfies the requested state. An update function takes a new request from the client and aggregates it with all the other active requests to determine the new state for the resource.
As an example, multiple clients may be requesting a bus clock frequency. The update function for the bus clock would usually take the maximum of all the client requests and use that as the new desired state for the bus clock. It is not the case that all resources will use the same update function, although there are some update functions that will be used by multiple resources. Some common update functions are to take the maximum of client requests, to take the minimum of client requests and to sum the client request. Or resources may define their own custom update function if their resource needs to aggregate requests in some unique way.
Next, in block 1450, the framework manager 440 passes the data to the resource corresponding to the client 648 so that the resource may execute the driver function which is specific to the resource of a node 601. A driver function applies the resource state as computed by the update function. This may entail updating hardware settings, issuing requests to dependent resources, calling legacy functions or some combination of the above.
In the previous example, the update function computed the requested bus clock frequency. The driver function may receive that requested frequency and it may update the clock frequency control HW to run at that frequency. Note that sometimes it is not possible for the driver function to meet the exact requested state that update function has computed. In this case, the driver function may choose the frequency that best meets the request. For example, the bus clock HW may only be able to run at 128 MHz and 160 MHz, but the requested state might be 150 MHz. In this case, the driver function should run at 160 MHz, as that exceeds the requested state.
Next, in block 1455, the framework 440 receives state control from the resource which has executed the driver function in block 1450. Subsequently, in block 1460, if defined against the resource, events 690 may be triggered so that data is passed back to the client 648 which corresponds to the event 690. Events may be processed in another thread. This may minimize the amount of time spent with the resources locked and allows for parallel operation in a multi-core system as illustrated in
One or more events 690 may be defined against a resource in a manner similar to how a request may be defined against a resource as described in this method 1400. In other words, the event creation process may largely parallel the client creation process. One thing that is different with the events is that it is possible to define events that only get triggered when certain thresholds are crossed.
This defining of events that only get triggered based on thresholds allows for notification of when a resource is getting oversubscribed (it has more concurrent users than it can support) which is indicative of a system overloading condition, or when a resource goes low/off, which may allow other things to be shut off, restore functionality that was disabled when the system became oversubscribed, etc. Because the event registration may be done with thresholds, it reduces the amount of work the system has to do on event notification to only happen when there is something really necessary. It is also possible to register for an event on every state change.
Next, in optional block 1465, if the request being processed is a vector request, then this optional block 1465 is usually performed. Optional block 1465 generally comprises a check or determination to assess whether the vector pointer is still positioned on the same data that the user passed into the vector. If the inquiry to this optional block 1465 is positive, meaning that the pointer is still pointing to the same data which was passed by the user into the vector, then the pointer is cleared out so that references to old data is not maintained. This optional block 1465 is generally performed to account for the double buffering block 1415 described above when a vector request is being processed, compared to an impulse request and a required request.
Subsequently, in block 1470, the framework 440 unlocks the requested resource so that other client requests 648 may be handled by the current but now released requested resource of a particular node 601. The process then returns to the first block 1405 for receiving the next client request.
The above-described methods and data structures are essentially as applicable to a multi-processor PCD 100 as they are to a single-processor PCD 100. However, the remoting framework 300 (
For example, the remoting framework 300 may advantageously render the details of inter-processor communication transparent to an application programmer or similar person. Thus, an application program, for example, may define a client that issues a request on a target resource without having to include in the client definition any identification of the processor domain that controls that resource. Rather, the remoting framework 300 ensures that the request will reach the target resource regardless of which processor controls the client and which processor controls the target resource.
In addition, the remoting framework 300 manages the inter-processor communication so that, for example, an application program need not include any instructions relating to the protocol or other aspects of the communication paths (e.g., buses) between processors. Furthermore, as different inter-processor communication paths may use different protocols, the remoting framework 300 allows the resource definition to specify a protocol along with other aspects of the resource. These and other features relating to distributed resource management are described below with regard to
A distributed resource is used as a means to access the corresponding native resource. In this example the term “resource” may be used interchangeably with the term “node,” as it should be understood that a resource may be included in a node.
A broken line 1301 illustrates a division between resources controlled by the first processor (to the left of the line 1301) and resources controlled by the second processor (to the right of the line 1301). The first resource 1302 is one of two or more resources that are controlled by the first processor. One such resource may be a protocol resource 1306 on which the first resource 1302 depends. Likewise, the second resource 1304 is one of two or more resources that are controlled by the second processor. One such resource may be a protocol resource 1308 on which the second resource 1304 depends.
The first and second resources 1302 and 1306 may also depend on additional resources in the same manner as described above with regard to resources or nodes in general, but such additional resources are not shown in
The first and second resources 1302 and 1304, under control of their respective processors, are capable of communicating information via a communication path 1303. The communication path 1303 represents the combination of the physical medium between the first and second processors and the one or more layers of transport protocols used to communicate via that medium. Accordingly, any communications between the first resource 1302 and the second resource 1304 must conform to the protocols. Protocol resources 1306 and 1308 define a protocol or may point to a protocol definition in a library (not shown). The remoting framework 300 and (main) framework 440 operate in conjunction with one another to manage the resources and communications between them. As described below, a client 1312, under control of the first processor, may issue one or more resource requests on the first resource 1302. The first resource 1302 uses the functionality of the corresponding second resource 1304 to service the resource request.
The latency restriction tracking node 661 may be assigned a resource name of “core/cpu/latency—restriction registry—pass.” However, other resource names for the latency restriction tracking node 661 may be employed without departing from the scope of this disclosure.
Different software drivers may each have a latency restriction which is registered with the latency restriction node 661. A latency restriction is a restriction on the amount of time calculated between the instant an interrupt fires/initiates to an instant in time an interrupt service request (“ISR”) may be run or executed by a processor 110 to handle an interrupt. Typically, different clients 648A-N, such as drivers as illustrated in
The clients 648A-N which register their latency restrictions with the latency restriction tracking node 661 are not limited to drivers and may include any other type of resource of a PCD 100. However, drivers are resources that are usually most concerned about interrupts and how they are serviced by the sleep subsystem 1490 of a PCD 100.
As understood by one of ordinary skill in the art, a latency restriction is usually provided in some units of time that may vary from one operating system (“OS”) to the next. According to one exemplary embodiment, each latency restriction from a client 648A-N may be provided in units of a clock frequency such as in kilohertz. In other exemplary embodiments, the latency restriction may be expressed in microseconds, nanoseconds, etc.
An example of how a latency restriction is used in a context for a PCD 100 is described as follows: if a processor 110 of a PCD 100 is in a low-power mode such as CPU power collapse, and an interrupt fires to wake up the processor 110, then the amount of time that is needed to exit the power collapse mode causes latency for servicing that interrupt. This latency occurs because the processor 110 usually must run some cleanup processes after the CPU power collapse mode before the interrupt service request (“ISR”) may be activated so that the processor 110 can service the interrupt.
A PCD 100 may have one or more low-power modes tracked by nodes 664 as illustrated in
Each low-power mode tracked by a node 664 is usually registered by a resource with the sleep LPR node 662 (described below) and indicates how much time is taken to enter into the low-power mode tracked by a node 664 and how much time is needed to exit the low-power mode. If a low-power mode takes longer to enter and exit than a latency restriction allows, then that low-power mode may not be chosen by a solver function or code executed by a processor 110.
Meanwhile, one of the main functions of the latency restriction tracking node 661 is to detect new and/or changes in latency restrictions and to pass that data to the sleep idle plug-in node 663. Complimentary to the latency restriction tracking node 661, the sleep LPR node 662 keeps track of all the low-power modes (taking the form of nodes 664A, 664B, and 664N) that are registered with a sleep subsystem 1490 of PCD 100.
The sleep LPR node 662 determines which enabled low-power node tracked with a node 664 has the minimum amount of time to enter and exit its respective sleep state. The sleep LPR node 662 tracks all of the low-power modes tracked by nodes 664 that are registered with the sleep subsystem 1490 of a PCD 100, and which were created by respective low power resources 665. Various low power resources 665 may register with the sleep LPR node 662 to inform of their low power modes which may be tracked with nodes 664. Exemplary low power resources 665A, 665B, 665N may include, but are not limited to, a CPU rail (off or power collapse), various low powered resources that each have their own respective low-power modes of operation, a CXO clock that may be a clock for an entire chip (Shut down/OFF), a main voltage rail for the digital domain (a low power mode that is minimized or characterized as a retention level).
One of the main functions of the sleep LPR node 662 is to detect enablement of any of the lower power modes tracked by nodes 664. “Enabled” as understood by one of ordinary skill in the art means that the resource which controls or is in charge of a respective low-power mode tracked by a node 664 has determined that there are no conditions which prevent a processor 110 from entering this low-power mode tracked by a node 664. The enabled condition allows a processor 110 to select a particular low-power mode tracked by a node 664 as an option if certain conditions are right/optimal.
Specifically, an enabled condition of a low-power mode tracked by a node 664 allows a solver, which is typically code and/or function executed by a processor 110, to select one of the enabled low-power modes tracked by a node 664 based on current/present conditions of the PCD 100. The solver (not illustrated) typically comprises a decision process executed by the PCD 100 for selecting an optimal low-power mode tracked by a node 664 that is enabled and based on current conditions of the PCD 100.
In addition to detecting whether a low-power mode tracked by a node 664 has been enabled, the sleep LPR node 662 also identifies which enabled low power mode tracked by a node 664 has the minimum entry and exit latency out of all enabled low-power modes registered with the sleep LPR node 662. Entry and exit latency refers to how each low-power mode tracked by a node 664 has a predetermined amount of time that a processor 110 will take to enter and exit the respective low-power mode. The sleep LPR node 662 may compare entry and exit latency values across enabled low-power modes tracked by nodes 664 in order to determine the one with the least amount of required time (latency), referred to as the minimum entry and exit latency for a low-power mode. The sleep LPR node 662 relays this minimum entry and exit latency to the sleep idle plug-in node 663 whenever it detects a new low power mode that has been enabled. The sleep LPR node 662 also detects when no low power modes are enabled. It communicates this status to the sleep idle plug-in node 663.
The sleep idle plug-in node 663 is responsible for determining whether the lowest latency restriction is less than the minimum enabled low-power mode latency that has been detected and identified by the sleep LPR node 662. In other words, the sleep idle plug-in node 663 determines if any low-power mode may be possible for a processor 110. The sleep idle plug-in node 663 determines whether it is worth it for a processor 110 to initiate a solver to determine which low-power state should be selected based on the available low-power modes registered with the sleep LPR node 662. The sleep idle plug-in node 663 determines very early on whether a solver would be able to choose a low-power mode at all based on present operating conditions of a PCD 100.
By doing this, the sleep idle plug-in node 663 may determine which enabled low-power mode is the fastest to enter into and exit from (the minimum enter and exit latency). So if a low-power mode tracked by a node 664 with the minimum enter and exit latency violates the latency restrictions registered with the latency restriction tracking node 661, then the sleep idle plug-in node 663 will know that none of the enabled low-power modes tracked by nodes 664 will be available to the processor 110 at this current or present time based on the present conditions of the PCD 100.
In such a situation, where no enabled low-power modes are available, the sleep idle plug-in node 663 will recommend (switch its function pointer to) the halt state. If an enabled low-power mode tracked by a node 664 having a minimum enter and exit latency does not violate the lowest latency restriction registered with the latency restriction tracking node 661, then the sleep idle plug-in node 663 will know that at least one enabled low-power mode may be available to the processor 110 and that such a low-power mode may be selected by a solver in a subsequent process. The functions of the sleep idle plug-in node 663 will become more apparent in connection with the flowchart of
In decision block 1505, the enablement of any low-power mode tracked by a node 664 is detected. Block 1505 may be performed or executed by the sleep LPR node 662 as described above. Meanwhile, in parallel to decision block 1505, in decision block 1510, any new latency restrictions are detected. Decision block 1510 may be performed or executed by the latency restriction tracking node 661 as described above in connection with
If the inquiry to decision block 1510 is negative, then the “NO” branch is followed back such that decision blocks 1505 and 1510 may be executed again. Similarly, if decision block 1505 is negative, then the “NO” branch is followed back such that decision blocks 1505 and 1510 may be executed again. However, if the inquiry to decision block 1510 is positive, then the “YES” branch is followed to decision block 1530.
If the inquiry to decision block 1505 is positive, then the “YES” branch is followed to block 1515. In block 1515, the single enabled low-power mode which has the minimum entry and exit latency is identified. Block 1515 is usually performed by the sleep LPR node 662 as described above in connection with
In decision block 1530, it is determined whether the lowest latency restriction detected in block 1510 is less than the minimum latency for the enabled low-power mode tracked by a node 664 that was detected and relayed via blocks 1505 through 1520. Decision block 1530 may also detect if there are no low power modes enabled. This decision block 1530 is usually performed or executed by the sleep idle plug-in node 663. If the inquiry to decision block 1530 is positive, which means that the lowest latency restriction detected in decision block 1510 is less than (more restrictive) then the latency of the enabled low-power mode with the lowest latency OR if no low power modes have been enabled, then the “YES” branch is followed to block 1535 in which the sleep idle plug-in node 663 switches its function pointer to a “HALT” state.
If the inquiry to decision block 1530 is negative, which means that the latency of the enabled low-power mode with the lowest latency is less than the lowest latency restriction identified in block 1510, then the “NO” branch is followed to block 1540. In block 1540, the sleep idle plug-in node 663 switches its function pointer to a state which allows a solver to determine the optimum enabled low-power mode that may be appropriate for a processor 110 based on current conditions of the PCD 100.
Next, in block 1545, the sleep idle plug-in node 653 caches or stores its solution which is the current state of the function pointer. The stored solution of the function pointer calculated by the sleep idle plug-in node 663 is usually accessed by the processor 110 when the processor 110 detects conditions favorable for an idle state or a halt state so that the processor 110 may conserve power. Further details about when the processor 110 accesses this function pointer will be described below in connection with
If the inquiry to decision block 1605 is negative, then the “NO” branch is followed back to block 1605. The inquiry to decision block 1605 is positive, then the “YES” branch is followed to block 1610. In block 1610, the status of the function pointer cached or stored in block 1545 of
Next, in decision block 1615, the current state of the function pointer retrieved in block 1610 is determined. If the inquiry to decision block 1615 is a “HALT” state, then the “HALT” branch is followed to block 1620. In block 1620, the processor 110 enters into a halt state in which the operation of the processor 110 is stopped in order to conserve energy or power for the PCD 100.
If the inquiry to decision block 1615 is “SOLVER”, then the “SOLVER” branch is followed to block 1625 in which the solver function or feature of the sleep subsystem 1490 is permitted to solve or determine which optimum enabled low-power mode tracked by a node 664 should be entered into by the processor 110. In block 1635, the appropriate enabled low-power mode is determined by the solver. A solver, as understood by one of ordinary skill in the art, may take form of computer code that determines the most efficient low-power mode tracked by a node 664 that should be selected based on current conditions of the PCD 100. Stated differently, a solver may comprise software, which may be part of an operating system (“O/S”), that has one of its main functions to determine which of the available and enabled low-power modes should be selected based on current conditions of the portable computing device 100 as understood by one of ordinary skill in the art. In block 1637, the low-power mode selected by the solver is then entered. The process continues to decision block 1640 as described above.
Going back to block 1620, in which the processor 110 has been halted, the process continues to decision block 1630. In decision block 1630, the processor 110 determines whether or not an interrupt service request (“ISR”) has been detected. If the inquiry to decision block 1630 is negative, the “NO” branch is followed such that the processor 110 remains in its halted or low-power state. If the inquiry to decision block 1630 is positive, then the “YES” branch is followed to block 1640 in which the processor 110 exits the halted state or low-power state and performs any necessary cleanup processes as understood by one of ordinary skill in the art.
After these cleanup processes are performed, the processor 110 may resume operations such that it may service any new task or existing tasks that were put on hold before the processor 110 entered into the halted state or low-power state. The process 1600 then returns.
In view of
When the sleep idle plug-in node 663 detects a condition ripe for halting or a low power mode tracked by a node 664 during run time, the sleep idle plug-in at 206 will switch a function pointer to a halt state such that the halt function will be invoked when a processor 110 determines that conditions are right for conserving power of the PCD 100. The sleep idle plug-in node 206 is tracking conditions for determining when a halt state should be entered into as requests are received and processed by a processor 110 are sent by various resources 665.
One of the major benefits of the sleep idle plug-in node 663 is that it checks for changes in conditions as they occur instead of waiting for conditions that may trigger a low-power mode or halt condition for a processor 110. Another major benefit is that sleep idle plug-in node 662 does not wait for a processor 110 to enter into a single-threaded mode in order to determine if conditions are right for either a halt state or low power state for a processor 110. The sleep idle plug-in node 662 assesses conditions while a processor 110 is not in a single threaded mode. The sleep idle plug-in node 662 receives notice of latency changes from the latency restriction tracking node 661 and the sleep LPR node 662 which tracks whether low-power modes have been enabled.
The assessments made by the sleep idle plug-in node 663 occur continuously as requests are processed by the processor 110 instead of waiting for potential idle states of the processor. The sleep idle plug-in node 663 moves sleep assessment and halt assessments to an earlier stage of processing—to when conditions of a processor 110 change, such as when latency restrictions are changed by a driver 648 instead of waiting for an idle state or conditions that may be favorable for a low-power sleep state.
So for example, in an audio example, a driver 648 wants to register a latency restriction of 2 ms. Therefore, the driver 648 would register the latency restriction with the latency restriction tracking node 661. In the conventional art, during the execution of an audio file, the assessments to determine how the change in latency to 2 ms may impact low power modes or when a halt state should be selected by the processor 110 would be executed every time the processor 110 entered into an idle state.
An idle state during playback of an audio file could occur at a rate of 1000 times a second. Now, with the sleep idle plug-in node 662, the assessment of how the change in latency to 2 ms will be evaluated outside of any idle state and usually before any idle state for the processor 110.
In view of the disclosure above, one of ordinary skill in the art is able to write computer code or identify appropriate hardware and/or other logic or circuitry to implement the distributed resource management system and method without difficulty based on the flowcharts and associated description in this specification, for example. Therefore, disclosure of a particular set of program code instructions or detailed hardware devices is not considered necessary for an adequate understanding of how to make and use the distributed resource management system and method. The inventive functionality of the claimed computer implemented processes is explained in more detail in the above description and in conjunction with the drawing figures, which may illustrate various process flows. Further, the processors 110, 126, 202, 206, etc., in combination with the memory 112 and the instructions stored therein may serve as a means for performing one or more of the method steps described herein.
In one or more exemplary aspects, the functions described may be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the functions may be stored on or transmitted as one or more instructions or code on a computer-readable medium. Computer-readable media include both computer storage media and communication media including any medium that facilitates transfer of a computer program from one place to another. A storage medium may be any available medium that may be accessed by a computer. By way of example, and not limitation, such computer-readable media may comprise RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other optical or magnetic storage devices, or any other medium that may be used to carry or store desired program code in the form of instructions or data structures and that may be accessed by a computer. The term “disk” or “disc,” as used herein, includes but is not limited to compact disc (“CD”), laser disc, optical disc, digital versatile disc (“DVD”), floppy disk and Blu-ray disc. Combinations of the above should also be included within the scope of computer-readable media.
Although selected aspects have been illustrated and described in detail, it will be understood that various substitutions and alterations may be made therein without departing from the spirit and scope of the present disclosure, as defined by the following claims.
Priority under 35 U.S.C. §119(e) is claimed to U.S. provisional application entitled “METHOD AND SYSTEM FOR TRACKING AND SELECTING OPTIMAL POWER CONSERVING MODES OF A PCD,” filed on Apr. 12, 2012 and assigned U.S. provisional application Ser. No. 61/623,150. The entire contents of this provisional patent application is hereby incorporated by reference.
Number | Date | Country | |
---|---|---|---|
61623150 | Apr 2012 | US |