Apparatus and method for managing virtual processing unit

A method and apparatus for managing a virtual processor including resources for operating application through a real central processing unit, which includes determining a utilization of a plurality of real CPUs to which a plurality of virtual processors are divided to be allocated; and repartitioning the virtual processors and reallocating the repartitioned virtual processor to at least part of the real CPUs, when the utilization of any one of the real CPUs is at a threshold or less.

PRIORITY

This application claims priority under 35 U.S.C. §119(a) to an application filed in the Korean Intellectual Property Office on Oct. 1, 2009 and assigned Serial No. 10-2009-0093696, the contents of which are incorporated herein by reference.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates generally to an apparatus and a method for a virtualization, and more particularly, to an apparatus and a method for managing a virtual processor including resources for operating an application through a hardware.

2. Description of the Related Art

Generally, an Operating System (OS) provides an interface between hardware and various applications in various signal processing apparatuses. That is, the OS manages resources for operating applications through the hardware. Moreover, the virtual interface between the hardware and each application is implemented in the OS through virtualization. Currently, virtualization implements a plurality of virtual processors by dividing resources for each application, and allocates them to the hardware. However, in the signal-processing unit, virtual processors are statically allocated or dynamically allocated to the hardware. Thus, in the static allocation of the virtual processors, stability can be guaranteed and a relative high-speed operation speed can be obtained when a signal-processing unit operates applications. However, a problem arises in that the virtual processor has a low efficiency in use. And, in the dynamic allocation of the virtual processors, the efficiency of use of the virtual processor can be improved in the signal-processing unit. However, there is a problem in that it is difficult to secure stability in operating applications and the operating speed is decreased. Accordingly, it is difficult to guarantee the performance capability of a given level in the signal-processing unit. This problem becomes more serious when a plurality of operating systems are driven in the signal-processing unit.

SUMMARY OF THE INVENTION

The present invention has been made in view of at least the above-described problems, and provides a method for managing a virtual processor consisting of resources for operating an application through an actual processor.

In accordance with an aspect of the present invention, a method of managing a virtual processor including resources for operating application through a real Central Processing Unit (CPU) includes: determining a utilization of a plurality of real CPUs to which a plurality of virtual processors are divided to be allocated; and repartitioning the virtual processors and reallocating the repartitioned virtual processor to at least part of the real CPUs, when the utilization of any one of the real CPUs is at a threshold or less.

In accordance with another aspect of the present invention, an apparatus of managing a virtual processor includes: a plurality of virtual processors, which are comprised of resources for operating respective applications: a plurality of real CPUs to which the plurality of virtual processors are divided to be allocated; a controller, which determines a utilization of the real CPUs; and a virtualization manager which repartitions the virtual processors and reallocates the repartitioned virtual processor to at least part of the real CPUs, when the utilization of any one of the real CPUs is at a threshold or less.

Accordingly, the virtual processor management apparatus and method can repartition virtual processors in the virtual processor management apparatus according to the utilization of the processors, and can reallocate them to processors. That is, in the virtual processor management apparatus, virtual processors between non-real-time processors can be merged, or virtual processors between a non-real-time processor and a real-time processor can be merged. Thus, in the virtual processor management apparatus, the utilization of the processors can be actually guaranteed with a given level. Additionally, in the merge of virtual processors, the power of part of the processors is controlled, so that the power consumption can be decreased in the virtual processor management apparatus. Accordingly, in the signal-processing unit, including a virtual processor management apparatus, the performance capability can be guaranteed with a given level.

DETAILED DESCRIPTION OF EMBODIMENTS OF THE INVENTION

FIG. 1is a block diagram illustrating a configuration of a virtual processor management apparatus according to an embodiment of the present invention.FIG. 2is a diagram illustrating a virtual processor management technology according to an embodiment of the present invention. Currently, in the present embodiment, it is assumed that a virtual processor management apparatus is mounted within a signal-processing unit.

Referring toFIG. 1, the virtual processor management apparatus100of the embodiment includes a hardware110, a virtualization monitor120, a virtualization manager130, and an operating system140. The hardware110includes a plurality of real CPUs111and a controlling unit113. The real CPUs111substantially perform the function of operating applications. This real CPUs111can include at least one real-time processor for processing a signal at the point of time of occurrence and a plurality of non-real-time processors for accumulating and processing a signal generated for a given time interval. The real CPUs111are made of physical resources such as processor, memory, input-output device, and network card. The controlling unit113controls the real CPUs111. Specifically, the controlling unit113controls the power of real CPUs111. That is, the controlling unit113is able to drive at least one of the real CPUs111by supplying power thereto, and likewise is able to stop the power supply to at least one of the real CPUs111.

More specifically, the controlling unit113converts at least one of the real CPUs111into a sleep mode to stop driving. Moreover, the controlling unit113periodically determines the utilization of real CPUs111. The virtualization monitor120divides the real CPUs111by application. That is, the virtualization monitor divides physical resources into virtual resource for each application. For Example, the virtualization monitor120can divide the physical resources of one real CPU into virtual resources for at least one application. Here, the virtualization monitor120can be a Virtual Machine Monitor (VMM) or a hypervisor.

The virtualization manager130maps virtual resources to the real CPUs111. That is, the virtualization manager130allocates virtual resources for each application to the real CPUs111, and the virtualization manager130determines the utilization of virtual resources. The virtualization manager130can determine the utilization of virtual resources in respective real CPUs111in consideration of the occupancy of virtual resources for each application. Moreover, the virtualization manager130determines the reallocation of virtual resources according to the utilization of real CPUs111.

Referring toFIG. 2, the virtualization manager130can compare the utilization of real CPUs111with preset reference values, that is, limits and a threshold. Here, the virtualization manager130additionally considers the utilization of virtual resources, so that it can decide the reallocation of virtual resources. Moreover, the virtualization manager130can reallocate virtual resources. That is, the virtualization manager130can merge virtual resources of the plurality of real CPUs111into one real CPU111, or can divide virtual resources of one real CPU111into the plurality of real CPUs111.

The OS140includes a plurality of virtual processors141, a non-real-time operating unit143, and a real-time operating unit145. Virtual processors141map virtual resources according to each application. The virtual processors141can correspond to applications on a one-to-one basis, are made of a plurality of virtual tasks for each application, and virtual resources for each application constitute each virtual task.

Thereafter, virtual processors141are allocated to the real CPUs111. Here, the virtual processors141are allocated to at least one of the non-real-time processor and the real-time processor unit in the real CPUs111. The non-real-time operating unit143uses virtual processors141to provide an interface between the non-real-time processors and applications in the real CPUs111. The real-time operating unit145uses virtual processor141to provide an interface between the real-time processors and applications in the real CPUs111.

As described above, the virtual processor management apparatus100according to an embodiment of the present invention repartitions the virtual processors141according to the utilization of real CPUs111and can reallocate it to the real CPUs111.

FIG. 3is a flowchart illustrating a virtual processor management process according to an embodiment of the present invention.

Referring toFIG. 3, when the virtualization period is initiated, the controlling unit113senses it, and starts to determine the utilization according to the real CPU111in step313. When a plurality of virtual processor141are divided for allocation to the real CPUs111, the controlling unit113can determine the utilization of real CPUs111. The controlling unit113previously stores the virtualization period according to a preset given time interval, and performs functions based on the virtualization period.

Here, if the number of the real CPUs111is K, an index N can be given to the real CPUs111with 0 to K−1. Alternatively, in the real CPUs111, an index may not be given to the real-time processor, but index can be limitedly given to the non-real-time processor. That is, when the number of non-real-time processors is K, an index can be given to the non-real-time processors with 0 to K−1.

In step315, the controlling unit113decides one of the real CPUs111. At this time, one of the real CPUs111corresponds to the index of 0. The controlling unit113determines whether a merge period is elapsed in one of the real CPUs111in step317. At this time, the controlling unit113stores the merge period according to the preset given time interval, and the merge period is applied from a different point of time for each real CPU111. Here, the merge period can be made of a time interval, which is longer than at least one virtualization period, and can be made of a different time interval for each real CPU111. Then, when it is determined that the merge period is elapsed in one of the real CPUs111in step317, the controlling unit113compares one utilization of the real CPUs111with a preset threshold (as illustrated inFIG. 2) in step319.

When it is determined that the utilization of one of the real CPUs111exceeds the threshold in step319, the controlling unit113maintains virtual processors141through the virtualization manager130in step321. That is, the controlling unit113and the virtualization manager130maintain the state where virtual processors141are allocated to the real CPUs111. Alternatively, when it is determined that the utilization of one of the real CPUs111is at the threshold or less at step319, the controlling unit113merges virtual processors141through the virtualization manager130in step323. At this time, the controlling unit113and the virtualization manager130repartition the virtual processors141and reallocate it to the real CPUs111.

FIG. 4is a flowchart illustrating a virtual processor merge process ofFIG. 3.

Referring toFIG. 4, when it is determined that the utilization of one of the real CPUs111is at the threshold or less in step319, the controlling unit113compares the utilization of one of the real CPUs111and preset limits as shown inFIG. 2in step411. Referring toFIG. 2, the controlling unit113checks whether the utilization of one of the real CPUs111belongs to an area ‘A’ ranging from 0 to the preset limits. Alternatively, referring toFIG. 2, the controlling unit113checks whether the utilization of one of the real CPUs111belongs to an area ‘B’ ranging from the limits to the threshold. Then, when it is determined that the utilization of one of the real CPUs111is the threshold or less in step411, the controlling unit113determines two real CPUs111from the hardware110in step413. When the utilization of one of the real CPUs111ranges from 0 to the limit, the controlling unit113excludes one of the real CPUs111from the hardware110. The controlling unit113can further exclude another real CPUs111in which the merge period is not elapsed from the hardware110. Moreover, the controlling unit113determines two real CPUs111having lowest utilization among the rest real CPUs111.

When it is determined that the utilization of one of the real CPUs111exceeds limits in step411, the controlling unit113determines another real CPU111from the hardware110in step415. That is, when the utilization of one of the real CPUs111belongs to the area ‘B’, the controlling unit113excludes one of the real CPUs111from the hardware110. The controlling unit113can further exclude the other real CPUs111in which the merge period is not elapsed from the hardware110. Moreover, the controlling unit113determines another one having the lowest utilization among the rest real CPUs111. In step417, the controlling unit113produces a result value by adding the utilization of one of the real CPUs111to the utilization of at least one of the others. The controlling unit113compares the result value with a given predetermined allowable value in step419. At this time, when it is determined that the result value is an allowable value or less in step419, the controlling unit113reallocates the virtual processors141of one and at least another one the real CPUs111to one of the real CPUs111in step421. That is, the virtualization manager130elects one or at least another one of the real CPUs111, so that the virtual processors141of the one and at least another one of the real CPUs111are transferred to the elected real CPU111among one and at least another one the real CPUs111.

In step423, the controlling unit113controls the power of one or at least another one of the real CPUs111. That is, the controlling unit113turns the power off corresponding to the non-elected real CPU111among one and at least another one the real CPUs111by using the power supply. In step425, the controlling unit113stops the merge of virtual processor141in one of the real CPUs111or at least another one at current time, and returns toFIG. 3. The controlling unit113monitors the elapsed time from current time. Moreover, although not shown, when the merge period expires, the controller141re-supplies the power to the non-elected real CPU111to turn on.

When it is determined that the result value exceeds the allowable value in step419, the controlling unit113returns toFIG. 3. That is, the controlling unit113determines that it impossible to merge one of the real CPUs111with at least another one virtual processor141. The controlling unit113maintains the state where virtual processors141are allocated to the real CPUs111through the virtualization manager130.

In the meantime, in the present embodiment, it was illustrated that the controlling unit113reallocates one of the real CPUs111and at least one another virtual processor141to one of the real CPUs111and at least one of the others. However, the present invention is not limited to this. Although the controlling unit113does not selectively merge the virtual processors141from at least two among the real CPUs111, the present invention can still be implemented.

For example, although not shown, when the utilization of one of the real CPUs111exceeds preset limits, the controlling unit113compares the number of virtual processors141in the operating system140with the number of the real CPUs111in the hardware110. When the number of virtual processors141exceeds the number of the real CPUs111, the controlling unit113merges at least part of the virtual processors141so that the number of the virtual processors141may be identical to the number of the real CPUs111. The controlling unit113can perform a grouping for the virtual processors141according to a certain rule. Here, the controlling unit113may store a rule for performing a grouping based on the utilization of the virtual processor141.

Moreover, because there is the same number of virtual processors141and real CPUs111are constituted by the same number, the controlling unit113corresponds the virtual processors141to the real CPUs111on a one-to-one basis and reallocates each of the virtual processors141to each of the real CPUs111. Thereafter, the controlling unit113controls respective operating frequencies of the real CPUs111, and returns toFIG. 3. At this time, the controlling unit113can apply Dynamic Voltage and Frequency Scaling (DVFS) function.

When it is determined that the merge period has not elapsed in one of the real CPUs111in step317, the controlling unit113determines another one among the real CPUs111in step325.

Alternatively, after maintaining virtual processor141in step321, or merging the virtual processors141at step323, the controlling unit113determines another one among the real CPUs111at step325. The controlling unit113increases the index corresponding to one of the real CPUs111as much as 1, can determine another one of corresponding indices in the real CPUs111. In step327, controlling unit113determines whether another one exists in the real CPUs111.

That is, the controlling unit113determines whether the decision of the merge or maintaining of virtual processor141is completed in all real CPUs111of the hardware110. At this time, when it is determined that another one exists among the real CPUs111in step327, the controlling unit113repeatedly performs steps317to327. Moreover, when it is determined that another one does not exist among the real CPUs111at step327, the controlling unit113terminates the virtual processor141management process. Although the present embodiment has been described with the controlling unit113merge into at least two virtual processors141among the real CPUs111according to the utilization of one of the real CPUs111, however, the present invention is not limited to this. That is, the present invention can be implemented in such a manner that the controlling unit113separates the virtual processors141into at least two of the real CPUs111according to the utilization of one of the real CPUs111. For example, when the utilization of one of the real CPUs111is a preset separation value or more, the controlling unit113can determine at least another one having the lowest utilization among the real CPUs111. Then, the controlling unit113separates a part of one virtual processor141of the real CPUs111into at least another one of the real CPUs111and can transfer.

FIG. 5is a flowchart illustrating a virtual processor management process according to another embodiment of the present invention.

Referring toFIG. 5, when the virtualization period is initiated in step511, the controlling unit113senses it, and starts to determine the utilization of a real-time processor in the real CPUs111in step513. At this time, in the state where a plurality of virtual processor141are divided to be allocated to the real CPUs111, the controlling unit113can determine the utilization of the real-time processor. And the controlling unit113previously stores the virtualization period according to a preset given time interval, and performs function based on the virtualization period.

In step515, the controlling unit113compares the utilization of the real-time processor with a preset threshold as shown inFIG. 2. When it is determined that the utilization of the real-time processor is at a threshold or less in step515, the controlling unit113performs the process of merging the virtual processors141through the virtualization manager130in step517. That is, the controlling unit113and the virtualization manager130repartition the virtual processors141of the non-real-time processors and reallocate it to the real-time processor. Then, the controlling unit113terminates the management process of the virtual processor141.

FIG. 6is a flowchart illustrating a virtual processor merge process of step517in more detail.

Referring toFIG. 6, when it is determined that the utilization of one of the real-time processor is the threshold or less in step515, the controlling unit113compares the utilization of the real-time processor and preset limits as illustrated inFIG. 2at step611. The controlling unit113checks whether the utilization of the real-time processor belongs to an area ‘A’ (FIG. 2) ranging from 0 to the limits. Alternatively, the controlling unit113checks whether the utilization of the real-time processor belongs to an area ‘B’ (FIG. 2) ranging from the limits to the threshold.

When it is determined that the utilization of the real-time processor is the threshold or less at step611, the controlling unit113determines the utilization according to the non-real-time processor in the real CPUs111in step613. Where a plurality of virtual processors141are divided for allocation to the real CPUs111, the controlling unit113can determine the utilization of non-real-time processor. Thereafter, the controlling unit113determines one non-real-time processor of the real CPUs111in step615. That is, when the utilization of the real-time processor ranges from 0 to a threshold, the controlling unit113determines any one of the non-real-time processor having the lowest utilization among the real CPUs111. In step617, the controlling unit113produces a result value by adding the real-time processor to the utilization of any one of the non-real-time processor respectively.

When it is determined that the utilization of the real-time processor exceeds a threshold in step611, the controlling unit113determines the utilization according to virtual processor141through the virtualization manager130in step619. The controlling unit113can determine the utilization of each virtual processor141corresponding to the non-real-time processor. That is, the controlling unit113determines the utilization according to the non-real-time processor, can determine the utilization of the virtual processor141by using the occupancy classified by virtual processor141in respective non-real-time processor. Then, the controlling unit113determines two of the virtual processors141in step621.

At this time, the controlling unit113determines two virtual processors having the lowest utilization in the virtual processors141. The controlling unit113distributes virtual tasks from two of the virtual processors141through the virtualization manager130in step623. That is, the virtualization manager130transfers a part of one virtual task of two virtual processors141to the rest of the virtual processors141. Here, the rest of the virtual processors141correspond to one of the non-real-time processors. Moreover, the controlling unit113produces the result value by adding the utilization of the real-time processor to each utilization of the other two virtual processors141in step625.

In step627, the controlling unit113compares the result value with a given allowable value. At this time, when it is determined that the result value is the allowable value or less at step627, the controlling unit113reallocates one virtual processor141of the non-real-time processors through the virtualization manager130in step629. When a plurality of virtual processors141are allocated any one of the non-real-time processors, the controlling unit113can reallocate at least one of any one virtual processors141among the non-real-time processor. After the controlling unit113receives a priority with respective virtual processors141of the real-time processor through the virtualization manager130, the process returns toFIG. 5in step631. That is, the controlling unit113receives a priority according to the order allocated to the real-time processor among the virtual processors141. For example, the controlling unit113can receive a low priority when the order allocated to the real-time processor is late.

When it is determined that the result value exceeds the allowable value at step627, the process113returns toFIG. 5. That is, the controlling unit113determines that it is impossible to merge the virtual processors141of the real-time processor and the non-real-time processor in the real CPUs111. The controlling unit113maintains the state where virtual processors141are allocated to the real CPUs111through the virtualization manager130.

When it is determined that the utilization of the real-time processor exceeds a threshold in step515, the controlling unit113compares the utilization of the real-time processor with a preset return value in step519. Here, the controlling unit113stores the return value which is set higher than a threshold. When it is determined that the utilization of the real-time processor is a return value or more at step519, the controlling unit113determines whether the merge of the virtual processor141with the real-time processor is accomplished from the non-real-time processor through the virtualization manager130in step521. And when it is determined that the merge of the virtual processor141with the real-time processor is accomplished, the controlling unit113returns the virtual processor141from the real-time processor to the non-real-time processor in step523. Then, the controlling unit113terminates the management process of virtual processor141.

When it is determined that the utilization of the real-time processor is below a return value in step519, or the merge of the virtual processor141with the real-time processor is not accomplished, the controlling unit113maintains the virtual processor141through the virtualization manager130in step525. That is, the controlling unit113and the virtualization manager130maintain the state where virtual processors141are allocated to the real CPUs111.

According to an embodiment of the present invention, the virtual processors are repartitioned in the virtual processor management apparatus according to the utilization of the real CPUs and can reallocate it to the processors. That is, in the virtual processor management apparatus, the virtual processors between the non-real-time processor can be merged, or the virtual processors between the non-real-time processor and the real-time processor can be merged. Accordingly, in the virtual processor management apparatus, the utilization of the real CPUs can be guaranteed with a certain level. Furthermore, merging the virtual processors, the power of a part of the real CPUs is controlled, so that the power consumption can be reduced in the virtual processor management apparatus. Accordingly, in a signal-processing unit including a virtual processor management apparatus, the performance capability can be guaranteed with a specific level.