CN102662763A - Virtual machine resource scheduling method based on service quality - Google Patents
Virtual machine resource scheduling method based on service quality Download PDFInfo
- Publication number
- CN102662763A CN102662763A CN2012101042214A CN201210104221A CN102662763A CN 102662763 A CN102662763 A CN 102662763A CN 2012101042214 A CN2012101042214 A CN 2012101042214A CN 201210104221 A CN201210104221 A CN 201210104221A CN 102662763 A CN102662763 A CN 102662763A
- Authority
- CN
- China
- Prior art keywords
- processor
- virtual
- virtual processor
- queue
- jump
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Landscapes
- Multi Processors (AREA)
Abstract
The invention discloses a virtual machine resource scheduling method comprising the following steps: (1) carrying out initialization; (2) obtaining the attribute of a current virtual processor in the virtual machine and judging the state of the virtual processor according to the obtained attribute; (3) processing virtual processors in an additional queue; (4) processing virtual processors in an common queue; (5) updating the common queue; (6) selecting one virtual processor to operate from the common queue; and (7) judging whether the idle time of a physical processor is greater or equal to a threshold value; if not, operating an idle process; if so, further judging whether a high priority additional queue is null, if not, selecting the virtual processor at the head of the queue, if so, judging whether a low priority additional queue is null, if not, selecting the virtual processor at the head of the queue, and if so, operating the idle process. The virtual machine resource scheduling method can enable the I/O (input/output) response delay on the virtual machine to be controllable in a complex application environment and support load balancing among multiple processors.
Description
Technical field
The present invention relates to the scheduling virtual machine technical field in virtual, be specifically related to a kind of resources of virtual machine dispatching method.
Background technology
The rapid zone of swelling of the widespread use of x86 processor and scale is served the difficult problem of architecture: the utilization factor of computer resource is low excessively; The cost of basic physics facility increases day by day; The cost of IT resource management, maintenance is constantly soaring.The application of Intel Virtualization Technology has effectively promoted the utilization ratio of hardware device, and then greatly reduces the cost and the expense of computational resource.
When a plurality of dummy machine systems share to use bottom hardware, the scheduling of resource must be satisfied fair and principle efficiently.At present, the hardware resource management and the distribution method of virtual platform depend on scheduler, and to different application and load, each scheduler can not mate and dispatch preferably how rationally, effectively, distribute hardware resource to be still a very big difficult problem.
Common dispatching method of virtual machine have virtual time use, the earliest closing time preferential and based on the dispatching method of credit value.The virtual time borrowing method is introduced virtual time thought in the middle of the process scheduling, will be divided into actual time and virtual time the time.Wherein, be the time value that hardware timer shows actual time; The time value of virtual time for obtaining after the real time is calculated through certain rule, the execution that this method is come monitoring process with virtual time, each scheduling always has the process between efficient virtualized time the earliest.Current, the virtual time borrowing method exists can not guarantee the fair shared processing device of process problem of resource when on multiprocessor, moving.
Based on the credit value dispatching method for each Client OS be provided with doublet (weight, cap), weight representes weight, cap representes the upper limit.The ratio of weight determines them to take the ratio of processor timeslice separately between the Client OS; And the upper limit determines a Client OS to take the maximal value of processor time; Such as cap=50; It is free that the expression Client OS can only take the institute of half concurrent physical processor at most; It is free that cap=100, expression Client OS can take the institute of a concurrent physical processor at most.Method based on credit value is divided into two formations with each virtual processor, under formation and over formation, and it only dispatches the virtual processor in the under formation.Begin most all virtual processors all in the under formation; The initial credit value of each virtual processor is its corresponding weighted value, and when virtual processor was scheduled, the credit value that this virtual processor is corresponding just was reduced; When credit value when negative; This virtual processor just is placed into the over formation, and when all virtual processors were all in the over formation, the credit value dispatching method added the value of initial weight in proportion for all virtual processors; And the corresponding virtual processor put in the under formation, go round and begin again.Advantage based on the credit value method: it can distribute to each virtual processor efficiently with processor time justice, and can realize load balancing; Shortcoming based on the credit value method: in the application that response speed is had relatively high expectations, it is closely related that postpone queue position residing with it time response, and general length of operating lag and fluctuation are obviously.
Reference factor when closing time, the mode of priority was scheduled as it for deadline of each virtual processor setting the earliest.When dispatching, scheduler program is with priority scheduling deadline virtual processor the earliest.This mode can be passed through their priority of parameter adjustment of each virtual processor of configuration, and the scheduling of I/O intensive applications is better than other two dispatching methods; But it can only carry out the scheduling of mode of priority closing time the earliest to each concurrent physical processor respectively; When a plurality of concurrent physical processors are on same machine; This method can not be accomplished load balancing preferably, and when system overload, its handling capacity will sharply descend.
Summary of the invention
The object of the invention is to realize the quality-of-service based resources of virtual machine dispatching method under a kind of multicore architecture, through the reasonable distribution of task, satisfies the characteristic of multi-core environment load balancing, reduces the I/O request responding time, satisfies the demand of service quality control.
In order to achieve the above object, the technical scheme of the present invention's employing is:
A kind of quality-of-service based resources of virtual machine dispatching method is used for the virtual machine virtual processor is dispatched, and specifically may further comprise the steps:
(1) initialization
At first, for each virtual processor tlv triple (slice, a period are set; Extra), wherein, parameter s lice; Period referred at period in the time cycle, and virtual processor moves the slice duration at least, and (unit: millisecond), extra is a flag; When extra is 1, if represent that at period concurrent physical processor still has free time in the time cycle; Allow virtual processor to take these free time, when extra is 0, then do not allow virtual processor to take these free time.
Then; At each concurrent physical processor common queue and extra formation are set; Wherein, the element in the common queue is all virtual processors in the concurrent physical processor, and the element of extra formation is 1 virtual processor for its tlv triple parameter extra; Wherein this extra formation is two; Be extra formation of low priority and the extra formation of high priority, the extra formation of low priority refers to that its element is the extra formation that is arranged in the virtual processor in client territory (domainU), and the extra formation of high priority refers to that its element is the extra formation that is arranged in the virtual processor of management domain (domainO).
(2) obtain the relevant information of current virtual processor, judge whether to be null process according to these information, if be not null process; But judge whether it is running status; But if running status, and according to whether being being for further processing of operation extra time, if in operation extra time; Jump to step (2), otherwise jump to step (3).
Which (3) at first obtain in extra formation; All running marks in the mode bit are all removed; Add up the time of extra operation and carried out load balancing to T.T. of current time operation (judging the busy extent of virtual processor according to this variable) as the index of load balancing from last time.The current virtual processor of deletion from extra formation.
If current virtual processor is in the extra formation of high priority, all information of resetting are checked the information of upgrading extra formation then; If current virtual processor in the extra formation of low priority, recomputates the value of score.When extra queuing message is upgraded in inspection, if but current virtual processor is in running status, just with its value that joins extra formation and upgrade the score of other virtual processors.Otherwise this virtual processor of deletion from all formations.When upgrading the value of score, upgrade according to the score value of current virtual processor last time, the score of other virtual processors all deducts the score value of current virtual processor, and purpose is in order to improve the priority of other virtual processors.
(4) the statistics virtual processor carried out the T.T. (be used for load balancing busy factor setting) of load balancing to current time operation from last time, if but the timeslice of current virtual processor also do not use up and still be in running status, jump to step (4).Otherwise current virtual processor is deleted from common queue, but judged whether current virtual processor is in running status, if but be in running status, be inserted in the waiting list, otherwise, it is deleted from extra formation.
(5) traversal waiting list and operation queue according to the time that cycle of virtual processor begins, put into different formations with virtual processor, and the cycle begins, and puts in the operation queue, and the cycle does not also begin, and then puts in the waiting list.If missed deadline, then increase one-period, and whether begin according to the cycle, put it into waiting list or operation queue.
(6) from operation queue or waiting list, select a virtual processor.If virtual processor is arranged in the operation queue, the virtual processor of then selecting to be in the formation head is put on the concurrent physical processor and is carried out, and the Time Calculation mode that can carry out is following:
ret.time=MIN(now+slice-cputime,PERIOD_BEGIN(waitq))-now (1)
Ret.time is the time that this execution of virtual processor can take concurrent physical processor; Now is the current time; MIN () is for obtaining minimum value; Slice is the timeslice that virtual processor distributes; The time of cputime in current period, having moved; PERIOD_BEGIN (waitq) is the time of cycle early start in the waiting list.
If operation queue is empty, and waiting list is not empty, whether the operation queue of then inquiring about other concurrent physical processors has virtual processor, if having, moves to current concurrent physical processor and execution; If no, jump to (6); If waiting list also is empty, whether the waiting list of then inquiring about other concurrent physical processors has virtual processor, if having, moves to current concurrent physical processor and execution; If no, then carry out null process.
(6) if concurrent physical processor free time less than 500 milliseconds, is directly moved null process, otherwise from extra formation, select a virtual processor to carry out.
(7) finish.
After management and running a period of time, the unbalanced situation of formation load on each concurrent physical processor may appear, can carry out the load balance process of the overall situation.Wherein GSLB is controlled by timer, specifically can be divided into following step:
(I) total run time of each concurrent physical processor in the set time reset to zero.
(II) add up the total run time of each concurrent physical processor in the set time (cycle length of timer), i.e. the operation T.T. of all virtual processors on the concurrent physical processor.At first obtain the operation T.T. of each virtual processor, then all virtual processor operations in operation queue and the waiting list are added up T.T., just obtain the operation T.T. of concurrent physical processor.
(III) busy factor busy_state is set, confirms the state of concurrent physical processor.A busy factor is set for each concurrent physical processor, is used for showing present concurrent physical processor is in which kind of state (totally three kinds of states: idle condition, task status, busy state are arranged).T.T. pcpu_cputime that the busy factor is moved in timer cycle by concurrent physical processor and the ratio of timer cycle TIME_PERIOD confirm that setting timer cycle is 1 second.
(IV) the source concurrent physical processor and the target physical processor of definite migration move to realize load balancing.
As further improvement of the present invention, the detailed process of described step (IV) is:
(A) according to the busy extent of each concurrent physical processor; Be recorded in each concurrent physical processor numbering respectively in b_idle bitmap, b_task bitmap, the b_busy bitmap, wherein the b_idle bitmap is corresponding be idle condition, b_task bitmap corresponding be have task status and b_busy bitmap corresponding be busy state;
(B) judge that whether the b_busy bitmap is empty, if be empty, jumps to (C); Otherwise the concurrent physical processor that common queue length is the longest in the selection b_busy bitmap is as the source concurrent physical processor that moves and jump to (D);
(C) judge that whether the b_task bitmap is empty, if be empty, jumps to (I); Otherwise the concurrent physical processor that common queue length is the longest in the selection b_task bitmap is as the source concurrent physical processor that moves and jump to (D);
(D) judge that whether the b_idle bitmap is empty, if be empty, jumps to (E); Otherwise first concurrent physical processor in the selection b_idle bitmap is as migration target physical processor and jump to (G);
(E) judge that whether the b_task bitmap is empty, if be empty, jumps to (F); Otherwise the concurrent physical processor that common queue length is lacked most in the selection b_task bitmap is as the target physical processor that moves and jump to (G);
(F) judge that whether the b_busy bitmap is empty, if be empty, jumps to (I); Otherwise the concurrent physical processor that common queue length is lacked most in the selection b_busy bitmap is as the target physical processor that moves and jump to (G);
Whether the busy factor of (G) judging the source concurrent physical processor more than or equal to the busy factor of target physical processor, if more than or equal to, jump to (H); Otherwise jump to (I);
(H) migration source concurrent physical processor and the target physical processor confirmed according to the front move, and finish.
(I) do not have suitable migration source or target physical processor, then be left intact, finish;
(V) between source processor and purpose processor, move: the queue length of obtaining migration source and destination concurrent physical processor; Concurrent physical processor moves a virtual processor from the source successively; And the queue length of calculation sources and target physical processor again; If the difference of the queue length of the queue length of source concurrent physical processor and target physical processor is less than 2, then migration finishes;
The present invention can make that the I/O operating lag on the virtual machine is controlled in the complicated applications environment, support the load balancing between multiprocessor.
Description of drawings
Fig. 1 is a whole scheduling flow synoptic diagram among the present invention.
Fig. 2 is that common queue is selected schematic flow sheet among the present invention.
Fig. 3 is a GSLB schematic flow sheet among the present invention.。
Embodiment
Be elaborated below in conjunction with the accompanying drawing specific embodiments of the invention.
The present invention proposes quality-of-service based resources of virtual machine dispatching method under a kind of multicore architecture, this method satisfies the characteristic of multi-core environment load balancing through the reasonable distribution of task, reduces the I/O request responding time, satisfies the demand of service quality control.
Detailed process is following:
(1) initialization
At first, (extra), wherein, slice, period are that (unit: millisecond), round numerical value, be illustrated in the time cycle period, virtual processor moves duration slice to time parameter at least for slice, period for each virtual processor is provided with a tlv triple.Extra is a flag, when extra is 1, if represent that at period concurrent physical processor still has free time in the time cycle, allows virtual processor to take these free time, when extra is 0, does not then allow virtual processor to take these free time.
Then; Each concurrent physical processor is provided with common queue and extra formation; Wherein, the element in the common queue is all virtual processors in the concurrent physical processor, and the element of extra formation is 1 virtual processor for its tlv triple parameter extra; Wherein this extra formation is two; Be extra formation of low priority and the extra formation of high priority, the extra formation of low priority refers to that its element is the extra formation that is arranged in the virtual processor in client territory (domainU), and the extra formation of high priority refers to that its element is the extra formation that is arranged in the virtual processor of management domain (domainO).
Virtual machine is divided into client territory virtual machine and management domain virtual machine, and the management domain virtual machine can directly be visited bottom hardware, and client territory virtual machine need pass through management domain virtual machine dereference bottom hardware.
(2) obtain the attribute of current virtual processor (Curr) in the virtual machine, comprise virtual machine ID and status attribute (status), and according to the state of the determined property virtual processor that obtains.
(2.1) the virtual machine ID according to this virtual processor judges whether virtual machine is empty, thereby judges whether this virtual processor is null process.(virtual machine ID is IDLE_DOMAIN_ID, representes this virtual machine for empty, and promptly the corresponding virtual processor is a null process.) if current virtual processor is null process, then current virtual processor is left intact, because it is a null process, jump to step (4), otherwise jump to step (2.2).
(2.2) according to the status attribute (status) of virtual processor; Judge whether current virtual processor is that (but each virtual processor all has a status attribute to running status; Different values is identifying the virtual processor different state), whether promptly current virtual processor is in halted state, if be in halted state; Its state is set to sleep state, and it is the current time that the time of blocking beginning is set simultaneously.Jump to step (2.3).
(2.3) judge according to the status attribute (status) of virtual processor whether current virtual processor is to move in extra time (being the free time of concurrent physical processor); If move in extra time; Then extra is 1; This current virtual processor of surface jumps to step (2), otherwise jumps to step (3) in extra formation.
(3) virtual processor in the extra formation is handled
(3.1) the status attribute bit of replacement virtual processor; The working time of adding up current virtual processor, (be the time of having moved in the cycle at period this working time; Itself and slice are compared; Thereby determined whether to move the long time of slice), time of extra operation and carried out load balancing to T.T. of current time operation (judging the busy extent of virtual processor according to this variable) as the index of load balancing from last time.The current virtual processor of deletion from extra formation;
(3.2) confirm that current virtual processor is in the extra formation of high priority in the extra formation,, otherwise jump to step (3.4) if current virtual processor in the extra formation of high priority, jumps to step (3.3).
(3.3) (score value representation virtual processor is in the priority of certain extra formation to upgrade the score value of current virtual processor in the extra formation of high priority; The score value is low more; Priority is high more; Virtual processor has different score values in the extra formation of difference), the computing method of the score value in the extra formation of high priority be score=period<<10/slice, jump to (3.5).
(3.4) upgrade the score value of current virtual processor in the extra formation of low priority, the computing method of the score value in the extra formation of low priority are: score=1<<17.Jump to (3.5).
(3.5) but the inspection current virtual processor whether be in running status; But if be in running status; Then it is inserted into corresponding extra formation again; And the score value of upgrading its other all virtual processors that belong to extra formation (is the score value that the score value of other all virtual processors deducts current virtual processor respectively; Purpose is in order to promote the priority of other virtual processors in extra formation), if but be not in running status, current virtual processor is deleted from common queue.
(4) virtual processor in the common queue is handled
(4.1) the statistics virtual processor carried out the T.T. (be used for load balancing busy factor setting) of load balancing to the current time operation from last time;, jump to step (5) if but the timeslice of current virtual processor does not also use up and still is in running status.Otherwise, jump to step (4.2).
(4.2) current virtual processor is deleted from common queue; Judge but whether current virtual processor is in running status; But if be in running status, be inserted in the common queue, otherwise; It is deleted from extra formation, if current virtual processor is present in just deletion of extra formation.Jump to step (5).
(5) upgrade common queue, wherein common queue is divided into waiting list and operation queue.Operation queue is to be positioned at current time part before the start time of time cycle period in the common queue, and waiting list is to be positioned at current time part afterwards the start time of time cycle period in the common queue.
(5.1) at first upgrade waiting list: traversal is searched waiting list; Whether the cycle of judging the virtual processor in the waiting list begins; If the cycle begins, virtual processor is extractd from waiting list, and according to being inserted in the operation queue by the time limit; If do not begin, jump out traversal, jump to (5.2).Wherein deadline refers in time cycle period, begin the moment of carrying out the latest.
(5.2) upgrade operation queue: the traversal operation queue judges whether to have missed deadline, if missed deadline; It is extractd from operation queue, then deadline is postponed a time cycle period, continue next to judge whether the cycle begins; If the cycle begins; Just it is inserted in the operation queue again,, just is inserted in the waiting list if there is not the cycle not begin.
(6) select the virtual processor operation the common queue after upgrading.
(6.1) judge that at first whether operation queue is empty, if be empty, jump to (6.2), otherwise jumps to (6.5).
(6.2) judge whether waiting list is empty, if be empty, jumps to (6.3), if be not empty, jumps to (6.4).
(6.3) from the waiting list of other concurrent physical processors, seek virtual processor, and migration comes,, jump to (6.8), if there is not suitable virtual processor to move, then allow idle process, and jump to (6.9) if move successfully.
(6.4) from the operation queue of other concurrent physical processors, seek virtual processor, and move and come, if move successfully, jump to (6.8), otherwise jump to (7).
(6.5) judge that whether waiting list is empty, if be empty, jump to (6.6), otherwise jumps to (6.7).
(6.6) take out the virtual processor of head of the queue in the operation queue, and calculate working time.Be this virtual processor remaining timeslice in this cycle working time.Jump to (6.9).
(6.7) take out the virtual processor of operation queue head of the queue, and calculate working time.In this cycle, be in the smaller of the difference of time that virtual processor cycle of head of the queue begins and current time working time in remaining timeslice and the waiting list for this virtual processor.Jump to (6.9).
(6.8) virtual processor of electing is put on the concurrent physical processor moves, and calculate working time.In this cycle, be in the smaller of the difference of time that virtual processor cycle of head of the queue begins and current time working time in remaining timeslice and the waiting list for this virtual processor.
(6.9) operational factor is set, the time of scheduling beginning is set to the current time, jumps to (8).
(7) whether judge concurrent physical processor free time (the head of the queue virtual processor cycle begins the time span to the current time in the waiting list) more than or equal to threshold value (like 500ms), if less than 500ms, the operation idle process jumps to (8); If more than or equal to threshold value, jump to (7.1).
The setting that threshold value is concrete can be adjusted according to actual conditions.
(7.1) judge whether the extra formation of high priority is empty, if be not empty, selects the virtual processor of head of the queue, jumps to (8); If be empty, jump to (7.2).
(7.2) judge whether the extra formation of low priority is empty, if be not empty, selects the virtual processor of head of the queue, jumps to (7); If be empty, the operation idle process jumps to (8).
(8) finish.
After management and running a period of time, the unbalanced situation of formation load on each concurrent physical processor may appear, can carry out the load balance process of the overall situation.GSLB is controlled by timer, and concrete steps are (referring to Fig. 3) as follows:
(1) total run time of each concurrent physical processor in the set time reset to zero.
(2) add up the total run time of each concurrent physical processor in the set time (cycle length of timer), i.e. the operation T.T. of all virtual processors on the concurrent physical processor.At first obtain the operation T.T. of each virtual processor, then all virtual processor operations in operation queue and the waiting list are added up T.T., just obtain the operation T.T. of concurrent physical processor.
vcpu_cputime
i=vcpu_cputime
n+vcpu_cputime
e
vcpu_cputime
n=now-inf->sched_start_abs
vcpu_cputime
e=now-inf->sched_start_abs
Vcpu_cputime
iBe the T.T. of each virtual processor operation; Vcpu_cputime
nThe T.T. of moving when the common queue for each virtual processor; Vcpu_cputime
eThe T.T. of moving when the extra formation for each virtual processor; The time that sched_start_abs brings into operation for this virtual processor of scheduling; Pcpu_cputime is the concurrent physical processor total run time;
Summation for all virtual processors working time in the operation queue;
Summation for all virtual processors working time in the waiting list.
(3) busy factor busy_state is set, confirms the state of concurrent physical processor.A busy factor is set for each concurrent physical processor, is used for showing present concurrent physical processor is in which kind of state (totally three kinds of states: idle condition, task status, busy state are arranged).T.T. pcpu_cputime that the busy factor is moved in timer cycle by concurrent physical processor and the ratio of timer cycle TIME_PERIOD confirm that setting timer cycle is 1 second.
busy_state=pcpu_cputime/TIME_PERIOD
When busy_state was null, the busy factor was made as idle condition;
Busy_state is greater than zero, and less than 50% the time, the busy factor has been made as task status;
Busy_state is greater than 50% the time, and the busy factor is made as busy state.
(4) the source concurrent physical processor and the target physical processor of definite migration
(4.1) when the busy factor is set; We have noted the busy extent of each concurrent physical processor; According to busy extent, we are recorded in concurrent physical processor numbering respectively in b_idle, b_task, b_busy (corresponding be idle condition, have task status and the busy state) bitmap.
(4.2) judge that whether the b_busy bitmap is empty, if be empty, jumps to (4.3); Otherwise the concurrent physical processor that common queue length is the longest in the selection b_busy bitmap is as the source concurrent physical processor that moves and jump to (4.4);
(4.3) judge that whether the b_task bitmap is empty, if be empty, jumps to (4.9); Otherwise the concurrent physical processor that common queue length is the longest in the selection b_task bitmap is as the source concurrent physical processor that moves and jump to (4.4).
(4.4) judge that whether the b_idle bitmap is empty, if be empty, jumps to (4.5); Otherwise first concurrent physical processor in the selection b_idle bitmap is as migration target physical processor and jump to (4.7).
(4.5) judge that whether the b_task bitmap is empty, if be empty, jumps to (4.6); Otherwise the concurrent physical processor that common queue length is lacked most in the selection b_task bitmap is as the target physical processor that moves and jump to (4.7).
(4.6) judge that whether the b_busy bitmap is empty, if be empty, jumps to (4.9); Otherwise the concurrent physical processor that common queue length is lacked most in the selection b_busy bitmap is as the target physical processor that moves and jump to (4.7).
Whether the busy factor of (4.7) judging the source concurrent physical processor more than or equal to the busy factor of target physical processor, if more than or equal to, jump to (4.8); Otherwise jump to (4.9).
(4.8) migration source concurrent physical processor and the target physical processor confirmed according to the front move, and finish.
(4.9) do not have suitable migration source or target physical processor, then be left intact, finish.
(5) between source processor and purpose processor, move.Obtain the queue length of migration source and destination concurrent physical processor; Concurrent physical processor moves a virtual processor from the source successively; And the queue length of calculation sources and target physical processor again; If the difference of the queue length of the queue length of source concurrent physical processor and target physical processor is less than 2, then migration finishes.
(6) remove the busy factor (for GSLB is next time prepared) of all concurrent physical processors.
(7) GSLB finishes.
More than explanation only is one embodiment of the present invention, can not limit the present invention, and any change that does not exceed theme of the present invention that those of ordinary skills made is as long as in the scope that the present invention asked, all in protection scope of the present invention.
Claims (9)
1. a resources of virtual machine dispatching method specifically comprises the steps:
(1) initialization step;
At first, for each virtual processor be provided with a tlv triple G (slice, period, extra); Wherein, parameter s lice and period are time parameter, are illustrated in the time cycle period; Virtual processor moves duration slice at least, and parameter extra is a flag, and its value is taken as 0 or 1;
Then, common queue and extra formation are set, wherein, the element in the common queue is all virtual processors in the concurrent physical processor, and the element of extra formation is 1 virtual processor for the parameter extra value among its tlv triple G;
(2) obtain the attribute of current virtual processor (Curr) in the virtual machine, comprise virtual machine ID and status attribute (status), and,, be specially to handle respectively according to the state of the determined property virtual processor that obtains:
(2.1) the virtual machine ID according to this virtual processor judges whether virtual machine is empty, thereby judges whether this virtual processor is null process, if current virtual processor is a null process, then jumps to step (5), otherwise jumps to step (2.2);
(2.2) according to the status attribute (status) of virtual processor; Judge whether current virtual processor is but that running status is whether current virtual processor is in halted state; If be in halted state; Its state is set to sleep state, and it is the current time that the time of blocking beginning is set simultaneously, jumps to step (2.3);
(2.3) judge according to the status attribute (status) of virtual processor whether current virtual processor is to be the free time operation of concurrent physical processor in extra time; If; Show that this current virtual processor in extra formation, jumps to step (3), otherwise jump to step (4);
(3) virtual processor in the extra formation is handled, and jumped to step (5);
(4) virtual processor in the common queue is handled;
(5) upgrade common queue;
(6) select the virtual processor operation the common queue after upgrading;
(7) from extra formation, select the virtual processor operation;
(8) finish.
2. a kind of resources of virtual machine dispatching method according to claim 1 is characterized in that, described step (3) is handled detailed process to the virtual processor in the extra formation and is:
(3.1) the status attribute bit of replacement virtual processor is added up working time of current virtual processor, the time of extra operation, and from extra formation the current virtual processor of deletion;
(3.2) confirm whether current virtual processor is in the extra formation of high priority in the extra formation, if jump to step (3.3), otherwise jump to step (3.4);
(3.3) upgrade the score value of current virtual processor in the extra formation of high priority, jump to (3.5), wherein, the computing method of the score value in the extra formation of high priority be score=period<<10/slice;
(3.4) upgrade the score value of current virtual processor in the extra formation of low priority, jump to (3.5), wherein, the computing method of the score value in the extra formation of low priority are: score=1<<17;
(3.5) but the inspection current virtual processor whether be in running status; But if be in running status; Then it is inserted into corresponding extra formation again; And upgrade the score value of its other all virtual processors that belong to extra formation, if but be not in running status, current virtual processor is deleted from common queue.
3. a kind of resources of virtual machine dispatching method according to claim 1 and 2 is characterized in that, the detailed process that said step (4) is handled the virtual processor in the common queue is:
(4.1) but the timeslice of judging current virtual processor whether also do not use up and still be in running status, if, jump to step (5), carry out common queue and upgrade, otherwise, jump to step (4.2);
(4.2) current virtual processor is deleted from common queue; And judge but whether current virtual processor is in running status, if but be in running status, be inserted in the common queue; Otherwise; If it is in the extra formation,, jump to step (5) with its deletion from extra formation.
4. according to the described a kind of resources of virtual machine dispatching method of one of claim 1-3, it is characterized in that the detailed process of upgrading in the common queue in the said step (5) is:
(5.1) common queue is divided into waiting list and operation queue; Wherein operation queue refers to that the start time of time cycle period in the common queue is positioned at the formation before the current time, and waiting list is the formation that is positioned at the start time of time cycle period in the common queue after the current time;
(5.2) at first upgrade waiting list:
Traversal is searched waiting list, judges whether the cycle of the virtual processor in the waiting list begins, if the cycle begins, virtual processor is deleted from waiting list, and according to being inserted in the operation queue by the time limit; If do not begin, jump out traversal, jump to (5.3), wherein deadline refers in time cycle period, begin the moment of carrying out the latest;
(5.3) upgrade operation queue:
The traversal operation queue judges whether to have missed deadline, if missed deadline; It is extractd from operation queue, then deadline is postponed a time cycle period, continue next to judge whether the cycle begins; If the cycle begins; Just it is inserted in the operation queue again,, just is inserted in the waiting list if there is not the cycle not begin.
5. a kind of resources of virtual machine dispatching method according to claim 4 is characterized in that, the concrete selection course of said step (6) is:
(6.1) judge that at first whether operation queue is empty, if be empty, jump to (6.2), otherwise jumps to (6.5);
(6.2) judge whether waiting list is empty, if be empty, jumps to (6.3), if be not empty, jumps to (6.4);
(6.3) from the waiting list of other concurrent physical processors, seek virtual processor, and migration comes,, jump to (6.8), if there is not suitable virtual processor to move, then allow idle process, and jump to (6.9) if move successfully;
(6.4) from the operation queue of other concurrent physical processors, seek virtual processor, and move and come, if move successfully, jump to (6.8), otherwise jump to (7).
(6.5) judge that whether waiting list is empty, if be empty, jump to (6.6), otherwise jumps to (6.7).
(6.6) take out the virtual processor of head of the queue in the operation queue, and calculate working time.Be this virtual processor remaining timeslice in this cycle working time.Jump to (6.9).
(6.7) virtual processor of taking-up operation queue head of the queue; And calculate working time; Jump to (6.9), wherein in this cycle, be in the smaller of the difference of time that virtual processor cycle of head of the queue begins and current time working time for this virtual processor in remaining timeslice and the waiting list.
(6.8) virtual processor of electing is put on the concurrent physical processor moves, and calculate working time.
(6.9) operational factor is set, the time of scheduling beginning is set to the current time, jumps to (8).
6. according to the described a kind of resources of virtual machine dispatching method of one of claim 1-5, it is characterized in that the detailed process of said step (7) is: judge that whether concurrent physical processor free time is more than or equal to threshold value; If less than this threshold value, then move idle process, jump to (8); Otherwise judge further whether the extra formation of high priority is empty; If be not empty, select the virtual processor of head of the queue, jump to (8); If be empty, judge whether the extra formation of low priority is empty, if be not empty, selects the virtual processor of head of the queue, jumps to (8); If be empty, the operation idle process jumps to (8).
7. according to the described a kind of resources of virtual machine dispatching method of one of claim 1-6; It is characterized in that; Wherein said extra formation is two; Be extra formation of low priority and the extra formation of high priority, the extra formation of low priority refers to that its element is the extra formation that is arranged in the virtual processor in client territory, and the extra formation of high priority refers to that its element is the extra formation that is arranged in the virtual processor of management domain.
8. according to the described a kind of resources of virtual machine dispatching method of one of claim 1-7, it is characterized in that, also be included in after the above-mentioned scheduling step of the formation on the concurrent physical processor being carried out load balancing, be specially:
(I) adding up each concurrent physical processor is the total run time in cycle length of timer, i.e. the operation T.T. of all virtual processors on the concurrent physical processor in the set time;
(II) the busy factor is set, and the state of definite concurrent physical processor,
A busy factor busy_state is set promptly for each concurrent physical processor; Be used for showing current concurrent physical processor state of living in; Wherein state comprises idle condition, task status and busy state is arranged, and T.T. that the said busy factor is moved in timer cycle by concurrent physical processor and the ratio of timer cycle TIME_PERIOD are confirmed;
(III) the source concurrent physical processor and the target physical processor of definite migration move to realize load balancing.
9. a kind of resources of virtual machine dispatching method according to claim 8 is characterized in that, the detailed process of described step (III) is:
(A) according to the busy extent of each concurrent physical processor; Be recorded in each concurrent physical processor numbering respectively in b_idle bitmap, b_task bitmap, the b_busy bitmap, wherein the b_idle bitmap is corresponding be idle condition, b_task bitmap corresponding be have task status and b_busy bitmap corresponding be busy state;
(B) judge that whether the b_busy bitmap is empty, if be empty, jumps to (C); Otherwise the concurrent physical processor that common queue length is the longest in the selection b_busy bitmap is as the source concurrent physical processor that moves and jump to (D);
(C) judge that whether the b_task bitmap is empty, if be empty, jumps to (I); Otherwise the concurrent physical processor that common queue length is the longest in the selection b_task bitmap is as the source concurrent physical processor that moves and jump to (D);
(D) judge that whether the b_idle bitmap is empty, if be empty, jumps to (E); Otherwise first concurrent physical processor in the selection b_idle bitmap is as migration target physical processor and jump to (G);
(E) judge that whether the b_task bitmap is empty, if be empty, jumps to (F); Otherwise the concurrent physical processor that common queue length is lacked most in the selection b_task bitmap is as the target physical processor that moves and jump to (G);
(F) judge that whether the b_busy bitmap is empty, if be empty, jumps to (I); Otherwise the concurrent physical processor that common queue length is lacked most in the selection b_busy bitmap is as the target physical processor that moves and jump to (G);
Whether the busy factor of (G) judging the source concurrent physical processor more than or equal to the busy factor of target physical processor, if more than or equal to, jump to (H); Otherwise jump to (I);
(H) migration source concurrent physical processor and the target physical processor confirmed according to the front move, and finish.
(I) do not have suitable migration source or target physical processor, then be left intact, finish;
(V) between source processor and purpose processor, move: the queue length of obtaining migration source and destination concurrent physical processor; Concurrent physical processor moves a virtual processor from the source successively; And the queue length of calculation sources and target physical processor again; If the difference of the queue length of the queue length of source concurrent physical processor and target physical processor is less than 2, then migration finishes.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210104221.4A CN102662763B (en) | 2012-04-11 | 2012-04-11 | Virtual machine resource scheduling method based on service quality |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210104221.4A CN102662763B (en) | 2012-04-11 | 2012-04-11 | Virtual machine resource scheduling method based on service quality |
Publications (2)
Publication Number | Publication Date |
---|---|
CN102662763A true CN102662763A (en) | 2012-09-12 |
CN102662763B CN102662763B (en) | 2014-03-26 |
Family
ID=46772262
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201210104221.4A Active CN102662763B (en) | 2012-04-11 | 2012-04-11 | Virtual machine resource scheduling method based on service quality |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN102662763B (en) |
Cited By (21)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102708011A (en) * | 2012-05-11 | 2012-10-03 | 南京邮电大学 | Multistage load estimating method facing task scheduling of cloud computing platform |
CN103049333A (en) * | 2012-12-12 | 2013-04-17 | 华中科技大学 | Virtualized interruption dynamic distribution method |
CN103294546A (en) * | 2013-04-03 | 2013-09-11 | 华中科技大学 | Multi-dimensional resource performance interference aware on-line virtual machine migration method and system |
CN103685256A (en) * | 2013-12-06 | 2014-03-26 | 华为技术有限公司 | Virtual machine migration management method, device and system |
CN103870332A (en) * | 2012-12-13 | 2014-06-18 | 中国电信股份有限公司 | Virtual machine processor resource adjusting method and device and virtual machine system |
CN104035821A (en) * | 2013-03-06 | 2014-09-10 | 富士通株式会社 | Management system and method |
CN104252390A (en) * | 2013-06-28 | 2014-12-31 | 华为技术有限公司 | Resource scheduling method, device and system |
CN104793985A (en) * | 2015-04-24 | 2015-07-22 | 中国联合网络通信集团有限公司 | Virtual machine scheduling method and management equipment |
CN106250217A (en) * | 2016-07-22 | 2016-12-21 | 无锡华云数据技术服务有限公司 | Synchronous dispatching method between a kind of many virtual processors and dispatching patcher thereof |
CN106357726A (en) * | 2016-08-24 | 2017-01-25 | 东软集团股份有限公司 | Load balancing method and device |
CN106469193A (en) * | 2016-08-30 | 2017-03-01 | 北京航空航天大学 | Multi load metadata I/O service quality performance support method and system |
CN103793274B (en) * | 2014-02-19 | 2017-06-09 | 上海交通大学 | Delta Time piece adjusting apparatus and method in a kind of CREDIT schedulers |
US9720728B2 (en) | 2013-12-06 | 2017-08-01 | Huawei Technologies Co., Ltd. | Migrating a VM when the available migration duration times of a source and destination node are greater than the VM's migration duration time |
CN107624181A (en) * | 2015-06-17 | 2018-01-23 | 英特尔公司 | Idle and scheduling virtual machine management method and equipment including virtual processor |
CN108874534A (en) * | 2018-04-18 | 2018-11-23 | 华为技术有限公司 | A kind of dispatching method and device of PCPU resource |
CN109308220A (en) * | 2017-07-26 | 2019-02-05 | 华为技术有限公司 | Shared resource distribution method and device |
CN110109733A (en) * | 2019-04-29 | 2019-08-09 | 东北大学 | Virtual Machine Worker queue and redundancy queue update method towards different aging scenes |
CN111737176A (en) * | 2020-05-11 | 2020-10-02 | 福州瑞芯微电子股份有限公司 | PCIE data-based synchronization device and driving method |
CN113687909A (en) * | 2021-07-28 | 2021-11-23 | 华东计算技术研究所(中国电子科技集团公司第三十二研究所) | Time-sharing vcpu multi-core scheduling method and system based on micro-core |
WO2023165485A1 (en) * | 2022-03-04 | 2023-09-07 | 阿里巴巴(中国)有限公司 | Scheduling method and computer system |
CN116893893A (en) * | 2023-09-08 | 2023-10-17 | 北京翼辉信息技术有限公司 | Virtual machine scheduling method and device, electronic equipment and storage medium |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102253857A (en) * | 2011-06-24 | 2011-11-23 | 华中科技大学 | Xen virtual machine scheduling control method in multi-core environment |
US20110307887A1 (en) * | 2010-06-11 | 2011-12-15 | International Business Machines Corporation | Dynamic virtual machine shutdown without service interruptions |
US20120042034A1 (en) * | 2010-08-13 | 2012-02-16 | Vmware, Inc. | Live migration of virtual machine during direct access to storage over sr iov adapter |
-
2012
- 2012-04-11 CN CN201210104221.4A patent/CN102662763B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20110307887A1 (en) * | 2010-06-11 | 2011-12-15 | International Business Machines Corporation | Dynamic virtual machine shutdown without service interruptions |
US20120042034A1 (en) * | 2010-08-13 | 2012-02-16 | Vmware, Inc. | Live migration of virtual machine during direct access to storage over sr iov adapter |
CN102253857A (en) * | 2011-06-24 | 2011-11-23 | 华中科技大学 | Xen virtual machine scheduling control method in multi-core environment |
Cited By (33)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102708011A (en) * | 2012-05-11 | 2012-10-03 | 南京邮电大学 | Multistage load estimating method facing task scheduling of cloud computing platform |
CN103049333A (en) * | 2012-12-12 | 2013-04-17 | 华中科技大学 | Virtualized interruption dynamic distribution method |
CN103870332B (en) * | 2012-12-13 | 2017-08-25 | 中国电信股份有限公司 | Method of adjustment, device and the dummy machine system of virtual machine processor resource |
CN103870332A (en) * | 2012-12-13 | 2014-06-18 | 中国电信股份有限公司 | Virtual machine processor resource adjusting method and device and virtual machine system |
CN104035821B (en) * | 2013-03-06 | 2017-09-26 | 富士通株式会社 | management system and method |
CN104035821A (en) * | 2013-03-06 | 2014-09-10 | 富士通株式会社 | Management system and method |
CN103294546B (en) * | 2013-04-03 | 2016-04-20 | 华中科技大学 | The online moving method of virtual machine of multi-dimensional resource performance interference aware and system |
CN103294546A (en) * | 2013-04-03 | 2013-09-11 | 华中科技大学 | Multi-dimensional resource performance interference aware on-line virtual machine migration method and system |
CN104252390A (en) * | 2013-06-28 | 2014-12-31 | 华为技术有限公司 | Resource scheduling method, device and system |
CN104252390B (en) * | 2013-06-28 | 2018-08-14 | 华为技术有限公司 | Resource regulating method, device and system |
US9720728B2 (en) | 2013-12-06 | 2017-08-01 | Huawei Technologies Co., Ltd. | Migrating a VM when the available migration duration times of a source and destination node are greater than the VM's migration duration time |
CN103685256B (en) * | 2013-12-06 | 2017-08-04 | 华为技术有限公司 | A kind of virtual machine migration management, apparatus and system |
CN103685256A (en) * | 2013-12-06 | 2014-03-26 | 华为技术有限公司 | Virtual machine migration management method, device and system |
CN103793274B (en) * | 2014-02-19 | 2017-06-09 | 上海交通大学 | Delta Time piece adjusting apparatus and method in a kind of CREDIT schedulers |
CN104793985A (en) * | 2015-04-24 | 2015-07-22 | 中国联合网络通信集团有限公司 | Virtual machine scheduling method and management equipment |
CN104793985B (en) * | 2015-04-24 | 2018-03-30 | 中国联合网络通信集团有限公司 | A kind of dispatching method of virtual machine and management equipment |
CN107624181A (en) * | 2015-06-17 | 2018-01-23 | 英特尔公司 | Idle and scheduling virtual machine management method and equipment including virtual processor |
CN107624181B (en) * | 2015-06-17 | 2021-11-23 | 英特尔公司 | Virtual machine management method and apparatus including idling and scheduling of virtual processors |
CN106250217A (en) * | 2016-07-22 | 2016-12-21 | 无锡华云数据技术服务有限公司 | Synchronous dispatching method between a kind of many virtual processors and dispatching patcher thereof |
CN106357726B (en) * | 2016-08-24 | 2019-08-20 | 东软集团股份有限公司 | Load-balancing method and device |
CN106357726A (en) * | 2016-08-24 | 2017-01-25 | 东软集团股份有限公司 | Load balancing method and device |
CN106469193A (en) * | 2016-08-30 | 2017-03-01 | 北京航空航天大学 | Multi load metadata I/O service quality performance support method and system |
CN109308220A (en) * | 2017-07-26 | 2019-02-05 | 华为技术有限公司 | Shared resource distribution method and device |
CN108874534A (en) * | 2018-04-18 | 2018-11-23 | 华为技术有限公司 | A kind of dispatching method and device of PCPU resource |
CN108874534B (en) * | 2018-04-18 | 2022-09-16 | 华为技术有限公司 | Method and device for scheduling PCPU (physical packet Unit) resources |
CN110109733A (en) * | 2019-04-29 | 2019-08-09 | 东北大学 | Virtual Machine Worker queue and redundancy queue update method towards different aging scenes |
CN110109733B (en) * | 2019-04-29 | 2022-06-24 | 东北大学 | Virtual machine work queue and redundancy queue updating method oriented to different aging scenes |
CN111737176A (en) * | 2020-05-11 | 2020-10-02 | 福州瑞芯微电子股份有限公司 | PCIE data-based synchronization device and driving method |
CN113687909A (en) * | 2021-07-28 | 2021-11-23 | 华东计算技术研究所(中国电子科技集团公司第三十二研究所) | Time-sharing vcpu multi-core scheduling method and system based on micro-core |
CN113687909B (en) * | 2021-07-28 | 2024-01-30 | 华东计算技术研究所(中国电子科技集团公司第三十二研究所) | Time-sharing vcpu multi-core scheduling method and system based on microkernel |
WO2023165485A1 (en) * | 2022-03-04 | 2023-09-07 | 阿里巴巴(中国)有限公司 | Scheduling method and computer system |
CN116893893A (en) * | 2023-09-08 | 2023-10-17 | 北京翼辉信息技术有限公司 | Virtual machine scheduling method and device, electronic equipment and storage medium |
CN116893893B (en) * | 2023-09-08 | 2024-03-22 | 北京翼辉信息技术有限公司 | Virtual machine scheduling method and device, electronic equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN102662763B (en) | 2014-03-26 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102662763B (en) | Virtual machine resource scheduling method based on service quality | |
US10831556B2 (en) | Virtual CPU consolidation to avoid physical CPU contention between virtual machines | |
US9286127B2 (en) | Method for allocating processor resources precisely by means of predictive scheduling based on current credits | |
CN103678003B (en) | The virtual cpu dispatching method that a kind of real-time strengthens | |
US10871998B2 (en) | Usage instrumented workload scheduling | |
CN102253857B (en) | Xen virtual machine scheduling control method in multi-core environment | |
Wang et al. | Preemptive {ReduceTask} Scheduling for Fair and Fast Job Completion | |
CN102279771B (en) | Method and system for adaptively allocating resources as required in virtualization environment | |
Wang et al. | Pigeon: An effective distributed, hierarchical datacenter job scheduler | |
CN103955398B (en) | Virtual machine coexisting scheduling method based on processor performance monitoring | |
CN104503838A (en) | Method for scheduling virtual CPU (Central Processing Unit) | |
CN102135903B (en) | Hardware virtualization-based Xen real-time performance improving system and method thereof | |
CN104951367B (en) | Fault-tolerant method for scheduling task in one kind virtualization cloud | |
CN109240795A (en) | A kind of resource regulating method of the cloud computing resources pool model suitable for super fusion IT infrastructure | |
CN104917839A (en) | Load balancing method used in cloud computing environment | |
Pongsakorn et al. | Container rebalancing: Towards proactive linux containers placement optimization in a data center | |
US20170060641A1 (en) | Pluggable Engine for Application Specific Schedule Control | |
CN103870332A (en) | Virtual machine processor resource adjusting method and device and virtual machine system | |
Qu et al. | Canary: A scheduling architecture for high performance cloud computing | |
Zhang et al. | Minimizing interference and maximizing progress for Hadoop virtual machines | |
CN106250217A (en) | Synchronous dispatching method between a kind of many virtual processors and dispatching patcher thereof | |
CN110362411B (en) | CPU resource scheduling method based on Xen system | |
Harichane et al. | A proposal of kubernetes scheduler using machine-learning on cpu/gpu cluster | |
Ullah et al. | LSTPD: least slack time-based preemptive deadline constraint scheduler for Hadoop clusters | |
Chen et al. | A framework for real-time information derivation from big sensor data |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |