Decoupling a central processing unit from its tasks

A method and system for decoupling a central processing unit (CPU) of a plurality of hot CPUs from its assigned tasks. The hot CPUs are managed by an operating system of a computer system. A special flag is set, denoting that the CPU is to be decoupled from its assigned tasks. A special task coupled to the CPU is given a suitable scheduling policy and priority, wherein the special task gets enough continuous execution time to finish its job before another task executes on the CPU. The special task examines the special flag and decouples the first CPU from its assigned tasks after determining that the special flag has been set, wherein the special task does not relinquish control of the CPU. The decoupling of tasks from the CPU leaves at least one remaining CPU and occurs while the at least one remaining CPU is hot.

BACKGROUND OF THE INVENTION

1. Technical Field

The present invention relates to a method and system for decoupling a central processing unit from its assigned tasks.

2. Related Art

Decoupling a central processing unit from its assigned tasks is currently implemented inefficiently, resulting in performance degradation. Thus, there is a need for a method and system for decoupling a central processing unit from its assigned tasks in a more efficient manner than is currently accomplished in the related art.

SUMMARY OF THE INVENTION

The present invention provides a method for decoupling a first central processing unit (CPU) from its assigned tasks, said method comprising the steps of:

setting a special flag denoting that a first CPU is to be decoupled from its assigned tasks, said first CPU being comprised by a plurality of hot CPUs within a computer system, said hot CPUs being managed by an operating system of the computer system;

setting a suitable scheduling policy and priority for a first special task coupled to the first CPU, the suitable policy and priority so chosen that the first special task gets enough continuous execution time to finish its job, said continuous execution time being defined as the amount of time allotted to a task for execution on a CPU, before another task is made to execute on the CPU;

adding the first special task in a runqueue of the first CPU; and

executing the first special task on the first CPU, said executing the first special task including examining the special flag and decoupling the first CPU from its assigned tasks after determining that the special flag has been set, said decoupling accomplished by having the first special task not relinquish control of the first CPU such that the first CPU is unable to execute any of its assigned tasks, said decoupling of tasks from the first CPU leaving at least one remaining CPU of the plurality of hot CPUs, said decoupling of tasks from the first CPU occurring while the at least one remaining CPU is hot.

The present invention provides a computer system for decoupling a central processing unit (CPU) from its assigned tasks, said computer system comprising:

a plurality of hot CPUs including a first CPU, said hot CPUs being managed by an operating system of the computer system;

means for setting a special flag denoting that the first CPU is to be decoupled from its assigned tasks;

means for setting a suitable scheduling policy and priority for a first special task coupled to the first CPU, the suitable policy and priority so chosen that the first special task gets enough continuous execution time to finish its job, said continuous execution time being defined as the amount of time allotted to a task for execution on a CPU, before another task is made to execute on the CPU;

means for adding the first special task in a runqueue of the first CPU; and

means for executing the first special task on the first CPU to examine the special flag; and

means for decoupling the first CPU from its assigned tasks following a determination by the first CPU that the special flag has been set, subject to the first special task not relinquishing control of the first CPU and the first CPU being unable to execute any of its assigned tasks, and further subject to the decoupling of tasks from the first CPU leaving at least one remaining CPU of the plurality of hot CPUs and occurring while the at least one remaining CPU is hot.

The present invention provides a computer program product, comprising a computer usable medium having a computer readable program code embodied therein, said computer readable program code comprising an algorithm adapted to implement a method for decoupling a first central processing unit (CPU) from its assigned tasks, said method comprising the steps of:

setting a special flag denoting that a first CPU is to be decoupled from its assigned tasks, said first CPU being comprised by a plurality of hot CPUs within a computer system, said hot CPUs being managed by an operating system of the computer system;

setting a suitable scheduling policy and priority for a first special task coupled to the first CPU, the suitable policy and priority so chosen that the first special task gets enough continuous execution time to finish its job, said continuous execution time being defined as the amount of time allotted to a task for execution on a CPU, before another task is made to execute on the CPU;

adding the first special task in a runqueue of the first CPU; and

executing the first special task on the first CPU, said executing the first special task including examining the special flag and decoupling the first CPU from its assigned tasks after determining that the special flag has been set, said decoupling accomplished by having the first special task not relinquish control of the first CPU such that the first CPU is unable to execute any of its assigned tasks, said decoupling of tasks from the first CPU leaving at least one remaining CPU of the plurality of hot CPUs, said decoupling of tasks from the first CPU occurring while the at least one remaining CPU is hot.

The present invention provides a process for deploying computing infrastructure, comprising integrating computer-readable code into a computer system, wherein the code in combination with the computer system is capable of performing a method for decoupling a first central processing unit (CPU) from its assigned tasks, said method comprising the steps of:

setting a special flag denoting that a first CPU is to be decoupled from its assigned tasks, said first CPU being comprised by a plurality of hot CPUs within a computer system, said hot CPUs being managed by an operating system of the computer system;

setting a suitable scheduling policy and priority for a first special task coupled to the first CPU, the suitable policy and priority so chosen that the first special task gets enough continuous execution time to finish its job, said continuous execution time being defined as the amount of time allotted to a task for execution on a CPU, before another task is made to execute on the CPU;

adding the first special task in a runqueue of the first CPU; and

executing the first special task on the first CPU, said executing the first special task including examining the special flag and decoupling the first CPU from its assigned tasks after determining that the special flag has been set, said decoupling accomplished by having the first special task not relinquish control of the first CPU such that the first CPU is unable to execute any of its assigned tasks, said decoupling of tasks from the first, CPU leaving at least one remaining CPU of the plurality of hot CPUs, said decoupling of tasks from the first CPU occurring while the at least one remaining CPU is hot.

The present invention advantageously provides a method and system for decoupling a central processing unit from its assigned tasks in a more efficient manner than is currently accomplished in the related art.

DETAILED DESCRIPTION OF THE INVENTION

A need may exist to decouple a central processing unit (CPU) from a computer system, or from a portion (e.g., a partition) of the computer system, for various reasons. As a first example, the CPU may no longer be needed because other CPUs are sufficient for handling the computing load of the computer system (seeFIGS. 3-4described infra). As a second example, the CPU may be defective and needs to be replaced by another CPU (seeFIGS. 5-6described infra). As a third example, the CPU is within a partition of the computer system and needs to be moved to another partition (seeFIG. 7described infra).

Each CPU has tasks assigned to the CPU. The word “task” is used herein to refer to a stream of executable code that can be scheduled for execution on some CPU of the computer system. Some systems refer to such tasks as either threads or processes. Decoupling the CPU from the computer system, or from a portion of the computer system, comprises decoupling the CPU from its tasks such that the CPU cannot execute its assigned tasks. Thus tasks that are assigned to the CPU may be decoupled from the CPU while still being assigned to the CPU if the CPU is unable to execute the tasks. The present invention discloses a method and system for decoupling the CPU from its assigned tasks without depowering (i.e., powering down) the remaining CPUs of the computer system; i.e., while the remaining CPUs are “hot” and running. A CPU is “hot” if the CPU is executing its assigned work, wherein said work could be either running tasks or processing interrupts and exceptions.

FIG. 1depicts a computer system30including an operating system20and central processing units (CPUs) with their assigned tasks, in accordance with embodiments of the present invention. Note that all the CPUs are managed by an operating system, which is understood to mean that each of the CPUs is being managed by the same operating system software. As an example, each CPU may be managed by an image of said same operating system software. This is characteristic of tightly coupled systems. Examples of such system configurations are Symmetric Multiprocessing (SMP) and Non-Uniform Memory Access (NUMA). The CPUs inFIG. 1are denoted as CPU0, CPU1, CPU2, and CPU3and have runqueues10,11,12, and13, respectively.FIG. 1depicts tasks A-T and I0-I3. Tasks A, D-E and L are assigned to CPU0. Tasks B, F-G and M-O are assigned to CPU1. Task P is assigned to CPU2. Tasks C, H-K and Q-T are assigned to CPU3.

As shown inFIG. 2, the operating system20comprises a task scheduler21and a special code23, in accordance with embodiments of the present invention. The task scheduler21schedules execution of the tasks on their respective CPUs. The tasks are listed in task table22which may be indexed by task ID. The task table22may include, inter alia, the status of each task (e.g., running, ready-to-run, or sleeping, as explained infra) and CPU affinity (i.e., CPU assignment) of each task. The special code23is executable code used to facilitate decoupling of a CPU from its assigned tasks as will be described infra in conjunction withFIGS. 10-13.

Associated with each task are two scheduling attributes of scheduling policy and scheduling priority.

Operating systems that are certified under the Portable Operating System Interface (POSIX®) standard typically support following scheduling policies:

SCHED_OTHER (represents typically the default scheduling policy).

Other operating systems, that are not POSIX® compliant, may support equivalent or different policies for tasks to be associated with.

Scheduling priority defines the relative importance of the task compared to other tasks. The task scheduler takes into account scheduling priorities before assigning tasks to a CPU. Tasks with higher scheduling priority are assigned first to the CPU compared to tasks with lower scheduling priority. Normally operating systems define a priority range for each scheduling policy.

Of particular interest to this invention is the “continuous execution time” allotted to a task. The “continuous execution time” is defined as the amount of time a task is allowed to execute on a CPU before some other task is made to execute on the same CPU. Normally, the operating system task scheduler allots time-slices to tasks such that the various tasks get to execute on a CPU on some turn-by-turn basis. The duration of each time-slice is implementation dependent and can be fixed or variable (depending on various factors at run-time). Typically time-slices are few hundred milliseconds. Each task, once assigned to a CPU, gets to run continuously on the CPU, until either its time-slice expires or it voluntarily yields the CPU or is preempted by a higher priority task. After this, the operating system scheduler assigns some other task to the CPU.

An exception to the time-slicing is a task that runs under SCHED_FIFO (or its equivalent) policy. Such a task is not subject to time-slices. In other words, a task running with SCHED_FIFO (or equivalent) policy and having some scheduling priority, continues to run on the CPU until it either voluntarily yields the CPU or is preempted by a higher priority task.

Note that during the “continuous execution time” allotted to a task, the task's execution can still be interrupted by events like device interrupts. Such events interrupt the task's execution for some brief interval before restoring the CPU back to the task.

Returning toFIG. 1, each task has a status reflective of the task's state for being run or executed on the CPU that the task is assigned to, namely a status of: running, ready-to-run, or sleeping. A task having the “running” status is being currently executed on the CPU (e.g., tasks A, B, and C are running on CPU0, CPU1, and CPU3, respectively). A task having the “ready-to-run” status is in the CPU's runqueue and is ready to be run on the CPU when the CPU is available in light of the task's scheduling priority versus the scheduling priority of the other tasks in the CPU's runqueue. For example, task C is currently running on CPU3and tasks H, I, J, and K are stacked in the runqueue13of CPU3in order of their scheduling priority. Thus, CPU3is adapted to execute: task H after task C is executed, task I after task H is executed, task J after task I is executed, and task K after task J is executed. A task having the “sleeping” status is not in the runqueue, but will be awakened and made “ready-to-run” upon the occurrence of an event (e.g., upon completion of reading a particular data file). When a “sleeping” task is awakened and made “ready-to-run”, the awakened task is placed in its CPU's runqueue. For example, when task Q is awakened, task Q will become ready-to-run and will be placed in the runqueue13. Each CPU has a special task, called “idle” task, associated with the CPU. When there are no ready-to-run tasks in the runqueue, the task scheduler21(seeFIG. 2) will schedule the “idle” task. Normally, the idle task is a lowest priority task and will neither be present in the runqueue nor in the task table.

As seen inFIG. 1, CPU0is running task A, tasks D and E are in CPU0's runqueue10such that task D will run next followed by the running of task E, task L is sleeping, and task I0is CPU0's idle task. CPU1is running task B, tasks F and G are in CPU1's runqueue11such that task F will run next followed by the running of task G, tasks M-O are sleeping, and task I1is CPU1's idle task. CPU2is running its idle task I2, since no tasks are in CPU2's runqueue12and task P is sleeping. CPU3is running task C, tasks H-K are in CPU3's runqueue13such that the tasks in the runqueue13will be subsequently executed in the sequential order of H, I, J, and K, tasks Q-T are sleeping, and task I3is CPU3's idle task.

FIGS. 3-4illustrate removal of a CPU from a computer system comprising multiple CPUs, in accordance with embodiments of the present invention. InFIG. 3, the multiple CPUs comprise CPU0, CPU1, CPU2, and CPU3and CPU3is to be removed (e.g., CPU3may be defective). CPU0has assigned tasks T1-T2, CPU1has assigned tasks T3-T4, CPU2has assigned tasks T5-T6, and CPU3has assigned tasks T7-T8. The present invention discloses how to remove CPU3while CPU0-CPU2remain hot. Removing CPU3may comprise powering down CPU3.FIG. 4showsFIG. 3after CPU3has been removed. InFIG. 4, tasks T7-T8have been decoupled from CPU3, and will subsequently be migrated to CPU0-CPU2in accordance with a migration scheme.

FIGS. 5-6illustrate replacement of a CPU from a computer system comprising multiple CPUs, in accordance with embodiments of the present invention. InFIG. 5, the multiple CPUs comprise CPU0, CPU1, CPU2, and CPU3and CPU3is to be replaced by CPU4. CPU0has assigned tasks T1-T2, CPU1has assigned tasks T3-T4, CPU2has assigned tasks T5-T6, and CPU3has assigned tasks T7-T8. The present invention discloses how to replace CPU3by CPU4while CPU0-CPU2remain hot.FIG. 6showsFIG. 5after CPU3has been replaced by CPU4. Replacing CPU3comprises removing CPU3, which may include powering down CPU3. InFIG. 6, tasks T7-T8have been decoupled from CPU3and reassigned to CPU4.

FIG. 7illustrates moving a CPU from a first partition (i.e., partition1) to a second partition (i.e., partition2) of a computer system, in accordance with embodiments of the present invention. The two partitions1and2function as independent computer systems within an overall computer system. Thus each partition has its own operating system and CPUs. The hypervisor25manages allocation of resources between partitions, mediates data movement between the partitions, controls data access between the partitions, and protect one partition's memory from corruption by errors in other partitions. WhileFIG. 7shows only two partitions, the hypervisor25may manage a plurality of partitions.

Partition1comprises operating system OS1, the CPUs of CPU0-CPU3, and tasks X1-X10. Tasks X1-X3are assigned to CPU0, tasks X4-X6are assigned to CPU1, tasks X7-X8are assigned to CPU2, and tasks X9-X10are assigned to CPU3. Partition2comprises operating system OS2, the CPUs of CPU4-CPU7, and tasks Y1-Y16. Tasks Y1-Y4are assigned to CPU4, tasks Y5-Y8are assigned to CPU5, tasks Y9-Y12are assigned to CPU6, and tasks Y13-Y16are assigned to CPU7. A motivation in moving CPU3from partition1to partition2may be that partition2is more loaded with tasks than is partition1, so that moving CPU3from partition1to partition2effectuates load balancing.

In addition to each CPU having tasks and runqueues associated as described supra, the CPUs can have various per-CPU resources attached to them. Some of these per-CPU resources may include, inter alia, interrupts and/or memory. Such per-CPU resources need to be decoupled from a CPU that is to be removed from a computer system or from a portion of a computer system.

FIGS. 8-9depict an example of decoupling a CPU from a per-CPU resource, in accordance with embodiments of the present invention.FIG. 8shows an interrupt controller27interfacing between the devices D1-D3and the CPUs CPU0-CPU3. Thus the interrupt controller27is adapted to distribute device interrupts among all 4 CPUs, namely CPU0, CPU1, CPU2, and CPU3. The interrupt controller27serves to balance the interrupt load on each CPU.

FIG. 9shows how a counter in memory is split one per-CPU. InFIG. 9, memory28comprises counters C0-C3, and CPU0, CPU1, CPU2, and CPU3is respectively associated with counters C0, C1, C2, and C3. The counters C0, C1, C2, and C3keep track of how many interrupts (seeFIG. 8and discussion thereof supra) have been respectively processed on CPU0, CPU1, CPU2, and CPU3. If, instead of per-CPU counters, the counter were to be common for all CPUs, then each CPU would have to update the same counter at every interrupt. This would result in a “cache-line bouncing” effect, leading to performance degradation. To overcome this,FIG. 9shows a separate counter for each CPU to write to it at every interrupt. To keep track of the total count of interrupts processed in the system, the various per-CPU counters C0, C1, C2, and C3are each summed up.

During a CPU hot-remove operation in which one of the CPUs (i.e., CPU0, CPU1, CPU2, or CPU3) is removed while the other CPUs remain hot, the per-CPU resources (e.g., counters C0-C3) need to be migrated to other CPUs. During CPU hot-add operation in which a CPU is added, per-CPU resources (e.g., counters C0, C1, . . . ) need to be created or added while unaffected CPUs remain hot.

FIGS. 10-11are flow charts for describing a process that decouples a CPU from its assigned tasks, in accordance with embodiments of the present invention. For illustrative purposes, the process ofFIGS. 10-11is applied to the case of decoupling CPU3ofFIG. 1from its assigned tasks C, H-K, and Q-T. The method ofFIGS. 10-11is thus illustrated in terms of the computer system30ofFIG. 1and the operating system20ofFIGS. 1 and 2.

FIG. 10comprises steps41-48. These steps may be executed as part of a system command or a system function invoked by the system administrator to remove a CPU (seeFIG. 12). Step41sets a special flag denoting that CPU3is to be decoupled from its assigned tasks. Step41may be performed by the operating system20such as by calling the special code23(seeFIG. 2) to set the special flag. The special flag may be stored in a designated memory location within the computer system30.

Step42sets a suitable scheduling policy and priority for the idle task I3of CPU3. The suitable scheduling policy and priority chosen for idle task I3is such that it gets continuous execution time to finish steps45and48. If the scheduling policy chosen allocates time-slices for tasks, then the time-slice should be long enough so that the idle task can execute both steps45and48before the time-slice expires. Similarly, the scheduling priority chosen should be such that the idle task is not preempted by a higher priority task while the idle task is executing steps45and48. The scheduling policy chosen may be SCHED_FIFO (or it's equivalent in non-POSIX® systems) and the scheduling priority chosen may be the highest possible in the system. SCHED_FIFO policy (or its equivalent) ensures that the idle task gets to execute continuously on the CPU as long as it wants and the highest scheduling priority chosen ensures that the idle task is not preempted by another task while it is executing on the CPU. Step43adds the idle task I3in the runqueue13of CPU3, since an idle task is not present in any runqueue. The idle task may be added at the front of the runqueue, which ensures that the idle task, I3, gets to run as quickly as possible, ahead of anyone else in the runqueue. Thus idle task I3can now becomes a highest prioritized task on runqueue13that preempts running task C, causing task C to be placed at the tail end of the runqueue13of CPU3(seeFIG. 1). In case task C is already running at the highest priority possible in the system, then the idle task I3runs as soon as the task scheduler21(seeFIG. 2) schedules it. Step42may be implemented as part of the system function to remove a CPU, the system function being invoked from any executing task or from the operating system20(seeFIGS. 1 and 2). Alternatively, step42may be implemented as shown in steps51-56ofFIG. 11. In one embodiment, the operating system20invokes the special code23(seeFIG. 2) to execute, or facilitate execution of, steps51-56.

InFIG. 11, step51couples a special task Z to CPU0(or any other CPU of the computer system30). The special task Z may be created by the special code23(seeFIG. 2) after the special code23is invoked (e.g., called) by the operating system20. Alternatively, the special task Z may already exist when the special code23is invoked. Step52sets the highest scheduling priority and a suitable scheduling policy for the special task Z. The suitable scheduling policy chosen for task Z is such that it gets continuous execution time to finish steps54-56. Thus, special task Z can preempt running task A (seeFIG. 1), causing task A to be placed at the tail end of the runqueue10of CPU0. Alternately if task A is already running at the highest priority possible in the system or if there are other highest-priority tasks already queued up in the runqueue where special task Z is added, then the special task Z will have to wait for the operating system task scheduler21(seeFIG. 2) to schedule it eventually on CPU0. Step53executes the special task Z on CPU0. No other task can preempt the special task Z while the special task Z is running on CPU0, since the special task Z is running at the highest priority possible in the system. Step54sets a suitable scheduling policy and priority for the idle task I3of CPU3as indicated in step42ofFIG. 10. The suitable scheduling policy and priority chosen for I3is such that I3gets continuous execution time to finish steps45and48ofFIG. 10. Step55adds the idle task I3in the runqueue13. In step56, special task Z performs any other special job that may be required of it.FIG. 13depictsFIG. 1such that the special task Z is running on CPU0by having preempted task A due to Z's highest scheduling priority and formerly-running task A has been placed at the tail end of the runqueue10of CPU0, in accordance with embodiments of the present invention.

Returning toFIG. 10, step44executes the idle task I3on CPU3due to the idle task I3being added in the runqueue of CPU3in step43.FIG. 13shows the idle task I3running on CPU3and formerly-running task C has been placed at the tail end of the runqueue13of CPU3.

The idle task I3implements steps45-48ofFIG. 10. Step45determines whether the special flag has been set. In other words, the idle task I3needs to distinguish between the normal execution of idle task I3as triggered by the runqueue13being empty and the special execution of idle task I3as triggered by steps42-43. Note that the scheduler code21(seeFIG. 2) need not monitor the special flag.

If in step45the idle task I3determines that the special flag has not been set, then step46determines whether any tasks are in the runqueue13of CPU3. If at least one task, other than the idle task itself, is in the runqueue13, then the task scheduler21(seeFIG. 2) is invoked to schedule execution of the tasks in the runqueue13. If the runqueue13has no task therein, then the idle task I3loops to wait until a task appears in the runqueue13.

If in step45the idle task I3determines that the special flag has been set then step48decouples CPU3from its assigned tasks. The decoupling of CPU3from its assigned tasks is accomplished by removing CPU3for any purpose such as, inter alia: being removed without being replaced (see discussion supra relating toFIGS. 3-4); being removed in order to be replaced (see discussion supra relating toFIGS. 5-6); and being moved from a first partition to a second partition (see discussion supra relating toFIG. 7). As a special case, CPU3is also considered to be removed if the idle task spins forever in a tight loop (with interrupts optionally disabled), without relinquishing control of CPU3. The steps involved in actually removing the CPU are platform specific. Once CPU3is removed, CPU3can no longer execute tasks that are in its runqueue. Thus those tasks in CPU3's runqueue have been decoupled from CPU3. The decoupling of CPU3from its assigned tasks may occur while CPU0, CPU1, and CPU2remain hot. Therefore, CPU0, CPU1, and CPU2need not be powered down while CPU3is being decoupled from its assigned tasks.

FIG. 12is a flow chart having steps61-63which describe the removal of CPU3, in accordance with embodiments of the present invention.

Step61invokes command/system function to remove CPU3. The command/system function performs steps62-63.

Step62migrates tasks and/or per-CPU resources (seeFIGS. 8-9and description thereof described supra) that are assigned to CPU3. Note that the tasks which are assigned to CPU3have been decoupled from being executed on CPU3by step48ofFIG. 10. The task migration of step62results in the tasks no longer being assigned to CPU3. The command/system function may sleep until tasks and/or per-CPU resource migration is complete. In one embodiment of this invention, step62may additionally restore the scheduling policy and priority of the idle task I3to their default values, as well as take I3off the runqueue13. This will cause I3to become again a lowest priority task that is not present in the runqueue.

Step63terminates the command/system function, indicating that CPU3has been safely removed. Once CPU3has been removed, the task scheduler21of the operating system20(seeFIG. 2) will no longer assign any tasks and interrupts to CPU3. In other words, the number of CPUs that can execute tasks and process interrupts/exceptions has been reduced by one.

The steps in each ofFIGS. 10-12may be performed in any sequential order that is logically possible for decoupling a CPU from its assigned tasks and removing the CPU.

FIG. 14illustrates a computer system90used for decoupling a CPU from its assigned tasks and removing the CPU, in accordance with embodiments of the present invention. The computer system90comprises a processor91, an input device92coupled to the processor91, an output device93coupled to the processor91, and memory devices94and95each coupled to the processor91. For example, the processor91may represent any CPU discussed supra (e.g., any of the CPUs shown inFIG. 1) or any other CPU. The input device92may be, inter alia, a keyboard, a mouse, etc. The output device93may be, inter alia, a printer, a plotter, a computer screen, a magnetic tape, a removable hard disk, a floppy disk, etc. The memory devices94and95may be, inter alia, a hard disk, a floppy disk, a magnetic tape, an optical storage such as a compact disc (CD) or a digital video disc (DVD), a dynamic random access memory (DRAM), a read-only memory (ROM), etc. The memory device95includes a computer code97. The computer code97includes an algorithm for decoupling a CPU from its assigned tasks and removing the CPU. The processor91executes the computer code97. The memory device94includes input data96. The input data96includes input required by the computer code97. The output device93displays output from the computer code97. Either or both memory devices94and95(or one or more additional memory devices not shown inFIG. 14) may be used as a computer usable medium (or a computer readable medium or a program storage device) having a computer readable program code embodied therein and/or having other data stored therein, wherein the computer readable program code comprises the computer code97. Generally, a computer program product (or, alternatively, an article of manufacture) of the computer system90may comprise said computer usable medium (or said program storage device).

Thus the present invention discloses a process for deploying computing infrastructure, comprising integrating computer-readable code into the computer system90, wherein the code in combination with the computer system90is capable of performing a method for decoupling a first central processing unit (CPU) from its assigned tasks and removing the CPU.

The preceding description of the present invention describes the idle task taking over control of a CPU and decoupling it from it's assigned tasks. In another embodiment, it is possible to create a special task of suitable scheduling policy and priority and run this special task on the CPU. This special task can then decouple the CPU from its other tasks. This special task is created every time any CPU is to be decoupled from its assigned tasks and may have to perform some platform dependent steps (like powering down CPU, release CPU to other partition etc). The platform dependent steps involve calling a platform dependent function, which may not return execution control to the calling code. For example, if a function “poweroff( )” is called to power-down the CPU, then the “power_off( )” never returns control back to calling code, which makes it difficult for the special task to be terminated once its job is done. This would mean that the special task forever remains in the system, even though there is no further need for the special task.

However the same task-termination situation is not an issue for the idle task. One idle task is created per CPU at bootup time and continues to remain in the system until the system is shut down. Normally when a CPU is added to the system, the CPU starts executing at a “known” entry point in the context of its idle task. If the CPU that is removed is later replaced by a new CPU, then the new CPU can start executing in the context of the same idle task at the “known” entry point. Hence there is no need to terminate the idle task after removing a CPU.