Allocating computer processes to processor cores as a function of process utilizations

Computer processes are allocated among cores of a multi-core multi-processor system at least in part as a function of utilization histories of the processes.

BACKGROUND

An ever-increasing demand for computer performance has led to faster processors and greater levels of parallelism. High-end computers now boast multiple processors, each with multiple cores. This parallelism allows multiple processes to run in parallel on respective cores of the same or different processors. To maximize performance, processes should be divided among cores and processors as evenly as possible.

However, power consumption is an increasing concern for modern processors. Power consumption can be reduced by packing processes onto as few processors as possible so that some processors can be shut down or put in a low-power state. Taking this approach to the extreme can leave little headroom in a processor when processing needs suddenly increase; in such cases, the result can be a performance hit.

Some modern processors, e.g., the Xeon processor available from Intel Corporation and the Opteron processor available from Advanced Micro Devices, Inc., have reduced performance states that conserve power, providing the option of reducing power consumption while still making computer cycles available for processing. In some such processors, the lower power states must be shared by all cores on a processor, although different processors in a multi-processor system can assume different power states. The challenge is to find an allocation of processes to cores that provides a favorable tradeoff between power and performance given that what constitutes a favorable tradeoff can depend on the processes involved.

Herein, related art is described to facilitate understanding of the invention. Related art labeled “prior art” is admitted prior art; related art not labeled “prior art” is not admitted prior art.

DETAILED DESCRIPTION

A computer system AP1includes processors P1-P4, computer-readable storage media11including memory13, and communications devices15(including network interface cards and host-bus adapters for storage array networks). Memory13stores an operating system17, applications A1and A2, data19, a workload manager21. Workload manager21allocates processes P11-P44among processor cores C11-C44in accordance with allocation policies23. Allocation policies23call for processes P11-P44to be allocated among cores C11-C44in part as a function of expected utilizations derived from a utilization history25compiled by a utilization monitor of workload manager21.

Computer system AP1implements a method ME1, which begins with setting allocation policies at method segment MS1. The invention provides for static policies (e.g., that assign processes to cores without regard to monitored data) and dynamic policies (e.g., those based on utilization measurements). Policies can be based on measured utilization, expected utilization, and other factors (e.g., priority of workloads). Policies can seek to maximize performance, minimize power consumption, or provide various tradeoffs between these factors. One such tradeoff could be to minimize power consumption given that performance is to be within 90% of maximum. Workload manager21provides a user interface so that a system administrator can specify allocation policies. Any of these could be used as a default policy pending a selection by an administrator.

While applications A1and A2are running, utilization monitor27monitors utilization of each running process at method segment MS2. At the time represented inFIG. 1, sixteen processes P11-P44are running. Some of these are associated with each of operating system17, application A1, application A2, workload manager21, and utilization monitor27. Utilization monitor27compiles the utilization data in utilization history25at method segment MS3. This compilation allows utilization averages, patterns, and trends to be recognized by workload manager21.

Workload manager21allocates processes P11-P44to cores C11-C44at method segment MS4. At a specific iteration of method segment MS4, reallocates processes P11-P44to change a distribution of 10%-30%-50%-70% utilization on each processor to a distribution in which the utilization is the same or nearly same for all cores on each processor, while utilizations for respective processors P1, P2, P3, and P4are 10%, 30%, 50%, and 70%. This arrangement allows processors P1, P2, and P3to enter respective low power states without imposing significant penalties on performance.

This allocation scheme is applicable to processors that allow for low power performance states provided all cores of a processor “agree” to the lower state. In the pre-allocation 10%-30%-50%-70% utilization for the cores of one processor, the 70% utilization on one core prevents the other cores from entering a low-power state. Instead, any extra power available because one core is operating at low utilization is diverted to other cores to increase their execution frequency. In some cases, an optimal allocation can make use of this feature. However, if energy efficiency is a concern, it is generally better to try to match core utilization within a processor to allow a lower power state to be achieved since the only way to go to a lower power state is if all of the cores agree. Thus, for efficiency, allocations must try to achieve matching core utilizations within a processor.

For cases where the number of active processes is less than the number of cores, workload manager21can attempt to allocate processes so that some processors are unused, allowing them to enter latent low-power states for further power savings. The present invention provides for maximizing performance by distributing predicted utilization as evenly as possible, and for minimizing power consumption, by packing processes on as few processors as possible so that the unused processors can be put in low power (inactive) modes. The present invention also provides for distributed processes so that, among active processors, the variance of utilization among cores for each processor is less than the variance in utilization (averaged among all cores of each processor) among processors to provide a favorable tradeoff between power efficiency and performance.

A “computer” is a machine that manipulates data in accordance with instructions. A “program” is an ordered series of computer-executable instruction. As used herein, a “program” is inherently tangibly embodied in computer-readable media. A “server” is a computer that provides services to, e.g., serves web pages to or responds to database queries from, other computers.

“Computer-readable media” refers to media that can be accessed by a computer and includes volatile and nonvolatile, removable and non-removable media. By way of example, and not limitation, computer-readable media may comprise computer storage media and communication media. “Computer storage media” includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer-executable instructions, data structures, program modules or other data.

“Computer storage media” encompasses, but is not limited to, random access memory (RAM), read-only memory (ROM), Electrically-Erasable Programmable Read-Only Memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CDROM), digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can be accessed by computer.

Herein, “allocation” refers to an assignment of a process or set of processes to a computer processor core or set of processor cores. A process is a sequence of computer-executable instructions, these instructions being executed on the core to which the process is assigned and on which the process is “running”. “Utilization”, as used herein and applied to processors and processor cores refers to the fraction or percentage of processor or cycles doing real work. The percentages inFIG. 1, represent the percentages of core cycles productively used by respective processes. A “utilization history” is a compilation of utilization data collected over time. The utilization data also associates the power state or execution frequency with the utilization data or normalizes actual utilization to indicate what the utilization would have been if the processor were running at full speed.

In the computer system ofFIG. 1, individual cores on a processor are treated as the grain of computing resource to associate with a process. HP-UX, an operating system available from Hewlett-Packard Company, provides for processor sets (psets). A pset is an arbitrary grouping of processor cores. For example, a first pset can consist of all the cores on a portion of the processors in a system, while a second pset contains all the cores on the remaining processors. Alternatively, a first pset could include the zeroth cores of all the processors in a system, a second pset could include the 1st and 2nd cores on all the processors, and a third pset could include all the 3rd cores. Power policy settings can than manipulated for applications as a specific grouping of cores in each pset and/or the power attributes of the cores in those psets. Instead of only associating processes with a particular processor core at a given performance/power setting, we could alternatively associate the processes with a particularly attributed processor set to execute the policy setting.

Policies can vary according to the relative importance of power and performance, which in turn can vary per workload. For example, for application A1, performance may be paramount, while for application A2performance is less critical and power savings are therefore a bigger factor in allocation. In such a case, processes associated with application A1can be allocated to processors P1and P2so that distribution is divided as evenly as possible between these processors, while processes associated with application A2are packed onto processor P3along with non-application processes, so that processor P4can be put in an idle state. These and other variations upon and modifications to the illustrated embodiment are provided by the present invention, the scope of which is defined by the following claims.