CN102662763B - Virtual machine resource scheduling method based on service quality - Google Patents

Virtual machine resource scheduling method based on service quality Download PDF

Info

Publication number
CN102662763B
CN102662763B CN201210104221.4A CN201210104221A CN102662763B CN 102662763 B CN102662763 B CN 102662763B CN 201210104221 A CN201210104221 A CN 201210104221A CN 102662763 B CN102662763 B CN 102662763B
Authority
CN
China
Prior art keywords
queue
processor
virtual
concurrent physical
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.)
Active
Application number
CN201210104221.4A
Other languages
Chinese (zh)
Other versions
CN102662763A (en
Inventor
冯丹
童薇
刘景宁
张文涛
王晓静
陈慧萍
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huazhong University of Science and Technology
Original Assignee
Huazhong University of Science and Technology
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Huazhong University of Science and Technology filed Critical Huazhong University of Science and Technology
Priority to CN201210104221.4A priority Critical patent/CN102662763B/en
Publication of CN102662763A publication Critical patent/CN102662763A/en
Application granted granted Critical
Publication of CN102662763B publication Critical patent/CN102662763B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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

Quality-of-service based resources of virtual machine dispatching method
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 a difficult problem for architecture: the utilization factor of computer resource is too low; 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 cost and the expense of computational resource.
When a plurality of dummy machine systems are shared use bottom hardware, the scheduling of resource must meet fair and efficient principle.At present, hardware resource management and the distribution method of virtual platform depend on scheduler, and to different application and load, each scheduler can not mate preferably and dispatch how rationally, effectively, distribute hardware resource to be still a very large difficult problem.
Common dispatching method of virtual machine have virtual time use, the earliest closing time the preferential and dispatching method based on credit value.Virtual time borrowing method is introduced virtual time thought in the middle of 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 the real time is obtained after certain rule is calculated, the method is carried out the execution of monitoring process with virtual time, and each always scheduling has the process between efficient virtualized time the earliest.Current, virtual time borrowing method exists the problem that can not guarantee process Fairshare processor resource on multiprocessor while moving.
Based on credit value dispatching method, two tuples (weight, cap) are set for each Client OS, weight represents weight, and cap represents the upper limit.Between Client OS, the ratio of weight determines that they take the ratio of processor timeslice separately; And the upper limit determines that a Client OS takies the maximal value of processor time, such as cap=50, represent that Client OS can only take at most the institute of half concurrent physical processor free, cap=100, represents that Client OS can take at most the institute of a concurrent physical processor free.Method based on credit value is divided into two queues by each virtual processor, under queue and over queue, and it only dispatches the virtual processor under queue.Start most all virtual processors all under queue, the initial credit value of each virtual processor is its corresponding weighted value, when virtual processor is scheduled, the credit value that this virtual processor is corresponding is just reduced, when credit value is when negative, this virtual processor is just placed into over queue, when all virtual processors are all in over queue, credit value dispatching method adds the value of initial weight in proportion for all virtual processors, and corresponding virtual processor is put under queue, go round and begin again.Advantage based on credit value method: it can distribute to each virtual processor efficiently by processor time justice, and can realize load balancing; Shortcoming based on credit value method: in the application of having relatively high expectations in response speed, it is closely related that postpone queue position residing with it time response, generally length and fluctuation are obvious for operating lag.
Reference factor when closing time, the mode of priority was scheduled as it for a deadline of each virtual processor setting the earliest.When dispatching, scheduler program is by 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 to other two dispatching methods; But it can only carry out respectively to each concurrent physical processor the scheduling of mode of priority closing time the earliest, when having a plurality of concurrent physical processors on same machine, the method can not complete load balancing preferably, and when system overload, its handling capacity will sharply decline.
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, by the reasonable distribution of task, meets the characteristic of multi-core environment load balancing, reduces the response time of I/O request, meets the demand that service quality is controlled.
In order to achieve the above object, the technical solution used in the present invention is:
A quality-of-service based resources of virtual machine dispatching method, for virtual machine virtual processor is dispatched, specifically comprises the following steps:
(1) initialization
First, for each virtual processor arranges a tlv triple (slice, period, extra), wherein, parameter s lice, period referred at period in the time cycle, and virtual processor at least moves slice duration (unit: millisecond), extra is flag, when extra is 1, if represent that at period in the time cycle, concurrent physical processor is the available free time still, allow virtual processor to take these free time, when extra is 0, do not allow virtual processor to take these free time.
Then, at each concurrent physical processor, common queue and extra queue are set, wherein, element in common queue is all virtual processors in concurrent physical processor, the virtual processor that the element of extra queue is 1 for its tlv triple parameter extra, wherein this extra queue is two, be the extra queue of low priority and the extra queue of high priority, the extra queue of low priority refers to that its element is for being arranged in the extra queue of the virtual processor in client territory (domainU), the extra queue of high priority refers to that its element is for being arranged in the extra queue of the virtual processor of management domain (domainO).
(2) obtain the relevant information of current virtual processor, according to these information, determine whether null process, if be not null process, judge whether it is can running status, if can running status, and according to being whether being for further processing of operation extra time, if in operation extra time, jump to step (2), otherwise jump to step (3).
Which (3) first obtain in extra queue, all running marks in mode bit are all removed, add up the time of extra operation and carried out load balancing to the T.T. (judging the busy extent of virtual processor according to this variable, as the index of load balancing) of current time operation from last time.From extra queue, delete current virtual processor.
If current virtual processor is in the extra queue of high priority, all information of resetting, then checks the information of upgrading extra queue; If current virtual processor, in the extra queue of low priority, recalculates the value of score.While check upgrading extra queuing message, if current virtual processor in can running status, be just joined extra queue and upgrades the value of the score of other virtual processors.Otherwise from all queues, delete this virtual processor.While upgrading the value of score, according to the score value of current virtual processor last time, upgrade, the score of other virtual processors all deducts the score value of current virtual processor, and object is in order to improve the priority of other virtual processors.
(4) statistics virtual processor carried out load balancing to the T.T. (for the busy factor setting of load balancing) of current time operation from last time, if the timeslice of current virtual processor is not also finished and still in can running status, jump to step (4).Otherwise current virtual processor is deleted from common queue, judged that current virtual processor is whether in can running status, if in can running status, be inserted in waiting list, otherwise, it is deleted from extra queue.
(5) traversal waiting list and operation queue, according to the time that the cycle of virtual processor starts, put into different queues by virtual processor, and the cycle starts, and puts in operation queue, and the cycle does not also start, and puts in waiting list.If missed deadline, increase one-period, and whether start according to the cycle, put it into waiting list or operation queue.
(6) from operation queue or waiting list, select a virtual processor.If there is virtual processor in operation queue, to select to put on concurrent physical processor and carry out in the virtual processor of queue head, the Time Calculation mode that can carry out is as follows:
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 current time; MIN () is for obtaining minimum value; Slice is the timeslice that virtual processor distributes; The time of cputime for having moved in current period; PERIOD_BEGIN (waitq) is the time of cycle early start in waiting list.
If operation queue is empty, and waiting list is not empty, whether the operation queue of inquiring about other concurrent physical processors has virtual processor, if had, moves to current concurrent physical processor and carries out; If no, jump to (6); If waiting list is also empty, whether the waiting list of inquiring about other concurrent physical processors has virtual processor, if had, moves to current concurrent physical processor and carries out; If no, carry out null process.
(6) if concurrent physical processor free time is less than 500 milliseconds, directly moves null process, otherwise from extra queue, select a virtual processor to carry out.
(7) finish.
After management and running a period of time, may there is the situation of queue load imbalance on each concurrent physical processor, can carry out overall load balance process.Wherein GSLB is controlled by timer, specifically can be divided into following step:
(I) by each concurrent physical processor, the total run time within the set time resets to zero.
(II) add up the total run time of each concurrent physical processor within the set time (cycle length of timer), i.e. the operation T.T. of all virtual processors on concurrent physical processor.First obtain the operation T.T. of each virtual processor, then all virtual processor operations in operation queue and waiting list are added up T.T., just obtain the operation T.T. of concurrent physical processor.
(III) busy factor busy_state is set, determines the state of concurrent physical processor.A busy factor is set to each concurrent physical processor, is used for showing that current concurrent physical processor is in which kind of state (totally three kinds of states: idle condition, have task status, busy state).The ratio of the T.T. pcpu_cputime that the busy factor is moved in the cycle at timer by concurrent physical processor and timer cycle T IME_PERIOD determines, setting the timer cycle is 1 second.
(IV) determine source concurrent physical processor and the object concurrent physical processor of migration, move to realize load balancing.
As a further improvement on the present invention, the detailed process of described step (IV) is:
(A) according to the busy extent of each concurrent physical processor, each concurrent physical processor numbering is recorded in respectively in b_idle bitmap, b_task bitmap, b_busy bitmap, wherein 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 whether b_busy bitmap is empty, empty if, jump to (C); Otherwise the concurrent physical processor that in selection b_busy bitmap, common queue length is the longest is as the source concurrent physical processor moving and jump to (D);
(C) judge whether b_task bitmap is empty, empty if, jump to (I); Otherwise the concurrent physical processor that in selection b_task bitmap, common queue length is the longest is as the source concurrent physical processor moving and jump to (D);
(D) judge whether b_idle bitmap is empty, empty if, jump to (E); Otherwise first concurrent physical processor in selection b_idle bitmap is as migration object concurrent physical processor and jump to (G);
(E) judge whether b_task bitmap is empty, empty if, jump to (F); Otherwise select a shortest concurrent physical processor of common queue length in b_task bitmap as the object concurrent physical processor of migration and jump to (G);
(F) judge whether b_busy bitmap is empty, empty if, jump to (I); Otherwise select a shortest concurrent physical processor of common queue length in b_busy bitmap as the object concurrent physical processor of migration and jump to (G);
(G) judge that whether the busy factor of source concurrent physical processor is more than or equal to the busy factor of object concurrent physical processor, if be more than or equal to, jumps to (H); Otherwise jump to (I);
(H) according to definite above migration source concurrent physical processor and object concurrent physical processor, move, finish.
(I) there is no suitable migration source or object concurrent physical processor, be left intact, finish;
(V) between source processor and object processor, move: the queue length of obtaining migration source and destination concurrent physical processor, successively from a virtual processor of source concurrent physical processor migration, and recalculate the queue length of source and destination concurrent physical processor, if the difference of the queue length of the queue length of source concurrent physical processor and object concurrent physical processor is less than 2, migration finishes;
The present invention can make the I/O operating lag on virtual machine controlled in complicated applications environment, supports the load balancing between multiprocessor.
Accompanying drawing explanation
Fig. 1 is integrated scheduling schematic flow sheet in the present invention.
Fig. 2 is that in the present invention, common queue is selected schematic flow sheet.
Fig. 3 is GSLB schematic flow sheet in the present invention.。
Embodiment
Below in conjunction with accompanying drawing, the specific embodiment of the present invention is elaborated.
The present invention proposes quality-of-service based resources of virtual machine dispatching method under a kind of multicore architecture, the method, by the reasonable distribution of task, meets the characteristic of multi-core environment load balancing, reduces the response time of I/O request, meets the demand that service quality is controlled.
Detailed process is as follows:
(1) initialization
First, for each virtual processor arranges a tlv triple (slice, period, extra), wherein, slice, period is time parameter (unit: millisecond), round numerical value, be illustrated in time cycle period, virtual processor at least moves duration slice.Extra is flag, when extra is 1, if represent that at period in the time cycle, concurrent physical processor is the available free time still, allows virtual processor to take these free time, when extra is 0, does not allow virtual processor to take these free time.
Then, each concurrent physical processor is provided with to common queue and extra queue, wherein, element in common queue is all virtual processors in concurrent physical processor, the virtual processor that the element of extra queue is 1 for its tlv triple parameter extra, wherein this extra queue is two, be the extra queue of low priority and the extra queue of high priority, the extra queue of low priority refers to that its element is for being arranged in the extra queue of the virtual processor in client territory (domainU), the extra queue of high priority refers to that its element is for being arranged in the extra queue of the virtual processor of management domain (domainO).
Virtual machine is divided into client territory virtual machine and management domain virtual machine, and management domain virtual machine can directly be accessed bottom hardware, and client territory virtual machine need to pass through management domain virtual machine dereference bottom hardware.
(2) obtain the attribute of current virtual processor (Curr) in virtual machine, comprise virtual machine ID and status attribute (status), and according to the state of the determined property virtual processor obtaining.
(2.1) according to the virtual machine ID of this virtual processor, judge whether virtual machine is empty, thereby judge whether this virtual processor is null process.(virtual machine ID is IDLE_DOMAIN_ID, represents that this virtual machine is for empty, and corresponding virtual processor is null process.) if current virtual processor is null process, 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 of virtual processor (status), judge current virtual processor be whether can running status (each virtual processor has a status attribute, different values is identifying the different state of virtual processor), be whether current virtual processor is in halted state, if in halted state, its state is set to sleep state, and the time that obstruction beginning is set is simultaneously current time.Jump to step (2.3).
(2.3) according to the status attribute of virtual processor (status), judge whether current virtual processor is to move in extra time (being the free time of concurrent physical processor), if move in extra time, extra is 1, this current virtual processor of surface is in extra queue, jump to step (2), otherwise jump to step (3).
(3) virtual processor in extra queue is processed
(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, by itself and slice comparison, thereby determined whether to move the long time of slice), time of extra operation and carried out load balancing to the T.T. (judging the busy extent of virtual processor according to this variable, as the index of load balancing) of current time operation from last time.From extra queue, delete current virtual processor;
(3.2) determine the extra queue of the high priority of current virtual processor in extra queue, if current virtual processor, in the extra queue of high priority, jumps to step (3.3), otherwise jump to step (3.4).
(3.3) (score value representation virtual processor is in the priority of certain extra queue to upgrade the score value of current virtual processor in the extra queue of high priority, score value is lower, priority is higher, virtual processor has different score values in the extra queue of difference), the computing method of the score value in the extra queue of high priority are score=period < < 10/slice, jump to (3.5).
(3.4) upgrade the score value of current virtual processor in the extra queue of low priority, the computing method of the score value in the extra queue of low priority are: score=1 < < 17.Jump to (3.5).
(3.5) check that current virtual processor is whether in can running status, if in can running status, reinserted corresponding extra queue, and the score value of upgrading other all virtual processors of its extra queue in place (is the score value that the score value of other all virtual processors deducts respectively current virtual processor, object is in order to promote other virtual processors in the priority of extra queue), if, in can running status, current virtual processor not be deleted from common queue.
(4) virtual processor in common queue is processed
(4.1) statistics virtual processor carried out load balancing to the T.T. (for the busy factor setting of load balancing) of current time operation from last time, if the timeslice of current virtual processor is not also finished and still in can running status, jump to step (5).Otherwise, jump to step (4.2).
(4.2) current virtual processor is deleted from common queue, judge that current virtual processor is whether in can running status, if in can running status, be inserted in common queue, otherwise, it is deleted from extra queue, if current virtual processor is present in extra queue, just delete.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 common queue, and waiting list is to be positioned at current time part afterwards the start time of time cycle period in common queue.
(5.1) first upgrade waiting list: traversal is searched waiting list, whether the cycle that judges the virtual processor in waiting list starts, if the cycle starts, virtual processor is extractd from waiting list, and according to being inserted in operation queue by the time limit; If do not started, jump out traversal, jump to (5.2).Wherein deadline refers in time cycle period, starts the latest the moment of carrying out.
(5.2) upgrade operation queue: traversal operation queue, judge whether to have missed deadline, if missed deadline, it is extractd from operation queue, then deadline is postponed to a time cycle period, next continue to judge whether the cycle starts, if the cycle starts, just reinserted in operation queue, if do not have the cycle not start, be just inserted in waiting list.
(6) in the common queue from upgrading, select virtual processor operation.
(6.1) first judge whether operation queue is empty, empty if, jump to (6.2), otherwise jump to (6.5).
(6.2) judge whether waiting list is empty, empty if, jump to (6.3), if be not empty, jump to (6.4).
(6.3) from the waiting list of other concurrent physical processors, find virtual processor, and move and come, if moved successfully, jump to (6.8), if do not have suitable virtual processor to move, allow idle process, and jump to (6.9).
(6.4) from the operation queue of other concurrent physical processors, find virtual processor, and move and come, if moved successfully, jump to (6.8), otherwise jump to (7).
(6.5) judge whether waiting list is empty, empty if, jump to (6.6), otherwise jump to (6.7).
(6.6) take out the virtual processor of head of the queue in operation queue, and calculate working time.Be this virtual processor remaining timeslice within 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.Be the smaller of the difference of this virtual processor time that in remaining timeslice and waiting list, the virtual processor cycle in head of the queue starts within this cycle and current time working time.Jump to (6.9).
(6.8) virtual processor of electing is put on concurrent physical processor and is moved, and calculate working time.Be the smaller of the difference of this virtual processor time that in remaining timeslice and waiting list, the virtual processor cycle in head of the queue starts within this cycle and current time working time.
(6.9) operational factor is set, the set of time that scheduling is started is current time, jumps to (8).
(7) judge whether concurrent physical processor free time (in waiting list, the head of the queue virtual processor cycle starts the time span to current time) is more than or equal to threshold value (as 500ms), if be less than 500ms, operation idle process, jumps to (8); If be 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 queue of high priority is empty, if be not empty, selects the virtual processor of head of the queue, jumps to (8); Empty if, jump to (7.2).
(7.2) judge whether the extra queue of low priority is empty, if be not empty, selects the virtual processor of head of the queue, jumps to (7); Empty if, operation idle process, jumps to (8).
(8) finish.
After management and running a period of time, may there is the situation of queue load imbalance on each concurrent physical processor, can carry out overall load balance process.GSLB is controlled by timer, concrete steps following (referring to Fig. 3):
(1) by each concurrent physical processor, the total run time within the set time resets to zero.
(2) add up the total run time of each concurrent physical processor within the set time (cycle length of timer), i.e. the operation T.T. of all virtual processors on concurrent physical processor.First obtain the operation T.T. of each virtual processor, then all virtual processor operations in operation queue and 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
pcpu _ cputime = &Sigma; r vcpu _ cputime r + &Sigma; w vcpu _ cputime w
Vcpu_cputime ifor 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 queue for each virtual processor; The time that sched_start_abs brings into operation for this virtual processor of scheduling; Pcpu_cputime is concurrent physical processor total run time;
Figure BDA0000152127230000102
summation for all virtual processors working time in operation queue;
Figure BDA0000152127230000103
summation for all virtual processors working time in waiting list.
(3) busy factor busy_state is set, determines the state of concurrent physical processor.A busy factor is set to each concurrent physical processor, is used for showing that current concurrent physical processor is in which kind of state (totally three kinds of states: idle condition, have task status, busy state).The ratio of the T.T. pcpu_cputime that the busy factor is moved in the cycle at timer by concurrent physical processor and timer cycle T IME_PERIOD determines, setting the timer cycle is 1 second.
busy_state=pcpu_cputime/TIME_PERIOD
When busy_state is null, the busy factor is made as idle condition;
Busy_state is greater than zero, and when being less than 50%, the busy factor has been made as task status;
When busy_state is greater than 50%, the busy factor is made as busy state.
(4) determine source concurrent physical processor and the object concurrent physical processor of migration
(4.1) when the busy factor is set, we have recorded 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 busy state) bitmap.
(4.2) judge whether b_busy bitmap is empty, empty if, jump to (4.3); Otherwise the concurrent physical processor that in selection b_busy bitmap, common queue length is the longest is as the source concurrent physical processor moving and jump to (4.4);
(4.3) judge whether b_task bitmap is empty, empty if, jump to (4.9); Otherwise the concurrent physical processor that in selection b_task bitmap, common queue length is the longest is as the source concurrent physical processor moving and jump to (4.4).
(4.4) judge whether b_idle bitmap is empty, empty if, jump to (4.5); Otherwise first concurrent physical processor in selection b_idle bitmap is as migration object concurrent physical processor and jump to (4.7).
(4.5) judge whether b_task bitmap is empty, empty if, jump to (4.6); Otherwise select a shortest concurrent physical processor of common queue length in b_task bitmap as the object concurrent physical processor of migration and jump to (4.7).
(4.6) judge whether b_busy bitmap is empty, empty if, jump to (4.9); Otherwise select a shortest concurrent physical processor of common queue length in b_busy bitmap as the object concurrent physical processor of migration and jump to (4.7).
(4.7) judge that whether the busy factor of source concurrent physical processor is more than or equal to the busy factor of object concurrent physical processor, if be more than or equal to, jumps to (4.8); Otherwise jump to (4.9).
(4.8) according to definite above migration source concurrent physical processor and object concurrent physical processor, move, finish.
(4.9) there is no suitable migration source or object concurrent physical processor, be left intact, finish.
(5) between source processor and object processor, move.Obtain the queue length of migration source and destination concurrent physical processor, successively from a virtual processor of source concurrent physical processor migration, and recalculate the queue length of source and destination concurrent physical processor, if the difference of the queue length of the queue length of source concurrent physical processor and object concurrent physical processor is less than 2, migration finishes.
(6) remove the busy factor (for GSLB is next time prepared) of all concurrent physical processors.
(7) GSLB finishes.
More than explanation is only 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 make, as long as in the scope of asking in the present invention, 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;
First, for each virtual processor arranges a tlv triple G (slice, period, extra), wherein, parameter s lice and period are time parameter, are illustrated in time cycle period, and virtual processor at least moves duration slice, parameter extra is flag, its value is taken as 0 or 1, when extra is 1, if represented in time cycle period, concurrent physical processor is the available free time still, allow virtual processor to take this free time, when extra is 0, do not allow virtual processor to take this free time;
Then, common queue and extra queue are set, wherein, the element in common queue is all virtual processors in concurrent physical processor, the virtual processor that the element of extra queue is 1 for the parameter extra value in its tlv triple G;
(2) obtain the attribute of current virtual processor (Curr) in virtual machine, comprise virtual machine ID and status attribute (status), and according to the state of the determined property virtual processor obtaining, to process respectively, be specially:
(2.1) according to the virtual machine ID of this virtual processor, judge whether virtual machine is empty, thereby judge whether this virtual processor is null process, if current virtual processor is null process, jumps to step (5), otherwise jump to step (2.2);
(2.2) according to the status attribute of virtual processor (status), judge whether current virtual processor is running status to be whether current virtual processor is in halted state, if in halted state, its state is set to sleep state, the time that obstruction beginning is set is simultaneously current time, jumps to step (2.3);
(2.3) according to the status attribute of virtual processor (status), judge whether current virtual processor is in extra time, to be the free time operation of concurrent physical processor, if, show that this current virtual processor, in extra queue, jumps to step (3), otherwise jumps to step (4);
(3) virtual processor in extra queue is processed, and jumped to step (5);
(4) virtual processor in common queue is processed;
(5) upgrade common queue;
(6) in the common queue from upgrading, select virtual processor operation;
(7) from extra queue, select 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 processed detailed process to the virtual processor in extra queue and is:
(3.1) status attribute of replacement virtual processor (status) position, adds up working time of current virtual processor, the time of extra operation, and from extra queue, delete current virtual processor;
(3.2) determine that current virtual processor whether in the extra queue of high priority in extra queue, if so, jumps to step (3.3), otherwise jumps to step (3.4);
(3.3) upgrade the score value of current virtual processor in the extra queue of high priority, jump to (3.5), wherein, the computing method of the score value in the extra queue of high priority are score=period<<10/slice;
(3.4) upgrade the score value of current virtual processor in the extra queue of low priority, jump to (3.5), wherein, the computing method of the score value in the extra queue of low priority are: score=1<<17;
(3.5) check that current virtual processor is whether in can running status, if in can running status, reinserted corresponding extra queue, and upgrade the score value of other all virtual processors of its extra queue in place, if, in can running status, current virtual processor not be 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 described step (4) is processed the virtual processor in common queue is:
(4.1) whether the timeslice that judges current virtual processor is not also finished and still in can running status, if so, jumps to step (5), carries out common queue renewal, otherwise, jump to step (4.2);
(4.2) current virtual processor is deleted from common queue, and judge that current virtual processor is whether in can running status, if in can running status, be inserted in common queue, otherwise, if it,, in extra queue, deletes it from extra queue, jump to step (5).
4. a kind of resources of virtual machine dispatching method according to claim 1 and 2, is characterized in that, the detailed process of upgrading in common queue in described 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 common queue is positioned at the queue before current time, and waiting list is the queue being positioned at the start time of time cycle period in common queue after current time;
(5.2) first upgrade waiting list:
Traversal is searched waiting list, judges whether the cycle of the virtual processor in waiting list starts, if the cycle starts, virtual processor is deleted from waiting list, and according to being inserted in operation queue by the time limit; If do not started, jump out traversal, jump to (5.3), wherein deadline refers in time cycle period, starts the latest the moment of carrying out;
(5.3) upgrade operation queue:
Traversal operation queue, judge whether to have missed deadline, if missed deadline, it is extractd from operation queue, then deadline is postponed to a time cycle period, next continue to judge whether the cycle starts, if the cycle starts, just reinserted in operation queue, if the cycle does not start, be just inserted in waiting list.
5. a kind of resources of virtual machine dispatching method according to claim 4, is characterized in that, the concrete selection course of described step (6) is:
(6.1) first judge whether operation queue is empty, empty if, jump to (6.2), otherwise jump to (6.5);
(6.2) judge whether waiting list is empty, empty if, jump to (6.3), if be not empty, jump to (6.4);
(6.3) from the waiting list of other concurrent physical processors, find virtual processor, and migration comes, if moved successfully, jump to (6.8), if do not have suitable virtual processor to move, allow idle process, and jump to (6.9);
(6.4) from the operation queue of other concurrent physical processors, find virtual processor, and move and come, if moved successfully, jump to (6.8), otherwise jump to (7);
(6.5) judge whether waiting list is empty, empty if, jump to (6.6), otherwise jump to (6.7);
(6.6) take out the virtual processor of head of the queue in operation queue, and calculate working time, be this virtual processor remaining timeslice within this cycle working time, jumps to (6.9);
(6.7) take out the virtual processor of operation queue head of the queue, and calculate working time, jump to (6.9), be wherein the smaller of the difference of this virtual processor time that in remaining timeslice and waiting list, the virtual processor cycle in head of the queue starts within this cycle and current time working time;
(6.8) virtual processor of electing is put on concurrent physical processor and is moved, and calculate working time;
(6.9) operational factor is set, the set of time that scheduling is started is current time, jumps to (8).
6. a kind of resources of virtual machine dispatching method according to claim 1 and 2, it is characterized in that, the detailed process of described step (7) is: judge whether concurrent physical processor free time is more than or equal to threshold value, if be less than this threshold value, move idle process, jump to (8), otherwise further judge whether the extra queue of high priority is empty, if be not empty, select the virtual processor of head of the queue, jump to (8); Empty if, judge whether the extra queue of low priority is empty, if be not empty, selects the virtual processor of head of the queue, jumps to (8); Empty if, operation idle process, jumps to (8).
7. a kind of resources of virtual machine dispatching method according to claim 1 and 2, it is characterized in that, wherein said extra queue is two, be the extra queue of low priority and the extra queue of high priority, the extra queue of low priority refers to that its element is the extra queue that is arranged in the virtual processor in client territory, and the extra queue of high priority refers to that its element is the extra queue that is arranged in the virtual processor of management domain.
8. a kind of resources of virtual machine dispatching method according to claim 1 and 2, is characterized in that, is also included in the step of the queue on concurrent physical processor being carried out after above-mentioned scheduling load balancing, is 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 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 to each concurrent physical processor, be used for showing current concurrent physical processor status, wherein state comprises idle condition, has task status and busy state, and the ratio of the T.T. that the described busy factor is moved in the cycle at timer by concurrent physical processor and timer cycle T IME_PERIOD is determined;
(III) determine source concurrent physical processor and the object concurrent physical processor of 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, each concurrent physical processor numbering is recorded in respectively in b_idle bitmap, b_task bitmap, b_busy bitmap, wherein 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 whether b_busy bitmap is empty, empty if, jump to (C); Otherwise the concurrent physical processor that in selection b_busy bitmap, common queue length is the longest is as the source concurrent physical processor moving and jump to (D);
(C) judge whether b_task bitmap is empty, empty if, jump to (I); Otherwise the concurrent physical processor that in selection b_task bitmap, common queue length is the longest is as the source concurrent physical processor moving and jump to (D);
(D) judge whether b_idle bitmap is empty, empty if, jump to (E); Otherwise first concurrent physical processor in selection b_idle bitmap is as migration object concurrent physical processor and jump to (G);
(E) judge whether b_task bitmap is empty, empty if, jump to (F); Otherwise select a shortest concurrent physical processor of common queue length in b_task bitmap as the object concurrent physical processor of migration and jump to (G);
(F) judge whether b_busy bitmap is empty, empty if, jump to (I); Otherwise select a shortest concurrent physical processor of common queue length in b_busy bitmap as the object concurrent physical processor of migration and jump to (G);
(G) judge that whether the busy factor of source concurrent physical processor is more than or equal to the busy factor of object concurrent physical processor, if be more than or equal to, jumps to (H); Otherwise jump to (I);
(H) according to definite above migration source concurrent physical processor and object concurrent physical processor, move, finish;
(I) there is no suitable migration source or object concurrent physical processor, be left intact, finish;
(V) between source processor and object processor, move: the queue length of obtaining migration source and destination concurrent physical processor, successively from a virtual processor of source concurrent physical processor migration, and recalculate the queue length of source and destination concurrent physical processor, if the difference of the queue length of the queue length of source concurrent physical processor and object concurrent physical processor is less than 2, migration finishes.
CN201210104221.4A 2012-04-11 2012-04-11 Virtual machine resource scheduling method based on service quality Active CN102662763B (en)

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 CN102662763A (en) 2012-09-12
CN102662763B true 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)

Families Citing this family (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102708011B (en) * 2012-05-11 2014-03-26 南京邮电大学 Adaptive task scheduling method of cloud computing platform
CN103049333B (en) * 2012-12-12 2015-10-21 华中科技大学 A kind of virtual under 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
JP6094272B2 (en) * 2013-03-06 2017-03-15 富士通株式会社 Management system, management method, management program, and management apparatus
CN103294546B (en) * 2013-04-03 2016-04-20 华中科技大学 The online moving method of virtual machine of multi-dimensional resource performance interference aware 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
CN103793274B (en) * 2014-02-19 2017-06-09 上海交通大学 Delta Time piece adjusting apparatus and method in a kind of CREDIT schedulers
CN104793985B (en) * 2015-04-24 2018-03-30 中国联合网络通信集团有限公司 A kind of dispatching method of virtual machine and management equipment
US20160371118A1 (en) * 2015-06-17 2016-12-22 Intel Corporation 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
CN106469193A (en) * 2016-08-30 2017-03-01 北京航空航天大学 Multi load metadata I/O service quality performance support method and system
CN109308220B (en) * 2017-07-26 2021-12-14 华为技术有限公司 Shared resource allocation method and device
CN108874534B (en) * 2018-04-18 2022-09-16 华为技术有限公司 Method and device for scheduling PCPU (physical packet Unit) resources
CN110109733B (en) * 2019-04-29 2022-06-24 东北大学 Virtual machine work queue and redundancy queue updating method oriented to different aging scenes
CN111737176B (en) * 2020-05-11 2022-07-15 瑞芯微电子股份有限公司 PCIE data-based synchronization device and driving method
CN113687909B (en) * 2021-07-28 2024-01-30 华东计算技术研究所(中国电子科技集团公司第三十二研究所) Time-sharing vcpu multi-core scheduling method and system based on microkernel
CN114661415A (en) * 2022-03-04 2022-06-24 阿里巴巴(中国)有限公司 Scheduling method and computer system
CN116893893B (en) * 2023-09-08 2024-03-22 北京翼辉信息技术有限公司 Virtual machine scheduling method and device, electronic equipment and storage medium

Citations (1)

* Cited by examiner, † Cited by third party
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

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8839238B2 (en) * 2010-06-11 2014-09-16 International Business Machines Corporation Dynamic virtual machine shutdown without service interruptions
US8489699B2 (en) * 2010-08-13 2013-07-16 Vmware, Inc. Live migration of virtual machine during direct access to storage over SR IOV adapter

Patent Citations (1)

* Cited by examiner, † Cited by third party
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

Also Published As

Publication number Publication date
CN102662763A (en) 2012-09-12

Similar Documents

Publication Publication Date Title
CN102662763B (en) Virtual machine resource scheduling method based on service quality
CN103678003B (en) The virtual cpu dispatching method that a kind of real-time strengthens
US9286127B2 (en) Method for allocating processor resources precisely by means of predictive scheduling based on current credits
US9672064B2 (en) Dynamically adaptive, resource aware system and method for scheduling
CN102279771B (en) Method and system for adaptively allocating resources as required in virtualization environment
CN103069389B (en) High-throughput computing method and system in a hybrid computing environment
US9405585B2 (en) Management of heterogeneous workloads
CN102253857B (en) Xen virtual machine scheduling control method in multi-core environment
Liu et al. Priority-based consolidation of parallel workloads in the cloud
US20190004866A1 (en) Virtual cpu consolidation to avoid physical cpu contention between virtual machines
Wang et al. Preemptive {ReduceTask} Scheduling for Fair and Fast Job Completion
CN103955398B (en) Virtual machine coexisting scheduling method based on processor performance monitoring
CN103838621B (en) Method and system for scheduling routine work and scheduling nodes
CN102135903B (en) Hardware virtualization-based Xen real-time performance improving system and method thereof
Wang et al. Pigeon: An effective distributed, hierarchical datacenter job scheduler
CN102012835A (en) Virtual central processing unit (CPU) scheduling method capable of supporting software real-time application
Lai et al. Sol: Fast distributed computation over slow networks
CN109240795A (en) A kind of resource regulating method of the cloud computing resources pool model suitable for super fusion IT infrastructure
CN105740059B (en) A kind of population dispatching method towards Divisible task
CN102708003A (en) Method for allocating resources under cloud platform
CN104917839A (en) Load balancing method for use in cloud computing environment
CN104793993A (en) Cloud computing task scheduling method of artificial bee colony particle swarm algorithm based on Levy flight
CN110362411B (en) CPU resource scheduling method based on Xen system
Karatza A simulation-based performance analysis of gang scheduling in a distributed system
Xia et al. Daphne: a flexible and hybrid scheduling framework in multi-tenant clusters

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