Intelligent power optimization mechanism via an enhanced CPU power management algorithm
The presently disclosed technology provides methods and systems for optimally allocating power among workloads executing on a computer system through use of a power management algorithm. For example, according to the present technology a plurality of CPUs within a server can be divided into multiple groups according to application workloads. Workloads can be distributed to the CPUs as needed by a workload scheduler, and the workload scheduler can provide the CPU IDs to a power manager, enabling the power manager to optimize power settings. Each group of CPUs can be assigned an optimal power profile tailored to its respective situation.
1 . A method for managing power in a computing device,
the method comprising:
receiving a number of isolated central processing units (CPUs), the number of isolated CPUs indicating a quantity of CPUs of the computing device set as isolated CPUs;
allocating the isolated CPUs based on the number of isolated CPUs;
identifying CPU IDs of reserved CPUs, the reserved CPUs comprising CPUs of the computing device that are not set as the isolated CPUs; and
controlling P-states and C-states of one or more of the reserved CPUs based on the identified CPU IDs,
wherein the isolated CPUs handle only workloads for user applications and the reserved CPUs handle only workloads for a platform,
wherein allocating the isolated CPUs comprises considering the utilization of all CPUs of the computing device,
wherein when a workload of a particular user application requires a workload-specific number of CPUs, the workload-specific number of CPUs indicating a quantity of isolated CPUs for exclusive use on the workload of the particular user application, the method further comprises
allocating, by a workload scheduler, one or more of the isolated CPUs as workload-specific CPUs for the workload of the particular user application based on a new power profile, the new power profile being different from a general power profile and corresponding to the workload of the particular user application;
identifying CPU IDs of the allocated CPUs; and
controlling P-states and C-states of the allocated CPUs based on the new power profile; and
wherein the controlling the P-states and C-states of the isolated CPUs comprises at least one of setting a minimum frequency for one or more of the isolated CPUs or determining a maximum idle state for one or more of the reserved CPUs.
2 . The method of claim 1 , wherein the controlling the P-states and C-states of the reserved CPUs comprises at least one of setting a minimum frequency for one or more of the reserved CPUs or determining a maximum idle state for one or more of the reserved CPUs.
3 . The method of claim 2 , wherein the controlling the P-states and C-states of the reserved CPUs comprises setting the minimum frequency, and wherein the minimum frequency is set incrementally, beginning with an initial value and ending with a final value.
4 . The method of claim 2 , wherein the minimum frequency is set by a P/C state controller.
5 . The method of claim 1 , wherein receiving comprises receiving the number of isolated CPUs via an interface provided by a workload scheduler.
6 . The method of claim 5 , wherein the identifying CPU IDs of reserved CPUs comprises sending a request for the CPU IDs of reserved CPUs from a power manager to the workload scheduler.
7 . The method according to claim 6 , wherein the request is one of periodic requests sent from the power manager to the workload scheduler for purposes of identifying the CPU IDs of reserved CPUs.
8 . The method of claim 1 , further comprising:
partitioning the isolated CPUs into a plurality of sets; and
controlling the P-states and C-states of the isolated CPUs on a set-by-set basis.
9 . The method of claim 8 , wherein for each set, each isolated CPU within the set requires a power profile that is the same or similar to one or more power profiles required by each other isolated CPU within the set.
10 . The method of claim 9 , wherein the controlling the P-states and C-states of the isolated CPUs comprises at least one of setting a minimum frequency for one or more of the isolated CPUs or determining a maximum idle state for one or more of the reserved CPUs.
11 . The method of claim 10 , wherein the controlling the P-states and C-states of the isolated CPUs comprises setting the minimum frequency, and wherein the minimum frequency is set incrementally, beginning with an initial value and ending with a final value.
12 . The method of claim 1 , further comprising: setting the general power profile for the isolated CPUs, the general power profile applying to all isolated CPUs; and controlling P-states and C-states of all isolated CPUs based on the general power profile.
13 . The method of claim 12 , wherein the controlling the P-states and C-states of the isolated CPUs comprises setting the minimum frequency, and wherein the minimum frequency is set incrementally, beginning with an initial value and ending with a final value.
14 . The method of claim 1 , wherein the identifying the CPU IDs of the allocated CPUs comprises sending a request for the CPU IDs of the allocated CPUs from a power manager to the workload scheduler.
15 . The method of claim 1 , wherein the controlling the P-states and C-states of the allocated CPUs comprises at least one of setting a minimum frequency for one or more of the allocated CPUs or determining a maximum idle state for one or more of the reserved CPUs.
16 . The method of claim 15 , wherein the controlling the P-states and C-states of the allocated CPUs comprises setting the minimum frequency, and wherein the minimum frequency is set incrementally, beginning with an initial value and ending with a final value.