WO2016078178A1 - Virtual cpu scheduling method - Google Patents

Virtual cpu scheduling method Download PDF

Info

Publication number
WO2016078178A1
WO2016078178A1 PCT/CN2014/094010 CN2014094010W WO2016078178A1 WO 2016078178 A1 WO2016078178 A1 WO 2016078178A1 CN 2014094010 W CN2014094010 W CN 2014094010W WO 2016078178 A1 WO2016078178 A1 WO 2016078178A1
Authority
WO
WIPO (PCT)
Prior art keywords
cpu
virtual
physical
load
running
Prior art date
Application number
PCT/CN2014/094010
Other languages
French (fr)
Chinese (zh)
Inventor
童薇
冯丹
刘景宁
刘珂男
Original Assignee
华中科技大学
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 华中科技大学 filed Critical 华中科技大学
Publication of WO2016078178A1 publication Critical patent/WO2016078178A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]

Definitions

  • the invention belongs to the field of computer virtualization technology, and particularly relates to a virtual CPU scheduling method, which meets various application requirements by setting multiple types of virtual machines, and dynamically load-isolated and optimized load balancing strategies greatly enhance the entire virtual The performance of the platform.
  • virtualization usually means that computer software runs on a virtual platform rather than a real physical machine.
  • Virtualization technology allows a computer platform to run multiple operating systems simultaneously, and its applications run in separate environments without affecting each other, while ensuring security and isolation while significantly improving computer productivity.
  • Modern computers provide powerful support for virtualization technology, ensuring that multiple virtual machines running on a single physical machine can achieve sufficient performance and run separate operating system instances in each virtual machine, so Many vendors are starting to port their services and applications to the virtualization platform.
  • CPU virtualization and memory virtualization technologies have matured, and the development of I/O virtualization technology has lagged behind.
  • virtual machine I/O operations require virtual machine monitors (virtual Intervention of the abstraction layer, while the competition between I/O resources and I/O response delay between virtual machines always restricts the improvement of I/O performance, affects the overall performance of the virtualization platform, and also limits virtualization. Further promotion and application of technology. Therefore, how to improve the I/O performance of virtual machines has become one of the research priorities of current virtualization technologies.
  • the length of the CPU time slice to run virtual machines of different types of load allocate a shorter CPU time slice for the virtual machine running the I/O type load, and allocate a longer CPU time slice for the virtual machine running the computing load, so that It can reduce the waiting time of virtual machines running I/O type load and increase its scheduled frequency to improve I/O performance.
  • this method still has the following problems: (a) When the virtual CPU running the I/O type load and the virtual CPU running the computational load are in the same virtual CPU running queue, the former is greatly affected by the latter, once waiting for a calculation The virtual CPU of the type load will have a large delay. Therefore, this method can only reduce the delay to some extent. (b) A virtual machine has only one fixed CPU time slice, so only one type can be run.
  • the load does not meet the need to efficiently run both compute and I/O loads in a single virtual machine.
  • Cong Xu, Sahan Gamage and others presented a further improvement in the article "vTurbo: Accelerating Virtual Machine I/O Processing Using Designated Turbo-Sliced Core” (see USENIX Annual Technical Conference, 2013), specifically from the physical CPU.
  • a physical core is allocated for processing I/O events, and a virtual CPU is allocated to the virtual CPU based on the original virtual CPU.
  • the virtual CPU is dedicated to running I/O load and is specially allocated.
  • the physical core is scheduled.
  • PCPU Physical Central Processing Unit
  • Physical CPU scheduling structure In the scheduling algorithm, each physical CPU has a corresponding physical CPU scheduling structure, which stores a virtual CPU running queue on the physical CPU, and a secondary timer that is triggered periodically. If it is the first physical CPU scheduling structure initialized in the system, you need to mark the physical CPU as the primary physical CPU and set the primary timer for it.
  • Physical CPU Bitmap An integer array in which each bit in the array represents a physical CPU of the computer. The specified physical CPU is marked by performing a set operation on a bit in the physical CPU bitmap.
  • I/O bitmap A physical CPU bitmap type defined by the physical CPU bitmap user. Perform a set operation on a bit in the I/O bitmap to mark those dedicated to scheduling the running I/O load virtual CPU.
  • the physical CPU establishes the affinity of the running I/O load virtual CPU and the 1-bit physical CPU in the I/O bitmap by the affinity setting function.
  • Affinity of the virtual CPU and the physical CPU In the case where there are multiple physical CPUs in the virtualization platform, one or more virtual CPUs can be specified to be run through the system-defined affinity setting function.
  • the physical CPU ensures that the one or more virtual CPUs will not be migrated to run on a physical CPU other than the one specified.
  • the bit of the corresponding physical CPU in the affinity variable in the data structure is set to 1.
  • the affinity variable in the data structure is all Bits are all 1, indicating that they can be scheduled on all physical CPUs.
  • Virtual Machine A complete computer system that runs through a software and has full hardware system functionality running in a fully isolated environment.
  • Virtual machine scheduling structure In the scheduling algorithm, each virtual machine has a corresponding virtual machine scheduling structure, which stores information such as its virtual CPU number, virtual CPU linked list, and virtual machine credit value weight.
  • Virtual CPU linked list Each virtual machine has a virtual CPU linked list that manages the virtual machine's Virtual CPU.
  • the number of virtual CPUs in the virtual CPU linked list is the number of virtual CPUs allocated to the virtual machine, sorted according to the virtual CPU number.
  • Virtual CPU The CPU that the virtualization platform allocates to the virtual machine.
  • Idle Virtual CPU (IDLE VCPU): The virtual CPU used for placeholders, which does not complete the actual work, has the lowest priority of -3, and has an idle virtual CPU on the virtual CPU running queue of each physical CPU.
  • Virtual CPU scheduling structure In the scheduling algorithm, each virtual CPU has a corresponding virtual CPU scheduling structure, which stores information such as credit value, priority, and virtual machine to which it belongs.
  • Virtual CPU running queue Each physical CPU has a virtual CPU running queue, which consists of virtual CPUs running on the physical CPU in descending order of priority; virtual CPU priority values are from high to low -1 , -2, -3, respectively, indicating that they can be scheduled, not scheduled, and used only for placeholders;
  • Multi-core processor architecture In today's multi-core processor architecture, a host often has multiple physical sockets, and each physical package encapsulates multiple physical cores. After using hyper-threading technology, each A physical core (core) includes multiple physical CPUs, and each physical core in the same physical package can share a third-level cache; a physical CPU in the same physical core can share a secondary cache; such a cache structure can greatly enhance the internal CPU. Improve the system performance by reading the hit rate of the data without having to look it up in memory or on the hard disk.
  • Virtualization platform It is a software and hardware system that allows multiple virtual machines to run safely on a set of physical hardware.
  • the companies that provide virtualization platforms are: Microsoft, Citrix, and Weirui.
  • Xen It is a virtualization platform developed by the University of Cambridge Computer Laboratory. It is closely integrated with virtual machines and takes up less resources. It is known for its high performance and low resource consumption.
  • Virtual Machine Monitor A virtualized abstraction layer running between the underlying physical server and the operating system that allows multiple operating systems and applications to share hardware, and a virtual machine monitor for each I/O device Establish a corresponding I/O request queue.
  • the core variable in the credit scheduling algorithm determines the priority of the virtual CPU and the length of the CPU time slice that can be obtained.
  • the value range is -300 to 300. Only when the credit value of the virtual CPU is greater than 0, The virtual CPU can be scheduled. Each time the virtual CPU is scheduled, the credit value of the 10 ⁇ time slice length is consumed. When the credit value of the virtual CPU is less than or equal to 0, the next credit value allocation is required.
  • I/O type load I/O-based applications, the CPU load is very light, usually only runs for a short time, and requires more frequent response.
  • Computational load CPU-based applications, usually with a CPU load of 100%, which is required to drop Low scheduling frequency and longest running time.
  • Hybrid load In the operating environment, there are both I/O-based applications and CPU-based applications. CPU-based applications tend to be close to 100% of CPU resources. Applications that are dominated by /O operations are blocked when they are not used up, so in this environment, I/O-oriented applications are given higher priority and their scheduling frequency is increased.
  • Fibre Channel over Ethernet Mapping Fibre Channel to Ethernet allows Fibre Channel information to be inserted into Ethernet packets, allowing Fibre Channel requests and data between servers and storage devices to be transported over Ethernet connections without specialization Fibre Channel structure.
  • the invention provides a virtual CPU scheduling method for a multiprocessor virtualized environment, which solves the problem that the I/O processing cannot be timely responded in the virtualized environment, the load characteristics are not satisfied, and the load balancing strategy in the current mainstream scheduling algorithm is too Simple question.
  • a virtual CPU scheduling method provided by the present invention includes a scheduling initialization step, a step of inserting a virtual CPU running queue, a virtual CPU running step, a load balancing step, a step of updating a credit value and a system load, a step of reallocating a credit value, and reallocating a physical
  • the CPU step and the step of changing the virtual machine type are characterized by:
  • Scheduling initialization step Create a physical CPU scheduling structure for each physical CPU: set a main timer and an adjustment timer for the main physical CPU, and set a secondary timer for other physical CPUs; create a virtual machine scheduling structure for each virtual machine : Initialize the virtual machine credit value weight, set the virtual machine type; initialize the virtual CPU scheduling structure for each virtual machine's virtual CPU: initialize the load variable of each virtual CPU, the I/O task urgency, and allocate for each virtual CPU.
  • Insert virtual CPU running queue step If the current virtual CPU runs the computing load, it is directly inserted after all virtual CPUs of the same priority in the virtual CPU running queue; if the current virtual CPU runs the I/O type load, then press it The priority is sequentially inserted into the virtual CPU running queue. For virtual CPUs with the same priority, the I/O urgency is sorted from large to small.
  • Step of running the virtual CPU If the credit value of the virtual CPU of the current physical CPU is less than or equal to 0, trigger load balancing, and go to step (4); otherwise, run the virtual CPU of the team first, if the current physical CPU is the primary physical CPU.
  • the secondary timer reaches the time, the step (5), the main timer to the time, the step (6), the timer is adjusted to the time, the step (7) is performed, and the user issues a command to modify the virtual machine type.
  • Step (8) is performed; the current physical CPU is a non-primary physical CPU.
  • the secondary timer expires, and the step (5) is performed.
  • the user issues a command to modify the virtual machine type, and the step (8) is executed; the virtual CPU reaches the running. After the time, go to step (2) and re-insert the queue;
  • Load balancing step determine whether the corresponding bit of the current physical CPU in the I/O bitmap is 1, and the non-idle physical CPU with the I/O bitmap set to 1 bit as the target CPU group, otherwise the bitmap will be calculated. Set a non-idle physical CPU as the target CPU group; then select the optimal physical CPU from the target physical CPU group as the target physical CPU of the migration, and abandon the load balancing if the optimal physical CPU is not found;
  • the target physical CPU After the target physical CPU is found, it is determined whether the current physical CPU has a corresponding bit in the I/O bitmap, and the virtual CPU that is the most urgent I/O task in the virtual CPU running queue of the target physical CPU is used as the target virtual CPU. Otherwise, the virtual CPU in the virtual CPU running queue of the target physical CPU that has the historical load closest to the difference between the target physical CPU and the current physical CPU historical load is taken as the target virtual CPU, and the target virtual CPU is deleted from the original queue and inserted into the current physical CPU. Virtual CPU queue leader; turn back to step (3);
  • Update credit value and system load step update the credit value and load variable of the current virtual CPU, and update the historical load variable of the relevant physical CPU, and determine the corresponding physical value of the physical CPU running the current virtual CPU in the I/O bitmap. Whether it is 1, is to update its I / O task pressing variables and global I / O load variables, go back to step (3); otherwise update the global computing load variables; go back to step (3);
  • Re-allocating the credit value step determining the priority according to the credit value of the current virtual CPU, recalculating the credit value quota allocated by each virtual CPU, and updating the credit value of all the virtual CPUs to determine whether the credit value of the updated virtual CPU is Change from non-positive to positive, then change its priority, and return to step (3); otherwise, the priority of the virtual CPU does not change, and directly returns to step (3);
  • Reassign the physical CPU step Calculate the number of physical CPUs running the I/O load and the number of physical CPUs running the calculated load according to the global I/O load variable and the calculated load variable; and modify according to the calculated physical CPU number Corresponding I/O bitmap and calculation bitmap, re-establish the affinity between virtual CPU and physical CPU; clear I/O load variable and calculation load variable to 0, and update all virtual CPU I/O tasks urgently Degree variable, return to step (3);
  • the scheduling initialization step includes the following sub-steps:
  • the corresponding virtual machine credit value weight W i is initialized to 256, the corresponding virtual machine type S i is set to 0, and its virtual CPU linked list is initialized to be empty;
  • S i is 0 indicates a computing load, and S i is 1 indicates an I/O type load, and S i is 2 indicates a hybrid load, and the hybrid load is a load equivalent to a calculation type and an I/O type load;
  • I ij 0 ⁇ 1.
  • I ij 0 ⁇ 1.
  • the larger the I ij value, the more urgent the I/O task is, I ij 0, indicating no I/O load. ;
  • a b is the bits are initialized to all-0, A c is initialized to all you, a system default initialization operation computational load;
  • step (3) Compare whether the priority P ij of the current virtual CPU is equal to the virtual CPU priority P ij in the virtual CPU running queue, and then perform sub-step (2.5), otherwise the sequence is compared backwards until the virtual CPU runs the queue tail. After the insertion is completed, go to step (3);
  • step (3.6) determining whether the running time of the first virtual CPU of the team is less than T s , then proceeding to sub-step (3.7); otherwise, removing the first virtual CPU from the primary physical CPU, and then moving to step (2);
  • step (3.9) determining whether the running time of the first virtual CPU of the team is less than T s , then proceeding to sub-step (3.10); otherwise, removing the first virtual CPU from the current physical CPU, and proceeding to step (2);
  • step (2) when subjected to a secondary timer times the time T, then the secondary timer is reset, go to step (5), if the timer does not trigger any time T S, the virtual CPU operation time duration T S, the team The first virtual CPU is removed from the current physical CPU, and the process proceeds to step (2);
  • the load balancing step includes the following substeps:
  • Update the load variable H ij of the current virtual CPU assign the value of H ij +10 ⁇ T 1 to H ij ;
  • Update the historical load variable H p of the physical CPU running the current virtual CPU assign the value of H p +10 ⁇ T 1 to H p ;
  • T 1 is the time elapsed since the last virtual CPU has been running since the last time, in units of ms;
  • the credit value consumed by the virtual CPU is added to the system load: it is determined whether the physical CPU running the current virtual CPU has a corresponding bit value in the bitmap A b , and the global value is updated.
  • the I/O load variable L b , the value of L b +10 ⁇ T 1 is assigned to L b , the rotor step (3.4); otherwise the global calculated load variable L c is updated, and the value of L c +10 ⁇ T 1 is assigned L c , rotor step (3.4);
  • the step of reallocating the credit value includes the following substeps:
  • NC ij G ⁇ T main ⁇ 10 ⁇ W i / (W T ⁇ M i );
  • NC ij is the newly obtained credit value of the jth virtual CPU of the i-th virtual machine
  • the process of reallocating the physical CPU includes the following substeps:
  • N( Ab ) (L b /(L b +L c )) ⁇ G;
  • Re-establish the operating computational load is calculated for all virtual CPU and bit map A c is set in a physical affinity for the CPU;
  • Steps to change the virtual machine type including the following sub-steps:
  • the modify virtual machine type command includes a virtual machine ID field, a virtual machine type field, and a virtual CPU number field, and the virtual machine ID field gives a virtual machine ID of a type to be modified; the virtual machine type field gives a virtual machine type Q to be modified.
  • Q is 0 for the computational load, Q is 1 for the I/O load, and Q is 2 for the hybrid load;
  • the affinity function can be set by the system definition
  • the virtual CPU and I/ can be re-established by the system-defined setting affinity function.
  • the O bitmap A b or the affinity of the physical CPU set to 1 bit in the bitmap A c is calculated.
  • the focus is on the fair distribution of physical CPU resources to each virtual CPU, but this kind of fairness is only superficial, because different loads have different requirements for the operating environment, I/O type load.
  • the execution time is short, but it is desirable to schedule low-latency and high-frequency.
  • the virtual CPU running the I/O type load is easy to cause high delay due to waiting in queue.
  • the present invention classifies virtual machines, delay-sensitive virtual machines exclusively run I/O type loads; non-delay-sensitive virtual machines exclusively run computational loads; A virtual machine that runs multiple types of workloads simultaneously. Allocating a long time slice for a virtual machine running a computational load reduces the overhead of environment switching; assigns a shorter time slice to a virtual machine running an I/O type load, and obtains a higher scheduling frequency; for a hybrid load
  • the virtual machine needs to take into account the characteristics of the two types of load at the same time, and then perform internal virtual CPU partitioning, set a short time slice for the virtual CPU running the I/O type load, and set a normal time slice for the virtual CPU running the computing load. Let it run efficiently.
  • the present invention performs dynamic load isolation, which divides the physical CPU into two groups, a set of virtual CPUs that schedule I/O loads, and a set of virtual CPUs that schedule computational loads.
  • the basis of the grouping is the weight of the total load of the system occupied by the I/O type load and the calculation type load. According to the adjustment timer, the physical CPU group is re-adjusted every certain period, and the system is guaranteed to be good under the premise of load isolation. flexibility.
  • the present invention adds an urgency index of the I/O task to the virtual CPU, so that the urgent I/O event can be preferentially processed;
  • the present invention also considers the problem that the existing virtual CPU scheduling algorithm load balancing strategy is too simple.
  • a load balancing strategy is redesigned, taking into account the hierarchical structure of the physical CPU. Selecting the optimal target physical CPU in the same physical core, the same physical package, and different physical packages in turn, in addition to ensuring the isolation of different types of workloads, the strategy of selecting the least migration overhead is also selected when the target virtual CPU of the migration is selected.
  • the type of load for a compute load, choose a scenario where the physical CPU run queue load is equivalent after migration; for I/O load, select an I/O task. The most urgent virtual CPU migration to ensure I/O performance.
  • Figure 1 is a schematic flow chart of the present invention
  • 3 is a flow chart of a virtual CPU running step
  • Figure 4 is a flow chart of the load balancing step
  • Figure 5 is a flow chart showing the steps of reallocating a physical CPU
  • Figure 6 is a block diagram showing the steps for changing the virtual machine type.
  • the present invention includes a scheduling initialization step, a virtual CPU running queue step, a virtual CPU running step, a load balancing step, an update credit value and system load step, a process of reallocating a credit value, a process of reallocating a physical CPU, and a change.
  • Virtual machine type step ;
  • Scheduling initialization step Create a physical CPU scheduling structure for each physical CPU: set a main timer and an adjustment timer for the main physical CPU, and set a secondary timer for other physical CPUs; create a virtual machine scheduling structure for each virtual machine : Initialize the virtual machine credit value weight, set the virtual machine type; initialize the virtual CPU scheduling structure for each virtual machine's virtual CPU: initialize the load variable of each virtual CPU, the I/O task urgency, and allocate for each virtual CPU.
  • Insert virtual CPU running queue step If the current virtual CPU runs the computing load, it is directly inserted after all virtual CPUs of the same priority in the virtual CPU running queue; if the current virtual CPU runs the I/O type load, then press it The priority is sequentially inserted into the virtual CPU running queue. For virtual CPUs with the same priority, the I/O urgency is sorted from large to small.
  • Step (8) If the credit value of the virtual CPU of the current physical CPU is less than or equal to 0, trigger load balancing, and go to step (4); otherwise, run the virtual CPU of the team first, if the current physical CPU is the main Physical CPU, running, secondary timer to time, go to step (5), master timer to time, go to step (6), adjust timer to time, go to step (7), user issues modified virtual machine type If the command is executed, go to step (8); the current physical CPU is a non-primary physical CPU. During the running process, the secondary timer expires. Go to step (5). The user issues a command to modify the virtual machine type. Step (8); virtual CPU After the running time is reached, go to step (2) and re-insert the queue;
  • Load balancing step determine whether the corresponding bit of the current physical CPU in the I/O bitmap is 1, and the non-idle physical CPU with the I/O bitmap set to 1 bit as the target CPU group, otherwise the bitmap will be calculated. Set a non-idle physical CPU as the target CPU group; then select the optimal physical CPU from the target physical CPU group as the target physical CPU of the migration, and abandon the load balancing if the optimal physical CPU is not found;
  • the target physical CPU After the target physical CPU is found, it is determined whether the current physical CPU has a corresponding bit in the I/O bitmap, and the virtual CPU that is the most urgent I/O task in the virtual CPU running queue of the target physical CPU is used as the target virtual CPU. Otherwise, the virtual CPU in the virtual CPU running queue of the target physical CPU that has the historical load closest to the difference between the target physical CPU and the current physical CPU historical load is taken as the target virtual CPU, and the target virtual CPU is deleted from the original queue and inserted into the current physical CPU. Virtual CPU queue leader; turn back to step (3);
  • Update credit value and system load step update the credit value and load variable of the current virtual CPU, and update the historical load variable of the relevant physical CPU, and determine the corresponding physical value of the physical CPU running the current virtual CPU in the I/O bitmap. Whether it is 1, is to update its I / O task pressing variables and global I / O load variables, go back to step (3); otherwise update the global computing load variables; go back to step (3);
  • Re-allocating the credit value step determining the priority according to the credit value of the current virtual CPU, recalculating the credit value quota allocated by each virtual CPU, and updating the credit value of all the virtual CPUs to determine whether the credit value of the updated virtual CPU is Change from non-positive to positive, then change its priority, and return to step (3); otherwise, the priority of the virtual CPU does not change, and directly returns to step (3);
  • Reassign the physical CPU step Calculate the number of physical CPUs running the I/O load and the number of physical CPUs running the calculated load according to the global I/O load variable and the calculated load variable; and modify according to the calculated physical CPU number Corresponding I/O bitmap and calculation bitmap, re-establish the affinity between virtual CPU and physical CPU; clear I/O load variable and calculation load variable to 0, and update all virtual CPU I/O tasks urgently Degree variable, return to step (3);
  • the application background of the embodiment of the present invention is that the host has two physical packages, and each physical package has four physical cores, and hyperthreading is enabled.
  • Each physical core contains two physical CPUs, the experimental platform operating system is CentOS-6.4, the virtual machine monitoring program is Xen-4.2.0, the kernel version is Linux-3.2.0, and the host runs 16 virtual machines, each virtual machine. 4 virtual CPUs, the virtual machine operating system is CentOS-6.4, and the kernel version is Linux-3.2.0.
  • Embodiments of the present invention include a scheduling initialization step, a virtual CPU running queue step, a virtual CPU running step, a load balancing step, an update credit value and system load step, a process of reallocating a credit value, reallocating a physical CPU step, and changing a virtual machine Type step:
  • the scheduling initialization step includes the following sub-steps:
  • the corresponding virtual machine credit value weight W i is initialized to 256, the corresponding virtual machine type S i is set to 0, and its virtual CPU linked list is initialized to be empty;
  • the virtual machine number i 1 to 16;
  • bitmap A b and calculate bitmap A c which are complementary physical CPU bitmaps, initialize each bit in A b to all 0s, and initialize each bit in A c to all 1s, indicating that the system is initialized by default.
  • step (3) Compare whether the priority P ij of the current virtual CPU is equal to the virtual CPU priority P ij in the virtual CPU running queue, and then perform sub-step (2.5), otherwise the sequence is compared backwards until the virtual CPU runs the queue tail. After the insertion is completed, go to step (3);
  • step (3.6) determining whether the running time of the first virtual CPU of the team is less than T s , then proceeding to sub-step (3.7); otherwise, removing the first virtual CPU from the primary physical CPU, and then moving to step (2);
  • step (3.9) determining whether the running time of the first virtual CPU of the team is less than T s , then proceeding to sub-step (3.10); otherwise, removing the first virtual CPU from the current physical CPU, and proceeding to step (2);
  • step (2) when subjected to a secondary timer times the time T, then the secondary timer is reset, go to step (5), if the timer does not trigger any time T S, the virtual CPU operation time duration T S, the team The first virtual CPU is removed from the current physical CPU, and the process proceeds to step (2);
  • the load balancing step includes the following sub-steps:
  • Update the load variable H ij of the current virtual CPU assign the value of H ij +10 ⁇ T 1 to H ij ;
  • Update the historical load variable H p of the physical CPU running the current virtual CPU assign the value of H p +10 ⁇ T 1 to H p ;
  • the credit value consumed by the virtual CPU is added to the system load: it is determined whether the physical CPU running the current virtual CPU has a corresponding bit value in the bitmap A b , and the global value is updated.
  • the I/O load variable L b , the value of L b +10 ⁇ T 1 is assigned to L b , the rotor step (3.4); otherwise the global calculated load variable L c is updated, and the value of L c +10 ⁇ T 1 is assigned L c , rotor step (3.4);
  • the step of reallocating the credit value includes the following substeps:
  • NC ij is the newly obtained credit value of the jth virtual CPU of the i-th virtual machine
  • the process of reallocating the physical CPU includes the following substeps:
  • N( Ab ) (L b /(L b +L c )) ⁇ 16;
  • Re-establish the operating computational load is calculated for all virtual CPU and bit map A c is set in a physical affinity for the CPU;
  • the step of changing the virtual machine type includes the following substeps:
  • the system-defined setting affinity function int vcpu_set_affinity(struct vcpu*v, const cpumask_t *affinity) re-establish the virtual CPU and I / O bitmap A b or calculate the affinity of the physical CPU set in the bitmap A c , where the parameter struct vcpu * v is the virtual need to reset the affinity CPU pointer, cpumask_t*affinity is the target physical CPU bitmap pointer for setting affinity.

Abstract

A virtual CPU scheduling method, which belongs to the technical field of computer virtualization, and solves the problems that I/O processing cannot be responded in time, load characteristics cannot be satisfied, and a load balancing policy is too simple in an existing scheduling algorithm. The present invention comprises an initialization scheduling step, a virtual CPU running queue inserting step, a virtual CPU running step, a load balancing step, a credit value and system load updating step, a credit value redistribution step, a physical CPU redistribution step and a virtual machine type changing step. In the present invention, virtual machines are divided into three types, different types of loads are dynamically isolated, and are bound to two groups of physical CPUs with different types of loads for running, and different time slices are given to virtual CPUs running different types of loads, thereby improving the running efficiency and ensuring the I/O performance. In the present invention, a load balancing policy is redesigned, and besides ensuring the isolation of different types of loads, a policy with lowest migration overheads is selected to solve the problem that a load balancing policy is too simple in an existing scheduling algorithm.

Description

一种虚拟CPU调度方法Virtual CPU scheduling method 【技术领域】[Technical Field]
本发明属于计算机虚拟化技术领域,具体涉及一种虚拟CPU调度方法,通过设置多种类型的虚拟机来满足各类应用需求,并且动态地负载隔离以及优化的负载均衡策略大大的提升了整个虚拟化平台的性能。The invention belongs to the field of computer virtualization technology, and particularly relates to a virtual CPU scheduling method, which meets various application requirements by setting multiple types of virtual machines, and dynamically load-isolated and optimized load balancing strategies greatly enhance the entire virtual The performance of the platform.
【背景技术】【Background technique】
当前,计算机性能无论是在CPU、内存或者网络方面都有了质的提升,在一个服务器上运行一个操作系统的传统计算机架构,无法很好的利用这些优势,导致计算机的利用率很不理想,根据市场调研公司国际数据公司(International Data Corporation,IDC)的报告,在IT企业典型的数据中心,基础物理架构的平均利用率只有10%到15%,大部分计算机资源没有得到充分利用;其次,随着能耗以及维护问题得到越来越多人的关注,虚拟化技术开始得到学术界以及工业界的关注。At present, computer performance has a qualitative improvement in terms of CPU, memory or network. Running a traditional computer architecture of an operating system on a server cannot make good use of these advantages, resulting in a very unsatisfactory utilization of the computer. According to a report by the international research firm International Data Corporation (IDC), in a typical data center of an IT enterprise, the average utilization rate of the basic physical architecture is only 10% to 15%, and most of the computer resources are not fully utilized. Secondly, As energy consumption and maintenance issues get more and more attention, virtualization technology has begun to receive attention from academia and industry.
在计算机领域,虚拟化通常是指计算机软件在一个虚拟平台上而不是真实的物理机上运行。虚拟化技术允许一个计算机平台同时运行多个操作系统,并且其应用程在彼此独立的环境中运行而互不影响,在保证了安全性和隔离性的同时,显著提高计算机的工作效率。现代计算机为虚拟化技术提供了强大的支持,保证在一台物理机器上运行的多台虚拟机均可获得足够的性能,并在各个虚拟机中运行单独的操作系统实例,因此,越来越多的厂商开始将自己的服务以及应用移植到虚拟化平台下运行。经过多年的发展,CPU虚拟化与内存虚拟化技术已日趋成熟,而I/O虚拟化技术的发展却相对滞后,因为安全性的考虑,虚拟机的I/O操作需要虚拟机监控器(虚拟化抽象层)的干预,同时虚拟机之间对I/O资源的竞争以及I/O响应延时始终制约着I/O性能的提升,影响了虚拟化平台的整体性能,也限制了虚拟化技术的进一步推广应用。因此,如何提高虚拟机的I/O性能成为当前虚拟化技术的研究重点之一。In the computer world, virtualization usually means that computer software runs on a virtual platform rather than a real physical machine. Virtualization technology allows a computer platform to run multiple operating systems simultaneously, and its applications run in separate environments without affecting each other, while ensuring security and isolation while significantly improving computer productivity. Modern computers provide powerful support for virtualization technology, ensuring that multiple virtual machines running on a single physical machine can achieve sufficient performance and run separate operating system instances in each virtual machine, so Many vendors are starting to port their services and applications to the virtualization platform. After years of development, CPU virtualization and memory virtualization technologies have matured, and the development of I/O virtualization technology has lagged behind. Because of security considerations, virtual machine I/O operations require virtual machine monitors (virtual Intervention of the abstraction layer, while the competition between I/O resources and I/O response delay between virtual machines always restricts the improvement of I/O performance, affects the overall performance of the virtualization platform, and also limits virtualization. Further promotion and application of technology. Therefore, how to improve the I/O performance of virtual machines has become one of the research priorities of current virtualization technologies.
目前,提升虚拟机I/O性能主要有两种方式,一种方式是减少虚拟机监控器的干预,虚拟机监控器的介入会影响虚拟机的正常运行,发生上下文切换,造成巨大的开销;另一种方式是优化虚拟CPU的调度,让虚拟机能得到更快的响应。目前主流的虚拟CPU调度算法注重的是让虚拟机按比例公平共享计算机资源,不能保证实时性,响应时间要求较高的应用中,事件的响应延迟与其所处虚拟CPU队列位置密切相关,这样不但延时不稳定,并且一旦处于较后的位置就要忍受极大的延时。2008年,Diego Ongaro等人 在《Scheduling I/O in Virtual Machine Monitors》(见ACM SIGPLAN/SIGOPS Conference on Virtual Execution Environments,2008)一文中提出在虚拟化平台Xen的信用值调度方法中添加突发(BOOST)状态,当虚拟CPU在阻滞状态被I/O事件唤醒时,则进入突发状态,引起一次虚拟CPU调度,在该次调度中,处于突发状态的虚拟CPU抢占物理CPU,处理I/O事件,但即便是突发机制也只在虚拟CPU被唤醒时才有用,一旦有其它应用能持续消耗虚拟CPU的时间片,虚拟CPU便不会阻滞,因此对于大多数的I/O型任务仍然存在响应延时的问题。2012年,Cong Xu,Sahan Gamage等人在《vSlicer:Latency-Aware Virtual Machine Scheduling via Differentiated-Frequency CPU Slicing》(见The 21st international symposium on High-Performance Parallel and Distributed Computing,2012)一文中提出了采用不同长度的CPU时间片来运行不同类型负载的虚拟机,为运行I/O型负载的虚拟机分配较短的CPU时间片,为运行计算型负载的虚拟机分配较长的CPU时间片,如此便可以降低运行I/O型负载的虚拟机的等待时间并增加其被调度的频率,提升I/O性能。但是该方法仍然存在下述问题:(a)运行I/O型负载的虚拟CPU与运行计算型负载的虚拟CPU在同一虚拟CPU运行队列中时,前者受后者的影响大,一旦等待一个计算型负载的虚拟CPU运行就会有很大的延时,因此,这种方法只能一定程度上降低延时;(b)一个虚拟机只有一种固定的CPU时间片,因此只能运行单类型的负载,无法满足在一个虚拟机内同时高效运行计算型负载以及I/O型负载的需求。2013年,Cong Xu,Sahan Gamage等人在《vTurbo:Accelerating Virtual Machine I/O Processing Using Designated Turbo-Sliced Core》(见USENIX Annual Technical Conference,2013)一文提出了进一步的改善方案,专门从物理CPU中分出一个物理核用于处理I/O事件,并在虚拟机原有的虚拟CPU基础上,再多为其分配一个虚拟CPU,该虚拟CPU专用于运行I/O负载,并由专门分配的物理核进行调度。该方案消除了计算型负载对I/O处理的影响,进一步的提升了I/O性能,但是仍然存在一些不足:(a)静态的物理CPU资源分配,当系统不同类型的负载比重相差很大时会造成资源利用率很低;(b)虚拟机具有两种类型的虚拟CPU,运行单类型的负载时,无法将虚拟CPU性能发挥到极致。随着多核处理器的流行,目前虚拟CPU调度算法中的负载均衡策略也被认为太过于简单,仅仅遍历系统中的物理CPU,并寻找队列中非空闲虚拟CPU进行迁移,没有考虑到迁移的开销与进一步提升性能。在现今的高速应用中,对带宽和I/O延时的要求是相当高的,例如在IT企业数据中心被广泛使用的以太网光纤通道,对于此类对响应延迟 要求高的应用,现有的虚拟CPU调度算法并不适用。Currently, there are two main ways to improve the performance of virtual machine I/O. One way is to reduce the intervention of the virtual machine monitor. The intervention of the virtual machine monitor will affect the normal operation of the virtual machine, and context switching occurs, causing huge overhead; Another way is to optimize the scheduling of the virtual CPU so that the virtual machine can get a faster response. At present, the mainstream virtual CPU scheduling algorithm focuses on allowing virtual machines to share computer resources proportionally and fairly, and cannot guarantee real-time performance. In applications with high response time requirements, the response delay of events is closely related to the virtual CPU queue position. The delay is unstable and it is subject to extreme delays once in the latter position. In 2008, Diego Ongaro et al. In the article "Scheduling I/O in Virtual Machine Monitors" (see ACM SIGPLAN/SIGOPS Conference on Virtual Execution Environments, 2008), it is proposed to add a burst (BOOST) state in the credit value scheduling method of the virtualization platform Xen, when the virtual CPU When the blocking state is awakened by an I/O event, it enters a burst state, causing a virtual CPU scheduling. In this scheduling, the virtual CPU in a burst state preempts the physical CPU and processes the I/O event, but even The burst mechanism is only useful when the virtual CPU is woken up. Once other applications can continue to consume the time slice of the virtual CPU, the virtual CPU will not block, so there is still a response delay for most I/O tasks. The problem. In 2012, Cong Xu, Sahan Gamage et al. proposed different adoptions in the article "vSlicer: Latency-Aware Virtual Machine Scheduling via Differentiated-Frequency CPU Slicing" (see The 21st international symposium on High-Performance Parallel and Distributed Computing, 2012). The length of the CPU time slice to run virtual machines of different types of load, allocate a shorter CPU time slice for the virtual machine running the I/O type load, and allocate a longer CPU time slice for the virtual machine running the computing load, so that It can reduce the waiting time of virtual machines running I/O type load and increase its scheduled frequency to improve I/O performance. However, this method still has the following problems: (a) When the virtual CPU running the I/O type load and the virtual CPU running the computational load are in the same virtual CPU running queue, the former is greatly affected by the latter, once waiting for a calculation The virtual CPU of the type load will have a large delay. Therefore, this method can only reduce the delay to some extent. (b) A virtual machine has only one fixed CPU time slice, so only one type can be run. The load does not meet the need to efficiently run both compute and I/O loads in a single virtual machine. In 2013, Cong Xu, Sahan Gamage and others presented a further improvement in the article "vTurbo: Accelerating Virtual Machine I/O Processing Using Designated Turbo-Sliced Core" (see USENIX Annual Technical Conference, 2013), specifically from the physical CPU. A physical core is allocated for processing I/O events, and a virtual CPU is allocated to the virtual CPU based on the original virtual CPU. The virtual CPU is dedicated to running I/O load and is specially allocated. The physical core is scheduled. This solution eliminates the impact of computational load on I/O processing and further improves I/O performance, but there are still some shortcomings: (a) static physical CPU resource allocation, when the system's different types of load weights vary greatly The resource utilization is very low; (b) The virtual machine has two types of virtual CPUs, and when running a single type of load, the virtual CPU performance cannot be maximized. With the popularity of multi-core processors, the current load balancing strategy in the virtual CPU scheduling algorithm is also considered too simple. It only traverses the physical CPU in the system and looks for non-idle virtual CPUs in the queue for migration, without considering the overhead of migration. And further improve performance. In today's high-speed applications, bandwidth and I/O latency requirements are quite high, such as Ethernet Fibre Channel, which is widely used in IT enterprise data centers, for such pairs of response delays. For high-demand applications, existing virtual CPU scheduling algorithms are not applicable.
为了清楚地理解本发明,以下对本发明中所使用的术语进行解释:In order to clearly understand the present invention, the terms used in the present invention are explained below:
物理CPU(Physical Central Processing Unit,PCPU):计算机系统中真实的处理器单元;一个计算机系统可以有多个物理CPU,计算机系统通过物理CPU位图来标记、管理各物理CPU。Physical Central Processing Unit (PCPU): A real processor unit in a computer system; a computer system can have multiple physical CPUs, and the computer system marks and manages each physical CPU through physical CPU bitmaps.
物理CPU调度结构:在调度算法中,每一个物理CPU都有一个对应的物理CPU调度结构,保存该物理CPU上的虚拟CPU运行队列、定时触发的次级计时器等。如果是系统中第一个初始化的物理CPU调度结构,需要将该物理CPU标记为主物理CPU,并为其设置主计时器。Physical CPU scheduling structure: In the scheduling algorithm, each physical CPU has a corresponding physical CPU scheduling structure, which stores a virtual CPU running queue on the physical CPU, and a secondary timer that is triggered periodically. If it is the first physical CPU scheduling structure initialized in the system, you need to mark the physical CPU as the primary physical CPU and set the primary timer for it.
物理CPU位图:为一个整型数组,数组中每一位代表中计算机的一个物理CPU,通过对物理CPU位图中的某位执行置1操作来标记指定的物理CPU。Physical CPU Bitmap: An integer array in which each bit in the array represents a physical CPU of the computer. The specified physical CPU is marked by performing a set operation on a bit in the physical CPU bitmap.
I/O位图:对物理CPU位图用户所定义的一个物理CPU位图类型,对I/O位图中的某位执行置1操作来标记那些专用于调度运行I/O负载虚拟CPU的物理CPU,通过亲和性设置函数来建立运行I/O负载虚拟CPU与I/O位图中置1位物理CPU的亲和性。I/O bitmap: A physical CPU bitmap type defined by the physical CPU bitmap user. Perform a set operation on a bit in the I/O bitmap to mark those dedicated to scheduling the running I/O load virtual CPU. The physical CPU establishes the affinity of the running I/O load virtual CPU and the 1-bit physical CPU in the I/O bitmap by the affinity setting function.
计算位图:对物理CPU位图用户所定义的一个物理CPU位图类型,对计算位图中的某位执行置1操作来标记那些专用于调度运行计算型负载虚拟CPU的物理CPU,通过亲和性设置函数来建立运行计算型负载虚拟CPU与计算位图中置1位物理CPU的亲和性。Calculate the bitmap: a physical CPU bitmap type defined by the physical CPU bitmap user. Perform a set operation on a bit in the calculation bitmap to mark those physical CPUs dedicated to scheduling the computational load-based virtual CPU. And the sex setting function to establish the affinity of running the computational load virtual CPU and computing the 1-bit physical CPU in the bitmap.
虚拟CPU与物理CPU的亲和性(affinity):指在虚拟化平台中,存在多个物理CPU的情况下,可以通过系统定义的亲和性设置函数对某一个或多个虚拟CPU指定可运行的物理CPU,保证该一个或多个虚拟CPU不会迁移到指定以外的物理CPU上运行。对于设置了亲和性的虚拟CPU,其数据结构中的亲和性变量中对应的物理CPU的位会置1,对于未设置亲和性的虚拟CPU,其数据结构中的亲和性变量所有位均为1,表示可以在所有物理CPU上调度。Affinity of the virtual CPU and the physical CPU: In the case where there are multiple physical CPUs in the virtualization platform, one or more virtual CPUs can be specified to be run through the system-defined affinity setting function. The physical CPU ensures that the one or more virtual CPUs will not be migrated to run on a physical CPU other than the one specified. For a virtual CPU with affinity set, the bit of the corresponding physical CPU in the affinity variable in the data structure is set to 1. For the virtual CPU without affinity, the affinity variable in the data structure is all Bits are all 1, indicating that they can be scheduled on all physical CPUs.
虚拟机(Virtual Machine):指通过软件模拟的具有完整硬件系统功能的、运行在一个完全隔离环境中的完整计算机系统。Virtual Machine: A complete computer system that runs through a software and has full hardware system functionality running in a fully isolated environment.
虚拟机调度结构:在调度算法中,每一个虚拟机都有一个对应的虚拟机调度结构,保存其虚拟CPU数目,虚拟CPU链表,虚拟机信用值权重等信息。Virtual machine scheduling structure: In the scheduling algorithm, each virtual machine has a corresponding virtual machine scheduling structure, which stores information such as its virtual CPU number, virtual CPU linked list, and virtual machine credit value weight.
虚拟CPU链表:每一个虚拟机都具有一个虚拟CPU链表,管理该虚拟机所具有的 虚拟CPU。虚拟CPU链表中的虚拟CPU的数目即为该虚拟机所分配的虚拟CPU数目,依据虚拟CPU编号排序。Virtual CPU linked list: Each virtual machine has a virtual CPU linked list that manages the virtual machine's Virtual CPU. The number of virtual CPUs in the virtual CPU linked list is the number of virtual CPUs allocated to the virtual machine, sorted according to the virtual CPU number.
虚拟CPU(VCPU):虚拟化平台分配给虚拟机的CPU。Virtual CPU (VCPU): The CPU that the virtualization platform allocates to the virtual machine.
空闲虚拟CPU(IDLE VCPU):用来占位的虚拟CPU,不完成实际工作,具有最低的优先级-3,在每个物理CPU的虚拟CPU运行队列上均有一个空闲虚拟CPU。Idle Virtual CPU (IDLE VCPU): The virtual CPU used for placeholders, which does not complete the actual work, has the lowest priority of -3, and has an idle virtual CPU on the virtual CPU running queue of each physical CPU.
虚拟CPU调度结构:在调度算法中,每一个虚拟CPU都有一个对应的虚拟CPU调度结构,保存其信用值、优先级,所属的虚拟机等信息。Virtual CPU scheduling structure: In the scheduling algorithm, each virtual CPU has a corresponding virtual CPU scheduling structure, which stores information such as credit value, priority, and virtual machine to which it belongs.
虚拟CPU运行队列:每个物理CPU具有一个虚拟CPU运行队列,由在该物理CPU上运行的虚拟CPU按照优先级从高到低的顺序组成;虚拟CPU的优先级值从高到低为-1、-2、-3,分别表示其可被调度、不可被调度、仅用于占位;Virtual CPU running queue: Each physical CPU has a virtual CPU running queue, which consists of virtual CPUs running on the physical CPU in descending order of priority; virtual CPU priority values are from high to low -1 , -2, -3, respectively, indicating that they can be scheduled, not scheduled, and used only for placeholders;
多核处理器架构:在现今的多核处理器架构中,一台主机往往存在多个物理封装(socket),每一个物理封装中又封装了多个物理核(core),采用超线程技术后,每一个物理核(core)又包括多个物理CPU,同一物理封装中的各物理核能够共享三级缓存;同一物理核中的物理CPU能够共享二级缓存;这样的缓存结构可以大幅的提升CPU内部读取数据的命中率,而不用再到内存或者硬盘上寻找,以此提高系统性能。Multi-core processor architecture: In today's multi-core processor architecture, a host often has multiple physical sockets, and each physical package encapsulates multiple physical cores. After using hyper-threading technology, each A physical core (core) includes multiple physical CPUs, and each physical core in the same physical package can share a third-level cache; a physical CPU in the same physical core can share a secondary cache; such a cache structure can greatly enhance the internal CPU. Improve the system performance by reading the hit rate of the data without having to look it up in memory or on the hard disk.
虚拟化平台:是让多个虚拟机可以在一套物理硬件上安全运行的软硬件系统,目前提供虚拟化平台的公司有:微软,思杰,威睿等。Virtualization platform: It is a software and hardware system that allows multiple virtual machines to run safely on a set of physical hardware. The companies that provide virtualization platforms are: Microsoft, Citrix, and Weirui.
Xen:是英国剑桥大学计算机实验室开发的一种虚拟化平台,它和虚拟机密切结合,占用资源少,以高性能、占用资源少著称。Xen: It is a virtualization platform developed by the University of Cambridge Computer Laboratory. It is closely integrated with virtual machines and takes up less resources. It is known for its high performance and low resource consumption.
虚拟机监控器(Virtual Machine Monitor,VMM):运行在基础物理服务器和操作系统之间的虚拟化抽象层,可允许多个操作系统和应用共享硬件,虚拟机监控器为每台I/O设备建立相应的I/O请求队列。Virtual Machine Monitor (VMM): A virtualized abstraction layer running between the underlying physical server and the operating system that allows multiple operating systems and applications to share hardware, and a virtual machine monitor for each I/O device Establish a corresponding I/O request queue.
信用值(credit):credit调度算法中的核心变量,决定虚拟CPU的优先级以及能获得的CPU时间片长度,其值域为-300~300,只有当虚拟CPU的信用值大于0时,该虚拟CPU才可以得到调度,每一次调度虚拟CPU都会消耗10×时间片长度的信用值额度,当虚拟CPU的信用值额度小于或等于0时,则需等待下一次信用值分配。Credit: The core variable in the credit scheduling algorithm determines the priority of the virtual CPU and the length of the CPU time slice that can be obtained. The value range is -300 to 300. Only when the credit value of the virtual CPU is greater than 0, The virtual CPU can be scheduled. Each time the virtual CPU is scheduled, the credit value of the 10× time slice length is consumed. When the credit value of the virtual CPU is less than or equal to 0, the next credit value allocation is required.
I/O型负载:以I/O操作为主的应用程序,CPU负担很轻,通常只运行很短的时间,需要的是更为频繁的响应。I/O type load: I/O-based applications, the CPU load is very light, usually only runs for a short time, and requires more frequent response.
计算型负载:以CPU操作为主的应用程序,通常CPU负载达到100%,需要的是降 低调度频率并且尽量长的运行时间。Computational load: CPU-based applications, usually with a CPU load of 100%, which is required to drop Low scheduling frequency and longest running time.
混合型负载:运行环境中同时有以I/O操作为主的应用程序和以CPU操作为主的应用程序,往往以CPU操作为主的应用程序会接近100%的占用CPU资源,而以I/O操作为主的应用程序还没有用完时间片就被阻塞,因此在这种环境中要给以I/O操作为主的应用程序更高的优先级,增加其调度频率。Hybrid load: In the operating environment, there are both I/O-based applications and CPU-based applications. CPU-based applications tend to be close to 100% of CPU resources. Applications that are dominated by /O operations are blocked when they are not used up, so in this environment, I/O-oriented applications are given higher priority and their scheduling frequency is increased.
以太网光纤通道:将光纤通道映射到以太网,可以将光纤通道信息插入以太网信息包内,从而让服务器和存储设备之间的光纤通道请求和数据可以通过以太网连接来传输,而无需专门的光纤通道结构。Fibre Channel over Ethernet: Mapping Fibre Channel to Ethernet allows Fibre Channel information to be inserted into Ethernet packets, allowing Fibre Channel requests and data between servers and storage devices to be transported over Ethernet connections without specialization Fibre Channel structure.
【发明内容】[Summary of the Invention]
本发明提供一种虚拟CPU调度方法,用于多处理机虚拟化环境,解决在虚拟化环境中I/O处理无法得到及时响应、负载特性得不到满足以及当前主流调度算法中负载均衡策略过于简单的的问题。The invention provides a virtual CPU scheduling method for a multiprocessor virtualized environment, which solves the problem that the I/O processing cannot be timely responded in the virtualized environment, the load characteristics are not satisfied, and the load balancing strategy in the current mainstream scheduling algorithm is too Simple question.
本发明所提供的一种虚拟CPU调度方法,包括调度初始化步骤、插入虚拟CPU运行队列步骤、虚拟CPU运行步骤、负载均衡步骤、更新信用值与系统负载步骤、重新分配信用值步骤、重新分配物理CPU步骤和更改虚拟机类型步骤,其特征在于:A virtual CPU scheduling method provided by the present invention includes a scheduling initialization step, a step of inserting a virtual CPU running queue, a virtual CPU running step, a load balancing step, a step of updating a credit value and a system load, a step of reallocating a credit value, and reallocating a physical The CPU step and the step of changing the virtual machine type are characterized by:
(1)调度初始化步骤:为每个物理CPU创建物理CPU调度结构:为主物理CPU设置主计时器和调节计时器,其它物理CPU设置次级计时器;为每个虚拟机创建虚拟机调度结构:初始化虚拟机信用值权重,设定虚拟机类型;为每个虚拟机的虚拟CPU初始化虚拟CPU调度结构:初始化每个虚拟CPU的负载变量、I/O任务紧迫程度,为每个虚拟CPU分配信用值;初始化I/O位图Ab和计算位图Ac,Ab中的物理CPU专用于调度运行I/O型负载的虚拟CPU,Ac中的物理CPU专用于调度运行计算型负载的虚拟CPU,它们是互补的物理CPU位图;初始化全局的I/O负载变量Lb以及计算负载变量Lc,Lb和Lc分别记录系统中运行I/O型负载以及计算型负载的虚拟CPU所消耗的信用值资源;设置每个虚拟CPU的优先级;(1) Scheduling initialization step: Create a physical CPU scheduling structure for each physical CPU: set a main timer and an adjustment timer for the main physical CPU, and set a secondary timer for other physical CPUs; create a virtual machine scheduling structure for each virtual machine : Initialize the virtual machine credit value weight, set the virtual machine type; initialize the virtual CPU scheduling structure for each virtual machine's virtual CPU: initialize the load variable of each virtual CPU, the I/O task urgency, and allocate for each virtual CPU. Credit value; initialize I/O bitmap A b and calculate bitmap A c , the physical CPU in A b is dedicated to scheduling virtual CPU running I / O type load, the physical CPU in A c is dedicated to scheduling running computing load Virtual CPUs, which are complementary physical CPU bitmaps; initialize the global I/O load variable L b and calculate the load variables L c , L b and L c to record the I/O load and the calculated load in the system, respectively. The credit value resource consumed by the virtual CPU; setting the priority of each virtual CPU;
(2)插入虚拟CPU运行队列步骤:如果当前虚拟CPU运行计算型负载,则直接插入虚拟CPU运行队列中同一优先级的所有虚拟CPU之后;如果当前虚拟CPU运行I/O型负载,则按其优先级依序插入虚拟CPU运行队列,对于优先级相等的虚拟CPU,则根据I/O紧迫程度从大到小排序; (2) Insert virtual CPU running queue step: If the current virtual CPU runs the computing load, it is directly inserted after all virtual CPUs of the same priority in the virtual CPU running queue; if the current virtual CPU runs the I/O type load, then press it The priority is sequentially inserted into the virtual CPU running queue. For virtual CPUs with the same priority, the I/O urgency is sorted from large to small.
(3)虚拟CPU运行步骤:如果当前物理CPU的队首虚拟CPU信用值小于或等于0,则触发负载均衡,转步骤(4);否则运行队首虚拟CPU,如果当前物理CPU为主物理CPU,运行过程中,次级计时器到时间,转步骤(5),主计时器到时间,转步骤(6),调节计时器到时间,转步骤(7),用户发出修改虚拟机类型命令,执行步骤(8);当前物理CPU为非主物理CPU,运行过程中,次级计时器到时间,转步骤(5),用户发出修改虚拟机类型命令,执行步骤(8);虚拟CPU达到运行时间后转步骤(2),重新插入队列;(3) Step of running the virtual CPU: If the credit value of the virtual CPU of the current physical CPU is less than or equal to 0, trigger load balancing, and go to step (4); otherwise, run the virtual CPU of the team first, if the current physical CPU is the primary physical CPU. During the running process, the secondary timer reaches the time, the step (5), the main timer to the time, the step (6), the timer is adjusted to the time, the step (7) is performed, and the user issues a command to modify the virtual machine type. Step (8) is performed; the current physical CPU is a non-primary physical CPU. During the running process, the secondary timer expires, and the step (5) is performed. The user issues a command to modify the virtual machine type, and the step (8) is executed; the virtual CPU reaches the running. After the time, go to step (2) and re-insert the queue;
(4)负载均衡步骤:判断当前物理CPU在I/O位图中对应位是否为1,是则将I/O位图置1位的非空闲物理CPU作为目标CPU组,否则将计算位图置1位的非空闲物理CPU作为目标CPU组;然后从目标物理CPU组中选择迁移最优的物理CPU作为迁移的目标物理CPU,如果未找到迁移最优的物理CPU则放弃本次负载均衡;(4) Load balancing step: determine whether the corresponding bit of the current physical CPU in the I/O bitmap is 1, and the non-idle physical CPU with the I/O bitmap set to 1 bit as the target CPU group, otherwise the bitmap will be calculated. Set a non-idle physical CPU as the target CPU group; then select the optimal physical CPU from the target physical CPU group as the target physical CPU of the migration, and abandon the load balancing if the optimal physical CPU is not found;
找到目标物理CPU后,再判断当前物理CPU在I/O位图中对应位是否为1,是则将目标物理CPU的虚拟CPU运行队列中I/O任务最急迫的虚拟CPU作为目标虚拟CPU,否则将目标物理CPU的虚拟CPU运行队列中历史负载最接近目标物理CPU与当前物理CPU历史负载的差值一半的虚拟CPU作为目标虚拟CPU,将目标虚拟CPU从原队列中删除并插入当前物理CPU的虚拟CPU队列队首;转回步骤(3);After the target physical CPU is found, it is determined whether the current physical CPU has a corresponding bit in the I/O bitmap, and the virtual CPU that is the most urgent I/O task in the virtual CPU running queue of the target physical CPU is used as the target virtual CPU. Otherwise, the virtual CPU in the virtual CPU running queue of the target physical CPU that has the historical load closest to the difference between the target physical CPU and the current physical CPU historical load is taken as the target virtual CPU, and the target virtual CPU is deleted from the original queue and inserted into the current physical CPU. Virtual CPU queue leader; turn back to step (3);
(5)更新信用值与系统负载步骤:更新当前虚拟CPU的信用值、负载变量,并更新相关物理CPU的历史负载变量,判断运行当前虚拟CPU的物理CPU在I/O位图中对应位值是否为1,是则更新其I/O任务紧迫变量以及全局的I/O负载变量,转回步骤(3);否则更新全局的计算负载变量;转回步骤(3);(5) Update credit value and system load step: update the credit value and load variable of the current virtual CPU, and update the historical load variable of the relevant physical CPU, and determine the corresponding physical value of the physical CPU running the current virtual CPU in the I/O bitmap. Whether it is 1, is to update its I / O task pressing variables and global I / O load variables, go back to step (3); otherwise update the global computing load variables; go back to step (3);
(6)重新分配信用值步骤:根据当前虚拟CPU的信用值判定优先级,重新计算每个虚拟CPU分配的信用值额度,并更新所有虚拟CPU的信用值,判断更新后虚拟CPU的信用值是否从非正变为正,是则更改其优先级,转回步骤(3);否则有关虚拟CPU的优先级不改变,直接转回步骤(3);(6) Re-allocating the credit value step: determining the priority according to the credit value of the current virtual CPU, recalculating the credit value quota allocated by each virtual CPU, and updating the credit value of all the virtual CPUs to determine whether the credit value of the updated virtual CPU is Change from non-positive to positive, then change its priority, and return to step (3); otherwise, the priority of the virtual CPU does not change, and directly returns to step (3);
(7)重新分配物理CPU步骤:根据全局I/O负载变量及计算负载变量分别计算运行I/O负载的物理CPU数目和运行计算型负载的物理CPU数目;并根据计算出的物理CPU数目修改对应的I/O位图和计算位图,重新建立虚拟CPU与物理CPU之间的亲和性;将I/O负载变量及计算负载变量清0,并更新所有虚拟CPU的I/O任务紧迫程度变量,转回步骤(3); (7) Reassign the physical CPU step: Calculate the number of physical CPUs running the I/O load and the number of physical CPUs running the calculated load according to the global I/O load variable and the calculated load variable; and modify according to the calculated physical CPU number Corresponding I/O bitmap and calculation bitmap, re-establish the affinity between virtual CPU and physical CPU; clear I/O load variable and calculation load variable to 0, and update all virtual CPU I/O tasks urgently Degree variable, return to step (3);
(8)更改虚拟机类型步骤:读取用户命令,根据其中的虚拟机ID、虚拟机类型Q以及虚拟CPU数目Xi,读取原虚拟机类型Si,根据虚拟机类型Q和原虚拟机类型Si,重新建立虚拟机的各虚拟CPU与I/O位图或计算位图的亲和性,并修改虚拟机类型变量,转回步骤(3)。(8) to change the type of virtual machine steps of: reading a user command, according to which the virtual your crash ID, a virtual machine type and number of virtual Q CPU X i, read the original virtual machine type S i, according to the original virtual machine and a virtual machine type Q Type S i , re-establish the affinity of each virtual CPU of the virtual machine with the I/O bitmap or calculate the bitmap, and modify the virtual machine type variable, and return to step (3).
所述的虚拟CPU调度方法,其进一步特征在于:The virtual CPU scheduling method is further characterized by:
(1)调度初始化步骤,包括如下子步骤:(1) The scheduling initialization step includes the following sub-steps:
(1.1)为每个物理CPU创建物理CPU调度结构:(1.1) Create a physical CPU scheduling structure for each physical CPU:
判断是否为第一个物理CPU创建物理CPU调度结构,是则进行子步骤(1.2);否则转子步骤(1.3);Determine whether to create a physical CPU scheduling structure for the first physical CPU, and then perform sub-step (1.2); otherwise, the rotor step (1.3);
(1.2)将第一个物理CPU标记为主物理CPU,并为其设置主计时器和调节计时器,主计时器周期T=30~100ms,为10ms的整数倍,同时为T的整数倍,调节计时器周期T=1200~3000ms,为T的整数倍,转子步骤(1.3);(1.2) Mark the first physical CPU as the main physical CPU, and set the main timer and the adjustment timer for it. The main timer period T main = 30 ~ 100ms, which is an integer multiple of 10ms, and is an integer of T times . times, adjusting the timer period T modulated = 1200 ~ 3000ms, T is an integral multiple of the main rotor step (1.3);
(1.3)设置次级计时器,次级计时器周期T为(1~3)×10ms;将该物理CPU的历史负载变量Hp初始化为0;历史负载变量Hp记录在该物理CPU上运行的虚拟CPU所消耗掉的所有信用值总和,物理CPU序数p=1~G,G为系统中的物理CPU个数,G=1~64;(1.3) a secondary set timer period of the timer T times as the secondary (1 ~ 3) × 10ms; the physical CPU load history variable is initialized to 0 H p; H p variable load history recorded on the physical CPU The sum of all the credits consumed by the running virtual CPU, the physical CPU number p = 1 ~ G, G is the number of physical CPUs in the system, G = 1 ~ 64;
(1.4)为每个虚拟机创建虚拟机调度结构:(1.4) Create a virtual machine scheduling structure for each virtual machine:
在各个虚拟机的虚拟机调度结构中,将对应虚拟机信用值权重Wi初始化为256,对应虚拟机类型Si设定为0,并将其虚拟CPU链表初始化为空;In the virtual machine scheduling structure of each virtual machine, the corresponding virtual machine credit value weight W i is initialized to 256, the corresponding virtual machine type S i is set to 0, and its virtual CPU linked list is initialized to be empty;
其中,虚拟机序数i=1~V,V为用户创建的虚拟机个数,V=1~100;Si为0表示计算型负载,Si为1表示I/O型负载,Si为2表示混合型负载,混合型负载为计算型和I/O型负载相当的负载;The virtual machine number i=1~V, V is the number of virtual machines created by the user, V=1~100; S i is 0 indicates a computing load, and S i is 1 indicates an I/O type load, and S i is 2 indicates a hybrid load, and the hybrid load is a load equivalent to a calculation type and an I/O type load;
(1.5)为每个虚拟机的虚拟CPU初始化虚拟CPU调度结构:(1.5) Initialize the virtual CPU scheduling structure for each virtual machine's virtual CPU:
将虚拟CPU加入所属虚拟机的虚拟CPU链表中;Add the virtual CPU to the virtual CPU linked list of the virtual machine to which it belongs;
将每个虚拟CPU的负载变量Hij初始化为0,Initialize the load variable H ij of each virtual CPU to 0,
将每个虚拟CPU的I/O任务紧迫程度变量Iij初始化为0,Iij=0~1,Iij值越大表示I/O任务越紧迫,Iij=0,表示没有I/O负载;Initialize the I/O task urgency variable I ij of each virtual CPU to 0, I ij =0~1. The larger the I ij value, the more urgent the I/O task is, I ij =0, indicating no I/O load. ;
并为每个虚拟CPU分配信用值,其中第i个虚拟机的第j个虚拟CPU的信用值Cij =G×10×T×Wi/(WT×Mi);And assigning a credit value to each virtual CPU, wherein the credit value of the jth virtual CPU of the i-th virtual machine is C ij = G × 10 × T main × W i / (W T × M i );
其中,系统总权重
Figure PCTCN2014094010-appb-000001
Among them, the total weight of the system
Figure PCTCN2014094010-appb-000001
虚拟机中虚拟CPU的序数j=1~Mi,Mi为第i个虚拟机的虚拟CPU个数,由用户设定,为小于G的整数;The number of virtual CPUs in the virtual machine is j=1~M i , and M i is the number of virtual CPUs of the i-th virtual machine, which is set by the user and is an integer smaller than G;
(1.6)将I/O位图Ab和计算位图Ac初始化:(1.6) Initialize the I/O bitmap A b and the calculated bitmap A c :
建立I/O位图Ab和计算位图Ac,将Ab中的各位初始化为全0,Ac中的各位初始化为全1,表示系统默认初始化运行计算型负载;Establish I / O bit map bit map calculation and A b A c, A b is the bits are initialized to all-0, A c is initialized to all you, a system default initialization operation computational load;
(1.7)初始化时,所有虚拟CPU默认运行计算型负载,建立各虚拟CPU与计算位图Ac中置1位的物理CPU的亲和性;(1.7) Upon initialization, all default virtual CPU computational load operation, establishing each of the virtual CPU calculates the bit map A c is set a physical CPU affinity;
(1.8)设置全局的I/O负载变量Lb以及计算负载变量Lc,将Lb和Lc均初始化为0;(1.8) setting the global I / O load variable L b and calculating the load variable L c , and initializing both L b and L c to 0;
(1.9)将各虚拟CPU的优先级Pij初始化为-1,表示其可被调度;(1.9) Initializing the priority P ij of each virtual CPU to -1, indicating that it can be scheduled;
(2)插入虚拟CPU运行队列步骤,包括如下子步骤:(2) Insert the virtual CPU run queue step, including the following substeps:
(2.1)判断当前虚拟CPU是否与计算位图Ac设置亲和性,是则表示该虚拟CPU运行计算型负载,进行子步骤(2.2),否则表示该虚拟CPU运行I/O型负载,转子步骤(2.3),(2.1) determining whether the current virtual CPU has an affinity with the calculation bitmap A c , and indicating that the virtual CPU is running a computational load, performing sub-step (2.2), otherwise indicating that the virtual CPU is running an I/O type load, the rotor Step (2.3),
(2.2)从当前物理CPU的虚拟CPU运行队列队首开始,比较当前虚拟CPU的优先级Pij是否大于虚拟CPU运行队列中的虚拟CPU优先级Pij,是则将当前虚拟CPU插入虚拟CPU运行队列中进行比较的虚拟CPU之前,否则顺序往后比较,直至虚拟CPU运行队列队尾;插入完成后,转步骤(3);(2.2) Starting from the virtual CPU running queue head of the current physical CPU, comparing whether the current virtual CPU priority P ij is greater than the virtual CPU priority P ij in the virtual CPU running queue, and inserting the current virtual CPU into the virtual CPU. Before the virtual CPUs in the queue are compared, otherwise the sequence is compared backwards until the virtual CPU runs the queue tail; after the insertion is completed, go to step (3);
(2.3)从当前物理CPU的虚拟CPU运行队列队首开始,比较当前虚拟CPU的优先级Pij是否大于虚拟CPU运行队列中的虚拟CPU优先级Pij,是则将当前虚拟CPU插入虚拟CPU运行队列中进行比较虚拟CPU之前并转步骤(3);否则进行子步骤(2.4);(2.3) Starting from the virtual CPU running queue head of the current physical CPU, comparing whether the current virtual CPU priority P ij is greater than the virtual CPU priority P ij in the virtual CPU running queue, and inserting the current virtual CPU into the virtual CPU. Before the virtual CPU is compared in the queue, go to step (3); otherwise, perform sub-step (2.4);
(2.4)比较当前虚拟CPU的优先级Pij是否等于虚拟CPU运行队列中的虚拟CPU优先级Pij,是则进行子步骤(2.5),否则顺序往后比较,直至虚拟CPU运行队列队尾,插入完成后,转步骤(3);(2.4) Compare whether the priority P ij of the current virtual CPU is equal to the virtual CPU priority P ij in the virtual CPU running queue, and then perform sub-step (2.5), otherwise the sequence is compared backwards until the virtual CPU runs the queue tail. After the insertion is completed, go to step (3);
(2.5)比较当前虚拟CPU的Iij值是否大于虚拟CPU运行队列中的虚拟CPU的Iij值,是则将当前虚拟CPU插入虚拟CPU运行队列中进行比较虚拟CPU之前并转步骤(3);否则顺序往后,比较当前虚拟CPU的优先级Pij是否大于进行比较的虚拟CPU 优先级Pij,是则将当前虚拟CPU插入虚拟CPU运行队列中进行比较虚拟CPU之前并转步骤(3);否则进行子步骤(2.4);(2.5) comparing the current value of the virtual CPU if I ij I ij is greater than the value of the virtual CPU operation queue virtual CPU, and a transfer step (3) before insertion then the current virtual CPU virtual CPU compares the run queue virtual CPU; Otherwise, the order is backward, comparing whether the priority P ij of the current virtual CPU is greater than the virtual CPU priority P ij for comparison, and then inserting the current virtual CPU into the virtual CPU running queue to compare the virtual CPUs and then transferring to step (3); Otherwise sub-step (2.4);
(3)虚拟CPU运行步骤,包括如下子步骤:(3) The virtual CPU running steps include the following sub-steps:
(3.1)在当前物理CPU的虚拟CPU运行队列中,判断队首虚拟CPU信用值Cij是否大于0,是则进行子步骤(3.2);否则触发负载均衡策略,转步骤(4);(3.1) In the virtual CPU running queue of the current physical CPU, determine whether the team head virtual CPU credit value C ij is greater than 0, then proceed to sub-step (3.2); otherwise, trigger the load balancing policy, and then go to step (4);
(3.2)判断虚拟CPU运行队列中队首虚拟CPU亲和性设置的目标物理CPU组是否为Ab位图中置1位所代表的物理CPU,是则表明其运行I/O型负载,设置其运行时间片长度Ts=1ms~5ms;否则表明其运行计算型负载,设置其运行时间片长度Ts=30ms~100ms;(3.2) Determine whether the target physical CPU group set by the first virtual CPU affinity of the virtual CPU running queue is the physical CPU represented by the 1 bit in the A b bitmap, indicating that it is running the I/O type load and setting it The running time slice length T s =1ms ~ 5ms; otherwise it indicates that it runs the computational load, set its running time slice length T s = 30ms ~ 100ms;
(3.3)将所述队首虚拟CPU从所在虚拟CPU运行队列中删除;(3.3) deleting the team head virtual CPU from the virtual CPU running queue;
(3.4)判断当前物理CPU是否为主物理CPU,是则进行子步骤(3.5);否则进行子步骤(3.8);(3.4) determining whether the current physical CPU is the primary physical CPU, if yes, performing sub-step (3.5); otherwise, performing sub-step (3.8);
(3.5)在主物理CPU上运行所述队首虚拟CPU,主物理CPU的次级计时器、主计时器和调节计时器同时计时;同时监控用户是否发出修改虚拟机类型命令,是则执行步骤(8);否则进行子步骤(3.6);(3.5) running the team head virtual CPU on the primary physical CPU, the secondary timer of the primary physical CPU, the primary timer, and the adjustment timer are simultaneously counted; and simultaneously monitoring whether the user issues a command to modify the virtual machine type, and then executing the step (8); otherwise sub-step (3.6);
(3.6)判断该队首虚拟CPU的运行时间是否小于Ts,是则进行子步骤(3.7);否则将该队首虚拟CPU从主物理CPU上移除,转步骤(2);(3.6) determining whether the running time of the first virtual CPU of the team is less than T s , then proceeding to sub-step (3.7); otherwise, removing the first virtual CPU from the primary physical CPU, and then moving to step (2);
(3.7)当次级计时器经历了时间T,则次级计时器复位,转步骤(5);当主计时器经历了时间T,则主计时器复位,转步骤(6);当调节计时器经历了时间T,则调节计时器复位,转步骤(7);如果在Ts时间内没有触发任何计时器,虚拟CPU持续运行时间Ts,将该队首虚拟CPU从主物理CPU上移除,转步骤(2);(3.7) When the secondary timer has experienced the time T times , the secondary timer is reset, go to step (5); when the master timer has experienced the time T master , the master timer is reset, go to step (6); The timer has experienced the time T adjustment , then adjust the timer reset, go to step (7); if no timer is triggered within T s time, the virtual CPU continues to run for T s , the team first virtual CPU from the main physical CPU Remove, go to step (2);
(3.8)在当前物理CPU上运行所述队首虚拟CPU,当前物理CPU的次级计时器计时;同时监控用户是否修改虚拟机类型,是则执行步骤(8);否则进行子步骤(3.9);(3.8) Running the team head virtual CPU on the current physical CPU, and timing the secondary timer of the current physical CPU; and monitoring whether the user modifies the virtual machine type, if yes, performing step (8); otherwise, performing sub-step (3.9) ;
(3.9)判断该队首虚拟CPU的运行时间是否小于Ts,是则进行子步骤(3.10);否则将该队首虚拟CPU从当前物理CPU上移除,转步骤(2);(3.9) determining whether the running time of the first virtual CPU of the team is less than T s , then proceeding to sub-step (3.10); otherwise, removing the first virtual CPU from the current physical CPU, and proceeding to step (2);
(3.10)当次级计时器经历了时间T,则次级计时器复位,转步骤(5),如果在Ts时间内没有触发任何计时器,虚拟CPU持续运行时间Ts,将该队首虚拟CPU从当前物理CPU上移除,转步骤(2);(3.10) when subjected to a secondary timer times the time T, then the secondary timer is reset, go to step (5), if the timer does not trigger any time T S, the virtual CPU operation time duration T S, the team The first virtual CPU is removed from the current physical CPU, and the process proceeds to step (2);
(4)负载均衡步骤,包括如下子步骤: (4) The load balancing step includes the following substeps:
(4.1)选择进行负载均衡的物理CPU组:判断当前物理CPU在I/O位图Ab中对应位是否为1,是则表示该物理CPU的虚拟CPU运行队列上运行的是I/O型负载,将I/O位图Ab中置1位的非空闲物理CPU作为可进行负载均衡的目标物理CPU组,进行子步骤(4.2);否则表示该物理CPU队列上运行的是计算型负载,将计算位图Ac中置1位的非空闲物理CPU作为可进行负载均衡的目标物理CPU组,进行子步骤(4.2);(4.1) Select the physical CPU group for load balancing: determine whether the corresponding bit of the current physical CPU in the I/O bitmap A b is 1, indicating that the virtual CPU running queue of the physical CPU is running I/O type. Load, the non-idle physical CPU set to 1 bit in the I/O bitmap A b is used as the target physical CPU group for load balancing, and sub-step (4.2); otherwise, the physical CPU queue is running the computational load. Calculating a non-idle physical CPU set to 1 bit in the bitmap A c as a target physical CPU group for load balancing, and performing sub-step (4.2);
(4.2)从目标物理CPU组中选择迁移最优的物理CPU:在相应的Ab或Ac中,遍历所述目标物理CPU组,判断是否找到与当前物理CPU在同一个物理核上的非空闲物理CPU,是则将其作为迁移的目标物理CPU,转子步骤(4.8),否则转子步骤(4.3);(4.2) Selecting the optimal physical CPU from the target physical CPU group: traversing the target physical CPU group in the corresponding A b or A c , and determining whether to find the non-physical CPU on the same physical core The idle physical CPU is the target physical CPU of the migration, the rotor step (4.8), otherwise the rotor step (4.3);
(4.3)在相应的Ab或Ac中,重新遍历目标物理CPU组,判断是否找到与当前物理CPU在同一个物理封装中的非空闲物理CPU,是则进行子步骤(4.4),否则转子步骤(4.5);(4.3) Re-traversing the target physical CPU group in the corresponding A b or A c to determine whether a non-idle physical CPU in the same physical package as the current physical CPU is found, and then sub-step (4.4), otherwise the rotor Step (4.5);
(4.4)判断该非空闲物理CPU的Hp是否大于当前物理CPU的Hp,是则将该物理CPU作为迁移的目标物理CPU,转子步骤(4.8),否则转子步骤(4.5);If (4.4) determines the non-physical CPU idle is greater than the current H p H p physical CPU, the physical CPU is the target physical CPU, the rotor step (4.8) of the migration, otherwise step rotor (4.5);
(4.5)在相应目标物理CPU组中,顺序向后判断是否找到与当前物理CPU在同一个物理封装中的非空闲物理CPU,是则转子步骤(4.4),否则转子步骤(4.6);(4.5) in the corresponding target physical CPU group, sequentially determine backwards whether to find a non-idle physical CPU in the same physical package as the current physical CPU, then the rotor step (4.4), otherwise the rotor step (4.6);
(4.6)重新遍历目标物理CPU组,判断是否找到与当前物理CPU在不同物理封装上的非空闲物理CPU,是则进行子步骤(4.7),否则将当前物理CPU标记为空闲,运行空闲的虚拟CPU,转子步骤(3.4);(4.6) Re-traversing the target physical CPU group to determine whether to find a non-idle physical CPU on a different physical package than the current physical CPU. If yes, perform sub-step (4.7). Otherwise, mark the current physical CPU as idle and run idle virtual. CPU, rotor step (3.4);
(4.7)判断该非空闲物理CPU的Hp是否大于当前物理CPU的Hp的两倍,是则将该非空闲物理CPU作为迁移的目标物理CPU,转子步骤(4.8);否则将当前物理CPU标记为空闲,运行空闲的虚拟CPU,转子步骤(3.4);(4.7) determining whether the H p of the non-idle physical CPU is greater than twice the H p of the current physical CPU, and the non-idle physical CPU is the target physical CPU of the migration, the rotor step (4.8); otherwise, the current physical CPU Marked as idle, running idle virtual CPU, rotor step (3.4);
(4.8)在目标物理CPU上选择合适的虚拟CPU进行转移:(4.8) Select the appropriate virtual CPU to transfer on the target physical CPU:
判断当前物理CPU在I/O位图Ab中对应位是否为1,是则遍历目标物理CPU的虚拟CPU运行队列,将其中Iij值最大的虚拟CPU作为迁移的目标虚拟CPU,转子步骤(4.9);否则遍历目标物理CPU的虚拟CPU运行队列,找到Hij最接近目标物理CPU的Hp与触发负载均衡的物理CPU的Hp差值一半的虚拟CPU作为迁移的目标虚拟CPU,转子步骤(4.9);Determine whether the corresponding bit of the current physical CPU in the I/O bitmap A b is 1, and traverse the virtual CPU running queue of the target physical CPU, and use the virtual CPU with the largest I ij value as the target virtual CPU of the migration, and the rotor step ( 4.9); H p half of the difference between the target virtual CPU or physical CPU traverse the virtual CPU run queue, find H ij closest to the target physical CPU H p and trigger load balancing physical CPU as the migration target virtual CPU, rotor step (4.9);
(4.9)将迁移的目标虚拟CPU从目标物理CPU的虚拟CPU运行队列上移除并插入到当前物理CPU的虚拟CPU运行队列的队首,转子步骤(3.2); (4.9) removing the migrated target virtual CPU from the virtual CPU running queue of the target physical CPU and inserting it into the head of the virtual CPU running queue of the current physical CPU, and the rotor step (3.2);
(5)更新信用值与系统负载步骤,包括如下子步骤:(5) The steps of updating the credit value and system load, including the following sub-steps:
(5.1)更新当前虚拟CPU的信用值Cij:将Cij-10×T1的值赋予Cij(5.1) updating the credit value C ij of the current virtual CPU: assigning the value of C ij -10×T 1 to C ij ;
更新当前虚拟CPU的负载变量Hij:将Hij+10×T1的值赋予HijUpdate the load variable H ij of the current virtual CPU: assign the value of H ij +10×T 1 to H ij ;
更新运行当前虚拟CPU的物理CPU的历史负载变量Hp:将Hp+10×T1的值赋予HpUpdate the historical load variable H p of the physical CPU running the current virtual CPU: assign the value of H p +10×T 1 to H p ;
一个虚拟CPU运行1ms消耗的信用值额度为10,T1为当前虚拟CPU从上次开始运行至今经历的时间,单位为ms;The credit value of a virtual CPU running for 1ms is 10, and T 1 is the time elapsed since the last virtual CPU has been running since the last time, in units of ms;
(5.2)判断运行当前虚拟CPU的物理CPU在I/O位图Ab中对应位值是否为1,是则表示运行了I/O任务,更新其Iij,将Iij-1/(10×T1)的值赋予Iij,进行子步骤(5.3);否则直接进行子步骤(5.3);(5.2) Determine whether the physical CPU running the current virtual CPU has a corresponding bit value in the I/O bitmap A b , which means that the I/O task is run, and its I ij is updated, and I ij -1/(10 The value of ×T 1 ) is assigned to I ij , and sub-step (5.3) is performed; otherwise, sub-step (5.3) is directly performed;
(5.3)根据当前虚拟CPU运行负载的类型,将其消耗掉的信用值累加到系统负载中:判断运行当前虚拟CPU的物理CPU在位图Ab中对应位值是否为1,是则更新全局的I/O负载变量Lb,将Lb+10×T1的值赋予Lb,转子步骤(3.4);否则更新全局的计算负载变量Lc,将Lc+10×T1的值赋予Lc,转子步骤(3.4);(5.3) According to the current type of virtual CPU running load, the credit value consumed by the virtual CPU is added to the system load: it is determined whether the physical CPU running the current virtual CPU has a corresponding bit value in the bitmap A b , and the global value is updated. The I/O load variable L b , the value of L b +10×T 1 is assigned to L b , the rotor step (3.4); otherwise the global calculated load variable L c is updated, and the value of L c +10×T 1 is assigned L c , rotor step (3.4);
(6)重新分配信用值步骤,包括如下子步骤:(6) The step of reallocating the credit value includes the following substeps:
(6.1)判断当前虚拟CPU信用值是否大于0,是则进行子步骤(6.2);否则将当前虚拟CPU的优先级Pij设置成-2,表示无法再调度,进行子步骤(6.2);(6.1) determining whether the current virtual CPU credit value is greater than 0, then proceeding to sub-step (6.2); otherwise, setting the current virtual CPU priority P ij to -2, indicating that the scheduling cannot be performed again, performing sub-step (6.2);
(6.2)为每个虚拟机的虚拟CPU新分配信用值NCij(6.2) Newly assign a credit value NC ij to the virtual CPU of each virtual machine:
NCij=G×T×10×Wi/(WT×Mi);NC ij = G × T main × 10 × W i / (W T × M i );
其中NCij为第i个虚拟机的第j个虚拟CPU新得到的信用值;Where NC ij is the newly obtained credit value of the jth virtual CPU of the i-th virtual machine;
(6.3)更新各虚拟CPU的信用值Cij(6.3) Update the credit value C ij of each virtual CPU:
将NCij+Cij的值赋予CijAssign the value of NC ij +C ij to C ij ,
判断是否Cij>0且Pij值为-2,是则将有关虚拟CPU的优先级Pij更改为-1,转子步骤(3.4),否则有关虚拟CPU的优先级Pij不改变,直接转子步骤(3.4);Judging whether C ij >0 and P ij value is -2, is to change the priority P ij about the virtual CPU to -1, the rotor step (3.4), otherwise the priority P ij about the virtual CPU does not change, the direct rotor Step (3.4);
(7)重新分配物理CPU步骤,包括如下子步骤:(7) The process of reallocating the physical CPU includes the following substeps:
(7.1)计算相应物理CPU数目;(7.1) Calculate the number of corresponding physical CPUs;
运行I/O型负载的物理CPU数目N(Ab):Number of physical CPUs running I/O type load N( Ab ):
N(Ab)=(Lb/(Lb+Lc))×G;N( Ab )=(L b /(L b +L c ))×G;
运行计算型负载的物理CPU数目N(Ac): The number of physical CPUs running the compute load, N( Ac ):
N(Ac)=G-N(Ab);N( Ac )=G-N( Ab );
(7.2)判断I/O位图Ab中置1位的物理CPU数目是否小于N(Ab),是则进行子步骤(7.3),否则转子步骤(7.4);(7.2) Determine whether the number of physical CPUs set to 1 bit in the I/O bitmap A b is less than N( Ab ), then proceed to sub-step (7.3), otherwise the rotor step (7.4);
(7.3)从运行计算型负载的物理CPU中转移差值数目的物理CPU来运行I/O型负载:令Y=N(Ab)—I/O位图Ab中置1位的物理CPU数目,将I/O位图Ab中前Y个为0的位均置1,并将计算位图Ac中对应位清0,转子步骤(7.6);(7.3) Transfer the number of physical CPUs from the physical CPU running the computational load to run the I/O type load: Let Y=N( Ab )—I/O Bitmap A b Set the number of physical CPUs in Ab Set the first Y bits of the I/O bitmap A b to 1 and clear the corresponding bit in the calculated bitmap A c to the rotor step (7.6);
(7.4)判断I/O位图Ab中置1位的物理CPU数目是否等于N(Ab),是则转子步骤(7.7);否则进行子步骤(7.5);(7.4) Determine whether the number of physical CPUs set to 1 in the I/O bitmap A b is equal to N( Ab ), then the rotor step (7.7); otherwise, perform sub-step (7.5);
(7.5)从运行I/O型负载的物理CPU中转移差值数目的物理CPU来运行计算型负载:令Y=I/O位图Ab中置1位的物理CPU数目—N(Ab),将I/O位图Ab中前Y个置1位均清0,并将计算位图Ac中对应位置1,转子步骤(7.6);(7.5) Transfer the number of physical CPUs from the physical CPU running the I/O type load to run the computational load: Let Y=I/O bitmap A b set the number of physical CPUs - N( Ab ) , clear the first Y bits in the I/O bitmap A b to 0, and calculate the corresponding position in the bitmap A c , the rotor step (7.6);
(7.6)重新设置虚拟CPU亲和性:重新建立运行I/O型负载的所有虚拟CPU与I/O位图Ab中置1位的物理CPU的亲和性;(7.6) reset the virtual CPU affinity: reestablish all virtual CPU and I Run I / O type load / O bit map A b is set in a physical affinity for the CPU;
重新建立运行计算型负载的所有虚拟CPU与计算位图Ac中置1位的物理CPU的亲和性;Re-establish the operating computational load is calculated for all virtual CPU and bit map A c is set in a physical affinity for the CPU;
(7.7)将I/O负载变量Lb及计算负载变量Lc清0,并更新所有虚拟CPU的I/O任务紧迫程度变量Iij:将1/Hij的值赋予Iij,转子步骤(3.4);(7.7) Clear the I/O load variable L b and the calculated load variable L c to 0, and update the I/O task urgency variable I ij of all virtual CPUs: assign the value of 1/H ij to I ij , the rotor step ( 3.4);
(8)更改虚拟机类型步骤,包括如下子步骤:(8) Steps to change the virtual machine type, including the following sub-steps:
(8.1)根据用户发出的修改虚拟机类型命令,读取其中的虚拟机ID、虚拟机类型Q以及虚拟CPU数目Xi,根据虚拟机ID,在其虚拟机调度结构中读取其虚拟机类型Si(8.1) According to the modified virtual machine type command issued by the user, read the virtual machine ID, the virtual machine type Q, and the virtual CPU number X i , and read the virtual machine type in the virtual machine scheduling structure according to the virtual machine ID. S i ;
所述修改虚拟机类型命令包括虚拟机ID字段、虚拟机类型字段和虚拟CPU数目字段,虚拟机ID字段给出待修改类型的虚拟机ID;虚拟机类型字段给出待修改的虚拟机类型Q,Q为0表示计算型负载,Q为1表示I/O型负载,Q为2表示混合型负载;虚拟CPU数目字段给出混合型虚拟机中用于运行I/O负载的虚拟CPU数目,仅当Q=2时该字段才有效;The modify virtual machine type command includes a virtual machine ID field, a virtual machine type field, and a virtual CPU number field, and the virtual machine ID field gives a virtual machine ID of a type to be modified; the virtual machine type field gives a virtual machine type Q to be modified. Q is 0 for the computational load, Q is 1 for the I/O load, and Q is 2 for the hybrid load; the virtual CPU number field is for the number of virtual CPUs used to run the I/O load in the hybrid virtual machine. This field is valid only when Q=2;
(8.2)判断是否Q=0,是则进行子步骤(8.3),否则进行子步骤(8.6);(8.2) judging whether Q=0, yes, proceeding to sub-step (8.3), otherwise performing sub-step (8.6);
(8.3)判断是否Si=0,是则保持虚拟机类型Si不变,转子步骤(3.5);否则判断是否Si=1,是则进行子步骤(8.4),否则进行子步骤(8.5);(8.3) Determine whether S i =0, if yes, keep the virtual machine type S i unchanged, the rotor step (3.5); otherwise, judge whether S i =1, then proceed to sub-step (8.4), otherwise perform sub-step (8.5 );
(8.4)判定Si=1,表示将运行I/O型负载的虚拟机转变为计算型负载的虚拟机,解 除其各虚拟CPU与I/O位图Ab中置1位的物理CPU的亲和性,重新建立该虚拟机的所有虚拟CPU与计算位图Ac中置1位的物理CPU的亲和性,并且将Si修改为0,转子步骤(3.5);(8.4) Determining that S i =1 means that the virtual machine running the I/O type load is converted into a virtual machine of the computational load, and the virtual CPUs of the virtual CPU and the I/O bitmap A b are removed. affinity, to re-establish the virtual machine and the virtual CPU is calculated for all bit map a physical CPU affinity of a center c, and the modified S i is 0, the rotor step (3.5);
(8.5)判定Si=2,表示将运行混合型负载的虚拟机转变为运行计算型负载的虚拟机,解除其各虚拟CPU与I/O位图Ab中置1位的物理CPU的亲和性,重新建立其各个虚拟CPU与计算位图Ac中置1位的物理CPU的亲和性,并且将Si修改为0,转子步骤(3.5);(8.5) Determining S i = 2 means that the virtual machine running the hybrid load is converted into a virtual machine running the computational load, and the virtual CPUs of each virtual CPU and the I/O bitmap A b are deactivated. and resistance, the re-establishment of the virtual CPU which calculates the respective bit map a c is set in a physical CPU affinity, and S i 0 is modified, the rotor step (3.5);
(8.6)判断是否Q=1,是则进行子步骤(8.7),否则进行子步骤(8.11);(8.6) judging whether Q=1, if yes, proceeding to sub-step (8.7), otherwise performing sub-step (8.11);
(8.7)判断是否Si=0,是则进行步骤(8.8),否则进行子步骤(8.9);(8.7) judging whether S i =0, if yes, proceeding to step (8.8), otherwise performing sub-step (8.9);
(8.8)表示将运行计算型负载的虚拟机转变为运行I/O型负载的虚拟机,解除其各虚拟CPU与计算位图Ac中置1位的物理CPU的亲和性,重新建立该虚拟机的所有虚拟CPU与I/O位图Ab中置1位的物理CPU的亲和性,并且将Si修改为1,转子步骤(3.5);(8.8) indicates that the virtual machine running the computational load is converted into a virtual machine running an I/O type load, and the affinity of each virtual CPU to the physical CPU that is set to one bit in the calculation bitmap A c is released, and the All virtual CPUs of the virtual machine have affinity with the physical CPU set to 1 bit in the I/O bitmap A b , and modify S i to 1, the rotor step (3.5);
(8.9)判断是否Si=1,是则保持虚拟机类型Si不变,转子步骤(3.5);否则进行子步骤(8.10);(8.9) judging whether S i =1, yes, keeping the virtual machine type S i unchanged, the rotor step (3.5); otherwise performing the sub-step (8.10);
(8.10)判定Si=2,表示将运行混合型负载的虚拟机转变为运行I/O型负载的虚拟机,解除其各虚拟CPU与计算位图Ac中置1位的物理CPU的亲和性,重新建立其各虚拟CPU与I/O位图Ai中置1位的物理CPU的亲和性,并且将Si修改为1,转子步骤(3.5);(8.10) Judging that S i = 2 means that the virtual machine running the hybrid load is converted into a virtual machine running the I/O type load, and the virtual CPU of each of the virtual CPUs is calculated and the physical CPU of the bitmap A c is set. And re-establish the affinity of each virtual CPU with the physical CPU set to 1 bit in the I/O bitmap A i , and modify S i to 1, the rotor step (3.5);
(8.11)判定Q=2,判断是否Si=0,是则进行子步骤(8.12),否则进行子步骤(8.13);(8.11) Determine Q=2, judge whether S i =0, if yes, perform sub-step (8.12), otherwise perform sub-step (8.13);
(8.12)判定Si=0,表示将运行计算型负载的虚拟机转变为运行混合型负载的虚拟机,解除该虚拟机中前Xi个虚拟CPU与计算位图Ac中置1位的物理CPU的亲和性,重新建立该虚拟机中前Xi个虚拟CPU与I/O位图Ab中置1位的物理CPU的亲和性,并且将Si修改为2,转子步骤(3.5);(8.12) Determining S i =0, indicating that the virtual machine running the computational load is converted into a virtual machine running the hybrid load, and the first X i virtual CPUs in the virtual machine are removed and the calculation bitmap A c is set to 1 bit. The affinity of the physical CPU, re-establishing the affinity of the first X i virtual CPUs in the virtual machine and the physical CPU set in the I/O bitmap A b , and modifying the S i to 2, the rotor step ( 3.5);
(8.13)判断是否Si=1,是则进行子步骤(8.14),否则进行子步骤(8.15);(8.13) Judging whether S i =1, then proceeding to sub-step (8.14), otherwise performing sub-step (8.15);
(8.14)判定Si=1,表示将运行I/O型负载的虚拟机转变为运行混合型负载的虚拟机,解除该虚拟机中后Mi-Xi个虚拟CPU与I/O位图Ab中置1位的物理CPU的亲和性,重新建立该虚拟机中后Mi-Xi个虚拟CPU与计算位图Ac中置1位的物理CPU的亲和性,并且将Si修改为2,转子步骤(3.5);(8.14) determines S i = 1, represents the operation I / O type load into the virtual machine a virtual machine running the hybrid load is released after the virtual machine M i -X i virtual CPU and I / O bitmap The affinity of the physical CPU of the 1-bit is set in A b , and the affinity of the virtual CPU in the virtual machine after the M i -X i virtual CPU is calculated and the physical CPU set in the bitmap A c is set, and the S is i is modified to 2, rotor step (3.5);
(8.15)判定Si=2,保持虚拟机类型Si不变,转子步骤(3.5)。 (8.15) Determine S i = 2, keep the virtual machine type S i unchanged, and rotate the step (3.5).
所述调度初始化步骤、重新分配物理CPU步骤和更改虚拟机类型步骤中,建立各虚拟CPU与I/O位图Ab或者计算位图Ac中置1位的物理CPU的亲和性时,可以通过系统定义的设置亲和性函数;In the steps of the scheduling initialization step, the reallocation of the physical CPU step, and the change of the virtual machine type, when each virtual CPU is established with the I/O bitmap A b or the affinity of the physical CPU set in the bitmap A c is set, The affinity function can be set by the system definition;
解除各虚拟CPU与I/O位图Ab或者计算位图Ac中置1位的物理CPU的亲和性时,可以通过系统定义的设置亲和性函数,重新建立各虚拟CPU与I/O位图Ab或者计算位图Ac中置1位的物理CPU的亲和性。When the virtual CPU is deactivated with the I/O bitmap A b or the physical CPU of the bitmap A c , the virtual CPU and I/ can be re-established by the system-defined setting affinity function. The O bitmap A b or the affinity of the physical CPU set to 1 bit in the bitmap A c is calculated.
在现有调度算法中,注重的是将物理CPU资源公平的分给每个虚拟CPU,但这种公平仅仅是表面上的,因为不同的负载对运行环境的需求不一样,I/O型负载通常执行时间短,但是希望低延时与高频率的调度,按照现行的调度算法,运行I/O型负载的虚拟CPU很容易因为陷入排队等待而导致很高的延时。In the existing scheduling algorithm, the focus is on the fair distribution of physical CPU resources to each virtual CPU, but this kind of fairness is only superficial, because different loads have different requirements for the operating environment, I/O type load. Usually, the execution time is short, but it is desirable to schedule low-latency and high-frequency. According to the current scheduling algorithm, the virtual CPU running the I/O type load is easy to cause high delay due to waiting in queue.
本发明为了满足不同应用需求并保证I/O性能,对虚拟机进行分类,延时敏感型的虚拟机专门运行I/O型负载;非延时敏感型的虚拟机专门运行计算型负载;混合型虚拟机,同时运行多类负载。为运行计算型负载的虚拟机分配较长的时间片,减少环境切换的开销;为运行I/O型负载的虚拟机分配较短的时间片,获得较高的调度频率;对于混合型负载的虚拟机,需要同时兼顾两种负载的特点,则进行内部的虚拟CPU划分,对运行I/O型负载的虚拟CPU设定短时间片,对运行计算型负载的虚拟CPU设定正常时间片,让其可高效运行。为了不让计算型负载影响I/O性能,本发明进行了动态负载隔离,将物理CPU分成了两组,一组调度运行I/O负载的虚拟CPU,一组调度运行计算型负载的虚拟CPU,分组的依据为I/O型负载和计算型负载所占系统总负载的权重,根据调节计时器每隔一定周期重新调整物理CPU的分组,在负载隔离的前提下保证了系统具有很好的灵活性。为了解决当前虚拟CPU调算无法体现出I/O任务的紧迫程度的问题,本发明为虚拟CPU增加了一个I/O任务的紧迫程度指标,让紧急的I/O事件可以得到优先的处理;本发明也考虑到了现有虚拟CPU调度算法负载均衡策略过于简单的问题,根据本发明中物理CPU、虚拟机以及虚拟CPU的调度结构重新设计了一套负载均衡策略,考虑到物理CPU的层次结构,依次在同一物理核、同一物理封装以及不同物理封装中选择迁移最优的目标物理CPU,除了保证不同类型负载的隔离性外,选择迁移开销最小的策略,在选择迁移的目标虚拟CPU时也根据负载类型而不同,对于计算型负载,选择迁移后物理CPU运行队列负载相当的方案;对于I/O型负载,选择I/O任务 最紧迫的虚拟CPU迁移,来保证I/O性能。In order to meet different application requirements and ensure I/O performance, the present invention classifies virtual machines, delay-sensitive virtual machines exclusively run I/O type loads; non-delay-sensitive virtual machines exclusively run computational loads; A virtual machine that runs multiple types of workloads simultaneously. Allocating a long time slice for a virtual machine running a computational load reduces the overhead of environment switching; assigns a shorter time slice to a virtual machine running an I/O type load, and obtains a higher scheduling frequency; for a hybrid load The virtual machine needs to take into account the characteristics of the two types of load at the same time, and then perform internal virtual CPU partitioning, set a short time slice for the virtual CPU running the I/O type load, and set a normal time slice for the virtual CPU running the computing load. Let it run efficiently. In order to prevent the computational load from affecting the I/O performance, the present invention performs dynamic load isolation, which divides the physical CPU into two groups, a set of virtual CPUs that schedule I/O loads, and a set of virtual CPUs that schedule computational loads. The basis of the grouping is the weight of the total load of the system occupied by the I/O type load and the calculation type load. According to the adjustment timer, the physical CPU group is re-adjusted every certain period, and the system is guaranteed to be good under the premise of load isolation. flexibility. In order to solve the problem that the current virtual CPU adjustment cannot reflect the urgency of the I/O task, the present invention adds an urgency index of the I/O task to the virtual CPU, so that the urgent I/O event can be preferentially processed; The present invention also considers the problem that the existing virtual CPU scheduling algorithm load balancing strategy is too simple. According to the scheduling structure of the physical CPU, the virtual machine and the virtual CPU in the present invention, a load balancing strategy is redesigned, taking into account the hierarchical structure of the physical CPU. Selecting the optimal target physical CPU in the same physical core, the same physical package, and different physical packages in turn, in addition to ensuring the isolation of different types of workloads, the strategy of selecting the least migration overhead is also selected when the target virtual CPU of the migration is selected. Depending on the type of load, for a compute load, choose a scenario where the physical CPU run queue load is equivalent after migration; for I/O load, select an I/O task. The most urgent virtual CPU migration to ensure I/O performance.
【附图说明】[Description of the Drawings]
图1为本发明的流程示意图;Figure 1 is a schematic flow chart of the present invention;
图2为插入虚拟CPU运行队列步骤流程框图;2 is a flow chart of the steps of inserting a virtual CPU running queue;
图3为虚拟CPU运行步骤流程框图;3 is a flow chart of a virtual CPU running step;
图4为负载均衡步骤流程框图;Figure 4 is a flow chart of the load balancing step;
图5为重新分配物理CPU步骤流程框图;Figure 5 is a flow chart showing the steps of reallocating a physical CPU;
图6为更改虚拟机类型步骤流程框图。Figure 6 is a block diagram showing the steps for changing the virtual machine type.
【具体实施方式】【detailed description】
下面结合附图和具体实施例对本发明进一步说明。The invention is further described below in conjunction with the drawings and specific embodiments.
如图1所示,本发明包括调度初始化步骤、插入虚拟CPU运行队列步骤、虚拟CPU运行步骤、负载均衡步骤、更新信用值与系统负载步骤、重新分配信用值步骤、重新分配物理CPU步骤和更改虚拟机类型步骤;As shown in FIG. 1, the present invention includes a scheduling initialization step, a virtual CPU running queue step, a virtual CPU running step, a load balancing step, an update credit value and system load step, a process of reallocating a credit value, a process of reallocating a physical CPU, and a change. Virtual machine type step;
(1)调度初始化步骤:为每个物理CPU创建物理CPU调度结构:为主物理CPU设置主计时器和调节计时器,其它物理CPU设置次级计时器;为每个虚拟机创建虚拟机调度结构:初始化虚拟机信用值权重,设定虚拟机类型;为每个虚拟机的虚拟CPU初始化虚拟CPU调度结构:初始化每个虚拟CPU的负载变量、I/O任务紧迫程度,为每个虚拟CPU分配信用值;初始化I/O位图Ab和计算位图Ac,Ab中的物理CPU专用于调度运行I/O型负载的虚拟CPU,Ac中的物理CPU专用于调度运行计算型负载的虚拟CPU,它们是互补的物理CPU位图;初始化全局的I/O负载变量Lb以及计算负载变量Lc,Lb和Lc分别记录系统中运行I/O型负载以及计算型负载的虚拟CPU所消耗的信用值资源;设置每个虚拟CPU的优先级;(1) Scheduling initialization step: Create a physical CPU scheduling structure for each physical CPU: set a main timer and an adjustment timer for the main physical CPU, and set a secondary timer for other physical CPUs; create a virtual machine scheduling structure for each virtual machine : Initialize the virtual machine credit value weight, set the virtual machine type; initialize the virtual CPU scheduling structure for each virtual machine's virtual CPU: initialize the load variable of each virtual CPU, the I/O task urgency, and allocate for each virtual CPU. Credit value; initialize I/O bitmap A b and calculate bitmap A c , the physical CPU in A b is dedicated to scheduling virtual CPU running I / O type load, the physical CPU in A c is dedicated to scheduling running computing load Virtual CPUs, which are complementary physical CPU bitmaps; initialize the global I/O load variable L b and calculate the load variables L c , L b and L c to record the I/O load and the calculated load in the system, respectively. The credit value resource consumed by the virtual CPU; setting the priority of each virtual CPU;
(2)插入虚拟CPU运行队列步骤:如果当前虚拟CPU运行计算型负载,则直接插入虚拟CPU运行队列中同一优先级的所有虚拟CPU之后;如果当前虚拟CPU运行I/O型负载,则按其优先级依序插入虚拟CPU运行队列,对于优先级相等的虚拟CPU,则根据I/O紧迫程度从大到小排序;(2) Insert virtual CPU running queue step: If the current virtual CPU runs the computing load, it is directly inserted after all virtual CPUs of the same priority in the virtual CPU running queue; if the current virtual CPU runs the I/O type load, then press it The priority is sequentially inserted into the virtual CPU running queue. For virtual CPUs with the same priority, the I/O urgency is sorted from large to small.
(3)虚拟CPU运行步骤:如果当前物理CPU的队首虚拟CPU信用值小于或等于0,则触发负载均衡,转步骤(4);否则运行队首虚拟CPU,如果当前物理CPU为主 物理CPU,运行过程中,次级计时器到时间,转步骤(5),主计时器到时间,转步骤(6),调节计时器到时间,转步骤(7),用户发出修改虚拟机类型命令,执行步骤(8);当前物理CPU为非主物理CPU,运行过程中,次级计时器到时间,转步骤(5),用户发出修改虚拟机类型命令,执行步骤(8);虚拟CPU达到运行时间后转步骤(2),重新插入队列;(3) Step of running the virtual CPU: If the credit value of the virtual CPU of the current physical CPU is less than or equal to 0, trigger load balancing, and go to step (4); otherwise, run the virtual CPU of the team first, if the current physical CPU is the main Physical CPU, running, secondary timer to time, go to step (5), master timer to time, go to step (6), adjust timer to time, go to step (7), user issues modified virtual machine type If the command is executed, go to step (8); the current physical CPU is a non-primary physical CPU. During the running process, the secondary timer expires. Go to step (5). The user issues a command to modify the virtual machine type. Step (8); virtual CPU After the running time is reached, go to step (2) and re-insert the queue;
(4)负载均衡步骤:判断当前物理CPU在I/O位图中对应位是否为1,是则将I/O位图置1位的非空闲物理CPU作为目标CPU组,否则将计算位图置1位的非空闲物理CPU作为目标CPU组;然后从目标物理CPU组中选择迁移最优的物理CPU作为迁移的目标物理CPU,如果未找到迁移最优的物理CPU则放弃本次负载均衡;(4) Load balancing step: determine whether the corresponding bit of the current physical CPU in the I/O bitmap is 1, and the non-idle physical CPU with the I/O bitmap set to 1 bit as the target CPU group, otherwise the bitmap will be calculated. Set a non-idle physical CPU as the target CPU group; then select the optimal physical CPU from the target physical CPU group as the target physical CPU of the migration, and abandon the load balancing if the optimal physical CPU is not found;
找到目标物理CPU后,再判断当前物理CPU在I/O位图中对应位是否为1,是则将目标物理CPU的虚拟CPU运行队列中I/O任务最急迫的虚拟CPU作为目标虚拟CPU,否则将目标物理CPU的虚拟CPU运行队列中历史负载最接近目标物理CPU与当前物理CPU历史负载的差值一半的虚拟CPU作为目标虚拟CPU,将目标虚拟CPU从原队列中删除并插入当前物理CPU的虚拟CPU队列队首;转回步骤(3);After the target physical CPU is found, it is determined whether the current physical CPU has a corresponding bit in the I/O bitmap, and the virtual CPU that is the most urgent I/O task in the virtual CPU running queue of the target physical CPU is used as the target virtual CPU. Otherwise, the virtual CPU in the virtual CPU running queue of the target physical CPU that has the historical load closest to the difference between the target physical CPU and the current physical CPU historical load is taken as the target virtual CPU, and the target virtual CPU is deleted from the original queue and inserted into the current physical CPU. Virtual CPU queue leader; turn back to step (3);
(5)更新信用值与系统负载步骤:更新当前虚拟CPU的信用值、负载变量,并更新相关物理CPU的历史负载变量,判断运行当前虚拟CPU的物理CPU在I/O位图中对应位值是否为1,是则更新其I/O任务紧迫变量以及全局的I/O负载变量,转回步骤(3);否则更新全局的计算负载变量;转回步骤(3);(5) Update credit value and system load step: update the credit value and load variable of the current virtual CPU, and update the historical load variable of the relevant physical CPU, and determine the corresponding physical value of the physical CPU running the current virtual CPU in the I/O bitmap. Whether it is 1, is to update its I / O task pressing variables and global I / O load variables, go back to step (3); otherwise update the global computing load variables; go back to step (3);
(6)重新分配信用值步骤:根据当前虚拟CPU的信用值判定优先级,重新计算每个虚拟CPU分配的信用值额度,并更新所有虚拟CPU的信用值,判断更新后虚拟CPU的信用值是否从非正变为正,是则更改其优先级,转回步骤(3);否则有关虚拟CPU的优先级不改变,直接转回步骤(3);(6) Re-allocating the credit value step: determining the priority according to the credit value of the current virtual CPU, recalculating the credit value quota allocated by each virtual CPU, and updating the credit value of all the virtual CPUs to determine whether the credit value of the updated virtual CPU is Change from non-positive to positive, then change its priority, and return to step (3); otherwise, the priority of the virtual CPU does not change, and directly returns to step (3);
(7)重新分配物理CPU步骤:根据全局I/O负载变量及计算负载变量分别计算运行I/O负载的物理CPU数目和运行计算型负载的物理CPU数目;并根据计算出的物理CPU数目修改对应的I/O位图和计算位图,重新建立虚拟CPU与物理CPU之间的亲和性;将I/O负载变量及计算负载变量清0,并更新所有虚拟CPU的I/O任务紧迫程度变量,转回步骤(3);(7) Reassign the physical CPU step: Calculate the number of physical CPUs running the I/O load and the number of physical CPUs running the calculated load according to the global I/O load variable and the calculated load variable; and modify according to the calculated physical CPU number Corresponding I/O bitmap and calculation bitmap, re-establish the affinity between virtual CPU and physical CPU; clear I/O load variable and calculation load variable to 0, and update all virtual CPU I/O tasks urgently Degree variable, return to step (3);
(8)更改虚拟机类型步骤:读取用户命令,根据其中的虚拟机ID、虚拟机类型Q以及虚拟CPU数目Xi,读取原虚拟机类型Si,根据虚拟机类型Q和原虚拟机类型Si, 重新建立虚拟机的各虚拟CPU与I/O位图或计算位图的亲和性,并修改虚拟机类型变量,转回步骤(3)。(8) to change the type of virtual machine steps of: reading a user command, according to which the virtual your crash ID, a virtual machine type and number of virtual Q CPU X i, read the original virtual machine type S i, according to the original virtual machine and a virtual machine type Q Type S i , re-establish the affinity of each virtual CPU of the virtual machine with the I/O bitmap or calculate the bitmap, and modify the virtual machine type variable, and return to step (3).
本发明的实施例应用背景为:主机具有两个物理封装,每个物理封装中有四个物理核,开启超线程。每个物理核含有两个物理CPU,实验平台操作系统为CentOS-6.4,虚拟机监控程序为Xen-4.2.0,内核版本为Linux-3.2.0,主机运行16个虚拟机,每个虚拟机4个虚拟CPU,虚拟机操作系统为CentOS-6.4,内核版本为Linux-3.2.0。The application background of the embodiment of the present invention is that the host has two physical packages, and each physical package has four physical cores, and hyperthreading is enabled. Each physical core contains two physical CPUs, the experimental platform operating system is CentOS-6.4, the virtual machine monitoring program is Xen-4.2.0, the kernel version is Linux-3.2.0, and the host runs 16 virtual machines, each virtual machine. 4 virtual CPUs, the virtual machine operating system is CentOS-6.4, and the kernel version is Linux-3.2.0.
本发明的实施例,包括调度初始化步骤、插入虚拟CPU运行队列步骤、虚拟CPU运行步骤、负载均衡步骤、更新信用值与系统负载步骤、重新分配信用值步骤、重新分配物理CPU步骤和更改虚拟机类型步骤:Embodiments of the present invention include a scheduling initialization step, a virtual CPU running queue step, a virtual CPU running step, a load balancing step, an update credit value and system load step, a process of reallocating a credit value, reallocating a physical CPU step, and changing a virtual machine Type step:
(1)调度初始化步骤,包括如下子步骤:(1) The scheduling initialization step includes the following sub-steps:
(1.1)为每个物理CPU创建物理CPU调度结构:(1.1) Create a physical CPU scheduling structure for each physical CPU:
判断是否为第一个物理CPU创建物理CPU调度结构,是则进行子步骤(1.2);否则转子步骤(1.3);Determine whether to create a physical CPU scheduling structure for the first physical CPU, and then perform sub-step (1.2); otherwise, the rotor step (1.3);
(1.2)将第一个物理CPU标记为主物理CPU,并为其设置主计时器和调节计时器,主计时器周期T=30ms,调节计时器周期T=1200ms,转子步骤(1.3);(1.2) Mark the first physical CPU as the main physical CPU, and set the main timer and adjustment timer for it, the main timer period T main = 30ms, the adjustment timer period T tune = 1200ms, the rotor step (1.3) ;
(1.3)设置次级计时器,次级计时器周期T为10ms;将该物理CPU的历史负载变量Hp初始化为0;p=1~16;(1.3) setting a secondary timer, the secondary timer period is 10 times T; initializing the historical load variable H p of the physical CPU to 0; p = 1 to 16;
(1.4)为每个虚拟机创建虚拟机调度结构:(1.4) Create a virtual machine scheduling structure for each virtual machine:
在各个虚拟机的虚拟机调度结构中,将对应虚拟机信用值权重Wi初始化为256,对应虚拟机类型Si设定为0,并将其虚拟CPU链表初始化为空;In the virtual machine scheduling structure of each virtual machine, the corresponding virtual machine credit value weight W i is initialized to 256, the corresponding virtual machine type S i is set to 0, and its virtual CPU linked list is initialized to be empty;
其中,虚拟机序数i=1~16;Wherein, the virtual machine number i=1 to 16;
(1.5)为每个虚拟机的虚拟CPU初始化虚拟CPU调度结构:(1.5) Initialize the virtual CPU scheduling structure for each virtual machine's virtual CPU:
将虚拟CPU加入所属虚拟机的虚拟CPU链表中;Add the virtual CPU to the virtual CPU linked list of the virtual machine to which it belongs;
将每个虚拟CPU的负载变量Hij初始化为0,Initialize the load variable H ij of each virtual CPU to 0,
将每个虚拟CPU的I/O任务紧迫程度变量Iij初始化为0,表示没有I/O负载;Initialize the I/O task urgency variable I ij of each virtual CPU to 0, indicating that there is no I/O load;
并为每个虚拟CPU分配信用值,其中第i个虚拟机的第j个虚拟CPU的信用值Cij=16×10×30×256/(WT×Mi)=75;其中,系统总权重WT=16384,And assigning a credit value to each virtual CPU, wherein the credit value of the jth virtual CPU of the i-th virtual machine is C ij = 16×10×30×256/(W T ×M i )=75; wherein, the total system Weight W T =16384,
虚拟机中虚拟CPU的序数j=1~Mi,Mi=4,为第i个虚拟机的虚拟CPU个数; The number of virtual CPUs in the virtual machine is j=1~M i , M i =4, which is the number of virtual CPUs of the i-th virtual machine;
(1.6)将I/O位图Ab和计算位图Ac初始化:(1.6) Initialize the I/O bitmap A b and the calculated bitmap A c :
建立I/O位图Ab和计算位图Ac,它们是互补的物理CPU位图,将Ab中的各位初始化为全0,Ac中的各位初始化为全1,表示系统默认初始化运行计算型负载;Establish I/O bitmap A b and calculate bitmap A c , which are complementary physical CPU bitmaps, initialize each bit in A b to all 0s, and initialize each bit in A c to all 1s, indicating that the system is initialized by default. Computational load;
(1.7)初始化时,所有虚拟CPU默认运行计算型负载,建立各虚拟CPU与计算位图Ac中置1位的物理CPU的亲和性;(1.7) Upon initialization, all default virtual CPU computational load operation, establishing each of the virtual CPU calculates the bit map A c is set a physical CPU affinity;
(1.8)设置全局的I/O负载变量Lb以及计算负载变量Lc,将Lb和Lc均初始化为0;(1.8) setting the global I / O load variable L b and calculating the load variable L c , and initializing both L b and L c to 0;
(1.9)将各虚拟CPU的优先级Pij初始化为-1,表示其可被调度;(1.9) Initializing the priority P ij of each virtual CPU to -1, indicating that it can be scheduled;
(2)如图2所示,插入虚拟CPU运行队列步骤,包括如下子步骤:(2) As shown in Figure 2, insert the virtual CPU run queue step, including the following substeps:
(2.1)判断当前虚拟CPU是否与计算位图Ac设置亲和性,是则表示该虚拟CPU运行计算型负载,进行子步骤(2.2),否则表示该虚拟CPU运行I/O型负载,转子步骤(2.3),(2.1) determining whether the current virtual CPU has an affinity with the calculation bitmap A c , and indicating that the virtual CPU is running a computational load, performing sub-step (2.2), otherwise indicating that the virtual CPU is running an I/O type load, the rotor Step (2.3),
(2.2)从当前物理CPU的虚拟CPU运行队列队首开始,比较当前虚拟CPU的优先级Pij是否大于虚拟CPU运行队列中的虚拟CPU优先级Pij,是则将当前虚拟CPU插入虚拟CPU运行队列中进行比较的虚拟CPU之前,否则顺序往后比较,直至虚拟CPU运行队列队尾;插入完成后,转步骤(3);(2.2) Starting from the virtual CPU running queue head of the current physical CPU, comparing whether the current virtual CPU priority P ij is greater than the virtual CPU priority P ij in the virtual CPU running queue, and inserting the current virtual CPU into the virtual CPU. Before the virtual CPUs in the queue are compared, otherwise the sequence is compared backwards until the virtual CPU runs the queue tail; after the insertion is completed, go to step (3);
(2.3)从当前物理CPU的虚拟CPU运行队列队首开始,比较当前虚拟CPU的优先级Pij是否大于虚拟CPU运行队列中的虚拟CPU优先级Pij,是则将当前虚拟CPU插入虚拟CPU运行队列中进行比较虚拟CPU之前并转步骤(3);否则进行子步骤(2.4);(2.3) Starting from the virtual CPU running queue head of the current physical CPU, comparing whether the current virtual CPU priority P ij is greater than the virtual CPU priority P ij in the virtual CPU running queue, and inserting the current virtual CPU into the virtual CPU. Before the virtual CPU is compared in the queue, go to step (3); otherwise, perform sub-step (2.4);
(2.4)比较当前虚拟CPU的优先级Pij是否等于虚拟CPU运行队列中的虚拟CPU优先级Pij,是则进行子步骤(2.5),否则顺序往后比较,直至虚拟CPU运行队列队尾,插入完成后,转步骤(3);(2.4) Compare whether the priority P ij of the current virtual CPU is equal to the virtual CPU priority P ij in the virtual CPU running queue, and then perform sub-step (2.5), otherwise the sequence is compared backwards until the virtual CPU runs the queue tail. After the insertion is completed, go to step (3);
(2.5)比较当前虚拟CPU的Iij值是否大于虚拟CPU运行队列中的虚拟CPU的Iij值,是则将当前虚拟CPU插入虚拟CPU运行队列中进行比较虚拟CPU之前并转步骤(3);否则顺序往后,比较当前虚拟CPU的优先级Pij是否大于进行比较的虚拟CPU优先级Pij,是则将当前虚拟CPU插入虚拟CPU运行队列中进行比较虚拟CPU之前并转步骤(3);否则进行子步骤(2.4);(2.5) comparing the current value of the virtual CPU if I ij I ij is greater than the value of the virtual CPU operation queue virtual CPU, and a transfer step (3) before insertion then the current virtual CPU virtual CPU compares the run queue virtual CPU; Otherwise, the order is backward, comparing whether the priority P ij of the current virtual CPU is greater than the virtual CPU priority P ij for comparison, and then inserting the current virtual CPU into the virtual CPU running queue to compare the virtual CPUs and then transferring to step (3); Otherwise sub-step (2.4);
(3)如图3所示,虚拟CPU运行步骤,包括如下子步骤:(3) As shown in Figure 3, the virtual CPU runs the steps, including the following substeps:
(3.1)在当前物理CPU的虚拟CPU运行队列中,判断队首虚拟CPU信用值Cij是否大于0,是则进行子步骤(3.2);否则触发负载均衡策略,转步骤(4); (3.1) In the virtual CPU running queue of the current physical CPU, determine whether the team head virtual CPU credit value C ij is greater than 0, then proceed to sub-step (3.2); otherwise, trigger the load balancing policy, and then go to step (4);
(3.2)判断虚拟CPU运行队列中队首虚拟CPU亲和性设置的目标物理CPU组是否为Ab位图中置1位所代表的物理CPU,是则表明其运行I/O型负载,设置其运行时间片长度Ts=1ms;否则表明其运行计算型负载,设置其运行时间片长度Ts=30ms;(3.2) Determine whether the target physical CPU group set by the first virtual CPU affinity of the virtual CPU running queue is the physical CPU represented by the 1 bit in the A b bitmap, indicating that it is running the I/O type load and setting it The running time slice length T s =1 ms; otherwise it indicates that it runs the computational load, and sets its running time slice length T s =30 ms;
(3.3)将所述队首虚拟CPU从所在虚拟CPU运行队列中删除;(3.3) deleting the team head virtual CPU from the virtual CPU running queue;
(3.4)判断当前物理CPU是否为主物理CPU,是则进行子步骤(3.5);否则进行子步骤(3.8);(3.4) determining whether the current physical CPU is the primary physical CPU, if yes, performing sub-step (3.5); otherwise, performing sub-step (3.8);
(3.5)在主物理CPU上运行所述队首虚拟CPU,主物理CPU的次级计时器、主计时器和调节计时器同时计时;同时监控用户是否发出修改虚拟机类型命令,是则执行步骤(8);否则进行子步骤(3.6);(3.5) running the team head virtual CPU on the primary physical CPU, the secondary timer of the primary physical CPU, the primary timer, and the adjustment timer are simultaneously counted; and simultaneously monitoring whether the user issues a command to modify the virtual machine type, and then executing the step (8); otherwise sub-step (3.6);
(3.6)判断该队首虚拟CPU的运行时间是否小于Ts,是则进行子步骤(3.7);否则将该队首虚拟CPU从主物理CPU上移除,转步骤(2);(3.6) determining whether the running time of the first virtual CPU of the team is less than T s , then proceeding to sub-step (3.7); otherwise, removing the first virtual CPU from the primary physical CPU, and then moving to step (2);
(3.7)当次级计时器经历了时间T,则次级计时器复位,转步骤(5);当主计时器经历了时间T,则主计时器复位,转步骤(6);当调节计时器经历了时间T,则调节计时器复位,转步骤(7);如果在Ts时间内没有触发任何计时器,虚拟CPU持续运行时间Ts,将该队首虚拟CPU从主物理CPU上移除,转步骤(2);(3.7) When the secondary timer has experienced the time T times , the secondary timer is reset, go to step (5); when the master timer has experienced the time T master , the master timer is reset, go to step (6); The timer has experienced the time T adjustment , then adjust the timer reset, go to step (7); if no timer is triggered within T s time, the virtual CPU continues to run for T s , the team first virtual CPU from the main physical CPU Remove, go to step (2);
(3.8)在当前物理CPU上运行所述队首虚拟CPU,当前物理CPU的次级计时器计时;同时监控用户是否修改虚拟机类型,是则执行步骤(8);否则进行子步骤(3.9);(3.8) Running the team head virtual CPU on the current physical CPU, and timing the secondary timer of the current physical CPU; and monitoring whether the user modifies the virtual machine type, if yes, performing step (8); otherwise, performing sub-step (3.9) ;
(3.9)判断该队首虚拟CPU的运行时间是否小于Ts,是则进行子步骤(3.10);否则将该队首虚拟CPU从当前物理CPU上移除,转步骤(2);(3.9) determining whether the running time of the first virtual CPU of the team is less than T s , then proceeding to sub-step (3.10); otherwise, removing the first virtual CPU from the current physical CPU, and proceeding to step (2);
(3.10)当次级计时器经历了时间T,则次级计时器复位,转步骤(5),如果在Ts时间内没有触发任何计时器,虚拟CPU持续运行时间Ts,将该队首虚拟CPU从当前物理CPU上移除,转步骤(2);(3.10) when subjected to a secondary timer times the time T, then the secondary timer is reset, go to step (5), if the timer does not trigger any time T S, the virtual CPU operation time duration T S, the team The first virtual CPU is removed from the current physical CPU, and the process proceeds to step (2);
(4)如图4所示,负载均衡步骤,包括如下子步骤:(4) As shown in FIG. 4, the load balancing step includes the following sub-steps:
(4.1)选择进行负载均衡的物理CPU组:判断当前物理CPU在I/O位图Ab中对应位是否为1,是则将I/O位图Ab中的非空闲物理CPU作为可进行负载均衡的目标物理CPU组,进行子步骤(4.2);否则将计算位图Ac中的非空闲物理CPU作为可进行负载均衡的目标物理CPU组,进行子步骤(4.2);(4.1) Selecting the physical CPU group for load balancing: determining whether the corresponding bit of the current physical CPU in the I/O bitmap A b is 1, and then the non-idle physical CPU in the I/O bitmap A b is made available. The target physical CPU group of the load balancing is performed in sub-step (4.2); otherwise, the non-idle physical CPU in the bitmap A c is calculated as the target physical CPU group capable of load balancing, and sub-step (4.2) is performed;
(4.2)从目标物理CPU组中选择迁移最优的物理CPU:在相应的Ab或Ac中,遍历所述目标物理CPU组,判断是否找到与当前物理CPU在同一个物理核上的非空闲物 理CPU,是则将其作为迁移的目标物理CPU,转子步骤(4.8),否则转子步骤(4.3);(4.2) Selecting the optimal physical CPU from the target physical CPU group: traversing the target physical CPU group in the corresponding A b or A c , and determining whether to find the non-physical CPU on the same physical core The idle physical CPU is the target physical CPU of the migration, the rotor step (4.8), otherwise the rotor step (4.3);
(4.3)在相应的Ab或Ac中,重新遍历目标物理CPU组,判断是否找到与当前物理CPU在同一个物理封装中的非空闲物理CPU,是则进行子步骤(4.4),否则转子步骤(4.5);(4.3) Re-traversing the target physical CPU group in the corresponding A b or A c to determine whether a non-idle physical CPU in the same physical package as the current physical CPU is found, and then sub-step (4.4), otherwise the rotor Step (4.5);
(4.4)判断该非空闲物理CPU的Hp是否大于当前物理CPU的Hp,是则将该物理CPU作为迁移的目标物理CPU,转子步骤(4.8),否则转子步骤(4.5);If (4.4) determines the non-physical CPU idle is greater than the current H p H p physical CPU, the physical CPU is the target physical CPU, the rotor step (4.8) of the migration, otherwise step rotor (4.5);
(4.5)在相应目标物理CPU组中,顺序向后判断是否找到与当前物理CPU在同一个物理封装中的非空闲物理CPU,是则转子步骤(4.4),否则转子步骤(4.6);(4.5) in the corresponding target physical CPU group, sequentially determine backwards whether to find a non-idle physical CPU in the same physical package as the current physical CPU, then the rotor step (4.4), otherwise the rotor step (4.6);
(4.6)重新遍历目标物理CPU组,判断是否找到与当前物理CPU在不同物理封装上的非空闲物理CPU,是则进行子步骤(4.7),否则将当前物理CPU标记为空闲,运行空闲的虚拟CPU,转子步骤(3.4);(4.6) Re-traversing the target physical CPU group to determine whether to find a non-idle physical CPU on a different physical package than the current physical CPU. If yes, perform sub-step (4.7). Otherwise, mark the current physical CPU as idle and run idle virtual. CPU, rotor step (3.4);
(4.7)判断该非空闲物理CPU的Hp是否大于当前物理CPU的Hp的两倍,是则将该非空闲物理CPU作为迁移的目标物理CPU,转子步骤(4.8);否则将当前物理CPU标记为空闲,运行空闲的虚拟CPU,转子步骤(3.4);(4.7) determining whether the H p of the non-idle physical CPU is greater than twice the H p of the current physical CPU, and the non-idle physical CPU is the target physical CPU of the migration, the rotor step (4.8); otherwise, the current physical CPU Marked as idle, running idle virtual CPU, rotor step (3.4);
(4.8)在目标物理CPU上选择合适的虚拟CPU进行转移:(4.8) Select the appropriate virtual CPU to transfer on the target physical CPU:
判断当前物理CPU在I/O位图Ab中对应位是否为1,是则遍历目标物理CPU的虚拟CPU运行队列,将其中Iij值最大的虚拟CPU作为迁移的目标虚拟CPU,转子步骤(4.9);否则遍历目标物理CPU的虚拟CPU运行队列,找到Hij最接近目标物理CPU的Hp与触发负载均衡的物理CPU的Hp差值一半的虚拟CPU作为迁移的目标虚拟CPU,转子步骤(4.9);Determine whether the corresponding bit of the current physical CPU in the I/O bitmap A b is 1, and traverse the virtual CPU running queue of the target physical CPU, and use the virtual CPU with the largest I ij value as the target virtual CPU of the migration, and the rotor step ( 4.9); H p half of the difference between the target virtual CPU or physical CPU traverse the virtual CPU run queue, find H ij closest to the target physical CPU H p and trigger load balancing physical CPU as the migration target virtual CPU, rotor step (4.9);
(4.9)将迁移的目标虚拟CPU从目标物理CPU的虚拟CPU运行队列上移除并插入到当前物理CPU的虚拟CPU运行队列的队首,转子步骤(3.2);(4.9) removing the migrated target virtual CPU from the virtual CPU running queue of the target physical CPU and inserting it into the head of the virtual CPU running queue of the current physical CPU, and the rotor step (3.2);
(5)更新信用值与系统负载步骤,包括如下子步骤:(5) The steps of updating the credit value and system load, including the following sub-steps:
(5.1)更新当前虚拟CPU的信用值Cij:将Cij-10×T1的值赋予Cij(5.1) updating the credit value C ij of the current virtual CPU: assigning the value of C ij -10×T 1 to C ij ;
更新当前虚拟CPU的负载变量Hij:将Hij+10×T1的值赋予HijUpdate the load variable H ij of the current virtual CPU: assign the value of H ij +10×T 1 to H ij ;
更新运行当前虚拟CPU的物理CPU的历史负载变量Hp:将Hp+10×T1的值赋予HpUpdate the historical load variable H p of the physical CPU running the current virtual CPU: assign the value of H p +10×T 1 to H p ;
(5.2)判断运行当前虚拟CPU的物理CPU在I/O位图Ab中对应位值是否为1,是则更新其Iij,将Iij-1/(10×T1)的值赋予Iij,进行子步骤(5.3);否则直接进行子 步骤(5.3);(5.2) Determine whether the physical CPU running the current virtual CPU has a corresponding bit value in the I/O bitmap A b , and if so, update its I ij and assign the value of I ij -1/(10×T 1 ) to I. Ij , sub-step (5.3); otherwise directly proceed to sub-step (5.3);
(5.3)根据当前虚拟CPU运行负载的类型,将其消耗掉的信用值累加到系统负载中:判断运行当前虚拟CPU的物理CPU在位图Ab中对应位值是否为1,是则更新全局的I/O负载变量Lb,将Lb+10×T1的值赋予Lb,转子步骤(3.4);否则更新全局的计算负载变量Lc,将Lc+10×T1的值赋予Lc,转子步骤(3.4);(5.3) According to the current type of virtual CPU running load, the credit value consumed by the virtual CPU is added to the system load: it is determined whether the physical CPU running the current virtual CPU has a corresponding bit value in the bitmap A b , and the global value is updated. The I/O load variable L b , the value of L b +10×T 1 is assigned to L b , the rotor step (3.4); otherwise the global calculated load variable L c is updated, and the value of L c +10×T 1 is assigned L c , rotor step (3.4);
(6)重新分配信用值步骤,包括如下子步骤:(6) The step of reallocating the credit value includes the following substeps:
(6.1)判断当前虚拟CPU信用值是否大于0,是则进行子步骤(6.2);否则将当前虚拟CPU的优先级Pij设置成-2,表示无法再调度,进行子步骤(6.2);(6.1) determining whether the current virtual CPU credit value is greater than 0, then proceeding to sub-step (6.2); otherwise, setting the current virtual CPU priority P ij to -2, indicating that the scheduling cannot be performed again, performing sub-step (6.2);
(6.2)为每个虚拟机的虚拟CPU新分配信用值NCij,NCij=75;(6.2) newly assign a credit value NC ij for each virtual machine's virtual CPU, NC ij = 75;
其中NCij为第i个虚拟机的第j个虚拟CPU新得到的信用值;Where NC ij is the newly obtained credit value of the jth virtual CPU of the i-th virtual machine;
(6.3)更新各虚拟CPU的信用值Cij(6.3) Update the credit value C ij of each virtual CPU:
将NCij+Cij的值赋予CijAssign the value of NC ij +C ij to C ij ,
判断是否Cij>0且Pij值为-2,是则将有关虚拟CPU的优先级Pij更改为-1,转子步骤(3.4),否则有关虚拟CPU的优先级Pij不改变,直接转子步骤(3.4);Judging whether C ij >0 and P ij value is -2, is to change the priority P ij about the virtual CPU to -1, the rotor step (3.4), otherwise the priority P ij about the virtual CPU does not change, the direct rotor Step (3.4);
(7)如图5所示,重新分配物理CPU步骤,包括如下子步骤:(7) As shown in FIG. 5, the process of reallocating the physical CPU includes the following substeps:
(7.1)计算相应物理CPU数目;(7.1) Calculate the number of corresponding physical CPUs;
运行I/O型负载的物理CPU数目N(Ab):Number of physical CPUs running I/O type load N( Ab ):
N(Ab)=(Lb/(Lb+Lc))×16;N( Ab )=(L b /(L b +L c ))×16;
运行计算型负载的物理CPU数目N(Ac):The number of physical CPUs running the compute load, N( Ac ):
N(Ac)=16-N(Ab);N( Ac )=16-N( Ab );
(7.2)判断I/O位图Ab中置1位的物理CPU数目是否小于N(Ab),是则进行子步骤(7.3),否则转子步骤(7.4);(7.2) Determine whether the number of physical CPUs set to 1 bit in the I/O bitmap A b is less than N( Ab ), then proceed to sub-step (7.3), otherwise the rotor step (7.4);
(7.3)从运行计算型负载的物理CPU中转移差值数目的物理CPU来运行I/O型负载:令Y=N(Ab)—I/O位图Ab中置1位的物理CPU数目,将I/O位图Ab中前Y个为0的位均置1,并将计算位图Ac中对应位清0,转子步骤(7.6);(7.3) Transfer the number of physical CPUs from the physical CPU running the computational load to run the I/O type load: Let Y=N( Ab )—I/O Bitmap A b Set the number of physical CPUs in Ab Set the first Y bits of the I/O bitmap A b to 1 and clear the corresponding bit in the calculated bitmap A c to the rotor step (7.6);
(7.4)判断I/O位图Ab中置1位的物理CPU数目是否等于N(Ab),是则转子步骤(7.7);否则进行子步骤(7.5);(7.4) Determine whether the number of physical CPUs set to 1 in the I/O bitmap A b is equal to N( Ab ), then the rotor step (7.7); otherwise, perform sub-step (7.5);
(7.5)从运行I/O型负载的物理CPU中转移差值数目的物理CPU来运行计算型负载:令Y=I/O位图Ab中置1位的物理CPU数目—N(Ab),将I/O位图Ab中前Y个置1 位均清0,并将计算位图Ac中对应位置1,转子步骤(7.6);(7.5) Transfer the number of physical CPUs from the physical CPU running the I/O type load to run the computational load: Let Y=I/O bitmap A b set the number of physical CPUs - N( Ab ) , clear the first Y bits in the I/O bitmap A b to 0, and calculate the corresponding position in the bitmap A c , the rotor step (7.6);
(7.6)重新设置虚拟CPU亲和性:重新建立运行I/O型负载的所有虚拟CPU与I/O位图Ab中置1位的物理CPU的亲和性;(7.6) reset the virtual CPU affinity: reestablish all virtual CPU and I Run I / O type load / O bit map A b is set in a physical affinity for the CPU;
重新建立运行计算型负载的所有虚拟CPU与计算位图Ac中置1位的物理CPU的亲和性;Re-establish the operating computational load is calculated for all virtual CPU and bit map A c is set in a physical affinity for the CPU;
(7.7)将I/O负载变量Lb及计算负载变量Lc清0,并更新所有虚拟CPU的I/O任务紧迫程度变量Iij:将1/Hij的值赋予Iij,转子步骤(3.4);(7.7) Clear the I/O load variable L b and the calculated load variable L c to 0, and update the I/O task urgency variable I ij of all virtual CPUs: assign the value of 1/H ij to I ij , the rotor step ( 3.4);
(8)如图6所示,更改虚拟机类型步骤,包括如下子步骤:(8) As shown in FIG. 6, the step of changing the virtual machine type includes the following substeps:
(8.1)根据用户发出的修改虚拟机类型命令,读取其中的虚拟机ID、虚拟机类型Q以及虚拟CPU字段Xi,根据虚拟机ID,在其虚拟机调度结构中读取其虚拟机类型Si(8.1) According to the modified virtual machine type command issued by the user, the virtual machine ID, the virtual machine type Q, and the virtual CPU field X i are read, and the virtual machine type is read in the virtual machine scheduling structure according to the virtual machine ID. S i ;
(8.2)判断是否Q=0,是则进行子步骤(8.3),否则进行子步骤(8.6);(8.2) judging whether Q=0, yes, proceeding to sub-step (8.3), otherwise performing sub-step (8.6);
(8.3)判断是否Si=0,是则保持虚拟机类型Si不变,转子步骤(3.5);否则判断是否Si=1,是则进行子步骤(8.4),否则进行子步骤(8.5);(8.3) Determine whether S i =0, if yes, keep the virtual machine type S i unchanged, the rotor step (3.5); otherwise, judge whether S i =1, then proceed to sub-step (8.4), otherwise perform sub-step (8.5 );
(8.4)判定Si=1,表示将运行I/O型负载的虚拟机转变为计算型负载的虚拟机,解除其各虚拟CPU与I/O位图Ab中置1位的物理CPU的亲和性,重新建立该虚拟机的所有虚拟CPU与计算位图Ac中置1位的物理CPU的亲和性,并且将Si修改为0,转子步骤(3.5);(8.4) Determining that S i =1 means that the virtual machine running the I/O type load is converted into a virtual machine of the computational load, and the physical CPUs of each virtual CPU and the I/O bitmap A b are removed. affinity, to re-establish the virtual machine and the virtual CPU is calculated for all bit map a physical CPU affinity of a center c, and the modified S i is 0, the rotor step (3.5);
(8.5)判定Si=2,表示将运行混合型负载的虚拟机转变为运行计算型负载的虚拟机,解除其各虚拟CPU与I/O位图Ab中置1位的物理CPU的亲和性,重新建立其各个虚拟CPU与计算位图Ac中置1位的物理CPU的亲和性,并且将Si修改为0,转子步骤(3.5);(8.5) Determining S i = 2 means that the virtual machine running the hybrid load is converted into a virtual machine running the computational load, and the virtual CPUs of each virtual CPU and the I/O bitmap A b are deactivated. and resistance, the re-establishment of the virtual CPU which calculates the respective bit map a c is set in a physical CPU affinity, and S i 0 is modified, the rotor step (3.5);
(8.6)判断是否Q=1,是则进行子步骤(8.7),否则进行子步骤(8.11);(8.6) judging whether Q=1, if yes, proceeding to sub-step (8.7), otherwise performing sub-step (8.11);
(8.7)判断是否Si=0,是则进行步骤(8.8),否则进行子步骤(8.9);(8.7) judging whether S i =0, if yes, proceeding to step (8.8), otherwise performing sub-step (8.9);
(8.8)表示将运行计算型负载的虚拟机转变为运行I/O型负载的虚拟机,解除其各虚拟CPU与计算位图Ac中置1位的物理CPU的亲和性,重新建立该虚拟机的所有虚拟CPU与I/O位图Ab中置1位的物理CPU的亲和性,并且将Si修改为1,转子步骤(3.5);(8.8) indicates that the virtual machine running the computational load is converted into a virtual machine running an I/O type load, and the affinity of each virtual CPU to the physical CPU that is set to one bit in the calculation bitmap A c is released, and the All virtual CPUs of the virtual machine have affinity with the physical CPU set to 1 bit in the I/O bitmap A b , and modify S i to 1, the rotor step (3.5);
(8.9)判断是否Si=1,是则保持虚拟机类型Si不变,转子步骤(3.5);否则进行子步骤(8.10);(8.9) judging whether S i =1, yes, keeping the virtual machine type S i unchanged, the rotor step (3.5); otherwise performing the sub-step (8.10);
(8.10)判定Si=2,表示将运行混合型负载的虚拟机转变为运行I/O型负载的虚拟机,解除其各虚拟CPU与计算位图Ac中置1位的物理CPU的亲和性,重新建立其各 虚拟CPU与I/O位图Ai中置1位的物理CPU的亲和性,并且将Si修改为1,转子步骤(3.5);(8.10) Judging that S i = 2 means that the virtual machine running the hybrid load is converted into a virtual machine running the I/O type load, and the virtual CPU of each of the virtual CPUs is calculated and the physical CPU of the bitmap A c is set. And re-establish the affinity of each virtual CPU with the physical CPU set to 1 bit in the I/O bitmap A i , and modify S i to 1, the rotor step (3.5);
(8.11)判定Q=2,判断是否Si=0,是则进行子步骤(8.12),否则进行子步骤(8.13);(8.11) Determine Q=2, judge whether S i =0, if yes, perform sub-step (8.12), otherwise perform sub-step (8.13);
(8.12)判定Si=0,表示将运行计算型负载的虚拟机转变为运行混合型负载的虚拟机,解除该虚拟机中前Xi个虚拟CPU与计算位图Ac中置1位的物理CPU的亲和性,重新建立该虚拟机中前Xi个虚拟CPU与I/O位图Ab中置1位的物理CPU的亲和性,并且将Si修改为2,转子步骤(3.5);(8.12) Determining S i =0, indicating that the virtual machine running the computational load is converted into a virtual machine running the hybrid load, and the first X i virtual CPUs in the virtual machine are removed and the calculation bitmap A c is set to 1 bit. The affinity of the physical CPU, re-establishing the affinity of the first X i virtual CPUs in the virtual machine and the physical CPU set in the I/O bitmap A b , and modifying the S i to 2, the rotor step ( 3.5);
(8.13)判断是否Si=1,是则进行子步骤(8.14),否则进行子步骤(8.15);(8.13) Judging whether S i =1, then proceeding to sub-step (8.14), otherwise performing sub-step (8.15);
(8.14)判定Si=1,表示将运行I/O型负载的虚拟机转变为运行混合型负载的虚拟机,解除该虚拟机中后Mi-Xi个虚拟CPU与I/O位图Ab中置1位的物理CPU的亲和性,重新建立该虚拟机中后Mi-Xi个虚拟CPU与计算位图Ac中置1位的物理CPU的亲和性,并且将Si修改为2,转子步骤(3.5);(8.14) determines S i = 1, represents the operation I / O type load into the virtual machine a virtual machine running the hybrid load is released after the virtual machine M i -X i virtual CPU and I / O bitmap The affinity of the physical CPU of the 1-bit is set in A b , and the affinity of the virtual CPU in the virtual machine after the M i -X i virtual CPU is calculated and the physical CPU set in the bitmap A c is set, and the S is i is modified to 2, rotor step (3.5);
(8.15)判定Si=2,保持虚拟机类型Si不变,转子步骤(3.5)。(8.15) Determine S i = 2, keep the virtual machine type S i unchanged, and rotate the step (3.5).
本实施例中,所述调度初始化步骤、重新分配物理CPU步骤和更改虚拟机类型步骤中,建立各虚拟CPU与I/O位图Ab或者计算位图Ac中置1位的物理CPU的亲和性时,通过系统定义的设置亲和性函数int vcpu_set_affinity(struct vcpu*v,const cpumask_t*affinity),其中参数struct vcpu*v为需要设置亲和性的虚拟CPU指针,cpumask_t*affinity为设置亲和性的目标物理CPU位图指针;In this embodiment, in the steps of scheduling initialization, reallocating the physical CPU, and changing the virtual machine type, establishing each virtual CPU and the I/O bitmap A b or calculating the physical CPU of the bitmap A c Affinity, through the system-defined setting affinity function int vcpu_set_affinity (struct vcpu * v, const cpumask_t *affinity), where the parameter struct vcpu * v is the virtual CPU pointer that needs to set the affinity, cpumask_t *affinity is set Affinity target physical CPU bitmap pointer;
解除各虚拟CPU与I/O位图Ab或者计算位图Ac中置1位的物理CPU的亲和性时,通过系统定义的设置亲和性函数int vcpu_set_affinity(struct vcpu*v,const cpumask_t*affinity),重新建立各虚拟CPU与I/O位图Ab或者计算位图Ac中置1位的物理CPU的亲和性,其中参数struct vcpu*v为需要重新设置亲和性的虚拟CPU指针,cpumask_t*affinity为设置亲和性的目标物理CPU位图指针。 When the virtual CPU is deactivated with the I/O bitmap A b or the physical CPU of the bitmap A c , the system-defined setting affinity function int vcpu_set_affinity(struct vcpu*v, const cpumask_t *affinity), re-establish the virtual CPU and I / O bitmap A b or calculate the affinity of the physical CPU set in the bitmap A c , where the parameter struct vcpu * v is the virtual need to reset the affinity CPU pointer, cpumask_t*affinity is the target physical CPU bitmap pointer for setting affinity.

Claims (3)

  1. 一种虚拟CPU调度方法,包括调度初始化步骤、插入虚拟CPU运行队列步骤、虚拟CPU运行步骤、负载均衡步骤、更新信用值与系统负载步骤、重新分配信用值步骤、重新分配物理CPU步骤和更改虚拟机类型步骤,其特征在于:A virtual CPU scheduling method includes a scheduling initialization step, a virtual CPU running queue step, a virtual CPU running step, a load balancing step, an update credit value and system load step, a process of reallocating a credit value, reallocating a physical CPU step, and changing a virtual Machine type step, which is characterized by:
    (1)调度初始化步骤:为每个物理CPU创建物理CPU调度结构:为主物理CPU设置主计时器和调节计时器,其它物理CPU设置次级计时器;为每个虚拟机创建虚拟机调度结构:初始化虚拟机信用值权重,设定虚拟机类型;为每个虚拟机的虚拟CPU初始化虚拟CPU调度结构:初始化每个虚拟CPU的负载变量、I/O任务紧迫程度,为每个虚拟CPU分配信用值;初始化I/O位图Ab和计算位图Ac,Ab中的物理CPU专用于调度运行I/O型负载的虚拟CPU,Ac中的物理CPU专用于调度运行计算型负载的虚拟CPU,它们是互补的物理CPU位图;初始化全局的I/O负载变量Lb以及计算负载变量Lc,Lb和Lc分别记录系统中运行I/O型负载以及计算型负载的虚拟CPU所消耗的信用值资源;设置每个虚拟CPU的优先级;(1) Scheduling initialization step: Create a physical CPU scheduling structure for each physical CPU: set a main timer and an adjustment timer for the main physical CPU, and set a secondary timer for other physical CPUs; create a virtual machine scheduling structure for each virtual machine : Initialize the virtual machine credit value weight, set the virtual machine type; initialize the virtual CPU scheduling structure for each virtual machine's virtual CPU: initialize the load variable of each virtual CPU, the I/O task urgency, and allocate for each virtual CPU. Credit value; initialize I/O bitmap A b and calculate bitmap A c , the physical CPU in A b is dedicated to scheduling virtual CPU running I / O type load, the physical CPU in A c is dedicated to scheduling running computing load Virtual CPUs, which are complementary physical CPU bitmaps; initialize the global I/O load variable L b and calculate the load variables L c , L b and L c to record the I/O load and the calculated load in the system, respectively. The credit value resource consumed by the virtual CPU; setting the priority of each virtual CPU;
    (2)插入虚拟CPU运行队列步骤:如果当前虚拟CPU运行计算型负载,则直接插入虚拟CPU运行队列中同一优先级的所有虚拟CPU之后;如果当前虚拟CPU运行I/O型负载,则按其优先级依序插入虚拟CPU运行队列,对于优先级相等的虚拟CPU,则根据I/O紧迫程度从大到小排序;(2) Insert virtual CPU running queue step: If the current virtual CPU runs the computing load, it is directly inserted after all virtual CPUs of the same priority in the virtual CPU running queue; if the current virtual CPU runs the I/O type load, then press it The priority is sequentially inserted into the virtual CPU running queue. For virtual CPUs with the same priority, the I/O urgency is sorted from large to small.
    (3)虚拟CPU运行步骤:如果当前物理CPU的队首虚拟CPU信用值小于或等于0,则触发负载均衡,转步骤(4);否则运行队首虚拟CPU,如果当前物理CPU为主物理CPU,运行过程中,次级计时器到时间,转步骤(5),主计时器到时间,转步骤(6),调节计时器到时间,转步骤(7),用户发出修改虚拟机类型命令,执行步骤(8);当前物理CPU为非主物理CPU,运行过程中,次级计时器到时间,转步骤(5),用户发出修改虚拟机类型命令,执行步骤(8);虚拟CPU达到运行时间后转步 骤(2),重新插入队列;(3) Step of running the virtual CPU: If the credit value of the virtual CPU of the current physical CPU is less than or equal to 0, trigger load balancing, and go to step (4); otherwise, run the virtual CPU of the team first, if the current physical CPU is the primary physical CPU. During the running process, the secondary timer reaches the time, the step (5), the main timer to the time, the step (6), the timer is adjusted to the time, the step (7) is performed, and the user issues a command to modify the virtual machine type. Step (8) is performed; the current physical CPU is a non-primary physical CPU. During the running process, the secondary timer expires, and the step (5) is performed. The user issues a command to modify the virtual machine type, and the step (8) is executed; the virtual CPU reaches the running. Turn after time Step (2), reinserting the queue;
    (4)负载均衡步骤:判断当前物理CPU在I/O位图中对应位是否为1,是则将I/O位图置1位的非空闲物理CPU作为目标CPU组,否则将计算位图置1位的非空闲物理CPU作为目标CPU组;然后从目标物理CPU组中选择迁移最优的物理CPU作为迁移的目标物理CPU,如果未找到迁移最优的物理CPU则放弃本次负载均衡;(4) Load balancing step: determine whether the corresponding bit of the current physical CPU in the I/O bitmap is 1, and the non-idle physical CPU with the I/O bitmap set to 1 bit as the target CPU group, otherwise the bitmap will be calculated. Set a non-idle physical CPU as the target CPU group; then select the optimal physical CPU from the target physical CPU group as the target physical CPU of the migration, and abandon the load balancing if the optimal physical CPU is not found;
    找到目标物理CPU后,再判断当前物理CPU在I/O位图中对应位是否为1,是则将目标物理CPU的虚拟CPU运行队列中I/O任务最急迫的虚拟CPU作为目标虚拟CPU,否则将目标物理CPU的虚拟CPU运行队列中历史负载最接近目标物理CPU与当前物理CPU历史负载的差值一半的虚拟CPU作为目标虚拟CPU,将目标虚拟CPU从原队列中删除并插入当前物理CPU的虚拟CPU队列队首;转回步骤(3);After the target physical CPU is found, it is determined whether the current physical CPU has a corresponding bit in the I/O bitmap, and the virtual CPU that is the most urgent I/O task in the virtual CPU running queue of the target physical CPU is used as the target virtual CPU. Otherwise, the virtual CPU in the virtual CPU running queue of the target physical CPU that has the historical load closest to the difference between the target physical CPU and the current physical CPU historical load is taken as the target virtual CPU, and the target virtual CPU is deleted from the original queue and inserted into the current physical CPU. Virtual CPU queue leader; turn back to step (3);
    (5)更新信用值与系统负载步骤:更新当前虚拟CPU的信用值、负载变量,并更新相关物理CPU的历史负载变量,判断运行当前虚拟CPU的物理CPU在I/O位图中对应位值是否为1,是则更新其I/O任务紧迫变量以及全局的I/O负载变量,转回步骤(3);否则更新全局的计算负载变量;转回步骤(3);(5) Update credit value and system load step: update the credit value and load variable of the current virtual CPU, and update the historical load variable of the relevant physical CPU, and determine the corresponding physical value of the physical CPU running the current virtual CPU in the I/O bitmap. Whether it is 1, is to update its I / O task pressing variables and global I / O load variables, go back to step (3); otherwise update the global computing load variables; go back to step (3);
    (6)重新分配信用值步骤:根据当前虚拟CPU的信用值判定优先级,重新计算每个虚拟CPU分配的信用值额度,并更新所有虚拟CPU的信用值,判断更新后虚拟CPU的信用值是否从非正变为正,是则更改其优先级,转回步骤(3);否则有关虚拟CPU的优先级不改变,直接转回步骤(3);(6) Re-allocating the credit value step: determining the priority according to the credit value of the current virtual CPU, recalculating the credit value quota allocated by each virtual CPU, and updating the credit value of all the virtual CPUs to determine whether the credit value of the updated virtual CPU is Change from non-positive to positive, then change its priority, and return to step (3); otherwise, the priority of the virtual CPU does not change, and directly returns to step (3);
    (7)重新分配物理CPU步骤:根据全局I/O负载变量及计算负载变量分别计算运行I/O负载的物理CPU数目和运行计算型负载的物理CPU数目;并根据计算出的物理CPU数目修改对应的I/O位图和计算位图,重新建立虚拟CPU与物理CPU之间的亲和性;将I/O负载变量及计算负载变量清0,并更新所有虚拟CPU的I/O任务紧迫程度变量,转回步骤(3); (7) Reassign the physical CPU step: Calculate the number of physical CPUs running the I/O load and the number of physical CPUs running the calculated load according to the global I/O load variable and the calculated load variable; and modify according to the calculated physical CPU number Corresponding I/O bitmap and calculation bitmap, re-establish the affinity between virtual CPU and physical CPU; clear I/O load variable and calculation load variable to 0, and update all virtual CPU I/O tasks urgently Degree variable, return to step (3);
    (8)更改虚拟机类型步骤:读取用户命令,根据其中的虚拟机ID、虚拟机类型Q以及虚拟CPU数目Xi,读取原虚拟机类型Si,根据虚拟机类型Q和原虚拟机类型Si,重新建立虚拟机的各虚拟CPU与I/O位图或计算位图的亲和性,并修改虚拟机类型变量,转回步骤(3)。(8) to change the type of virtual machine steps of: reading a user command, according to which the virtual your crash ID, a virtual machine type and number of virtual Q CPU X i, read the original virtual machine type S i, according to the original virtual machine and a virtual machine type Q Type S i , re-establish the affinity of each virtual CPU of the virtual machine with the I/O bitmap or calculate the bitmap, and modify the virtual machine type variable, and return to step (3).
  2. 如权利要求1所述的虚拟CPU调度方法,其特征在于:The virtual CPU scheduling method according to claim 1, wherein:
    (1)调度初始化步骤,包括如下子步骤:(1) The scheduling initialization step includes the following sub-steps:
    (1.1)为每个物理CPU创建物理CPU调度结构:(1.1) Create a physical CPU scheduling structure for each physical CPU:
    判断是否为第一个物理CPU创建物理CPU调度结构,是则进行子步骤(1.2);否则转子步骤(1.3);Determine whether to create a physical CPU scheduling structure for the first physical CPU, and then perform sub-step (1.2); otherwise, the rotor step (1.3);
    (1.2)将第一个物理CPU标记为主物理CPU,并为其设置主计时器和调节计时器,主计时器周期T=30~100ms,为10ms的整数倍,同时为T的整数倍,调节计时器周期T=1200~3000ms,为T的整数倍,转子步骤(1.3);(1.2) Mark the first physical CPU as the main physical CPU, and set the main timer and the adjustment timer for it. The main timer period T main = 30 ~ 100ms, which is an integer multiple of 10ms, and is an integer of T times . times, adjusting the timer period T modulated = 1200 ~ 3000ms, T is an integral multiple of the main rotor step (1.3);
    (1.3)设置次级计时器,次级计时器周期T为(1~3)×10ms;将该物理CPU的历史负载变量Hp初始化为0;历史负载变量Hp记录在该物理CPU上运行的虚拟CPU所消耗掉的所有信用值总和,物理CPU序数p=1~G,G为系统中的物理CPU个数,G=1~64;(1.3) a secondary set timer period of the timer T times as the secondary (1 ~ 3) × 10ms; the physical CPU load history variable is initialized to 0 H p; H p variable load history recorded on the physical CPU The sum of all the credits consumed by the running virtual CPU, the physical CPU number p = 1 ~ G, G is the number of physical CPUs in the system, G = 1 ~ 64;
    (1.4)为每个虚拟机创建虚拟机调度结构:(1.4) Create a virtual machine scheduling structure for each virtual machine:
    在各个虚拟机的虚拟机调度结构中,将对应虚拟机信用值权重Wi初始化为256,对应虚拟机类型Si设定为0,并将其虚拟CPU链表初始化为空;In the virtual machine scheduling structure of each virtual machine, the corresponding virtual machine credit value weight W i is initialized to 256, the corresponding virtual machine type S i is set to 0, and its virtual CPU linked list is initialized to be empty;
    其中,虚拟机序数i=1~V,V为用户创建的虚拟机个数,V=1~100;Si为0表示计算型负载,Si为1表示I/O型负载,Si为2表示混合型负载,混合型负载为计算型和I/O型负载相当的负载;The virtual machine number i=1~V, V is the number of virtual machines created by the user, V=1~100; S i is 0 indicates a computing load, and S i is 1 indicates an I/O type load, and S i is 2 indicates a hybrid load, and the hybrid load is a load equivalent to a calculation type and an I/O type load;
    (1.5)为每个虚拟机的虚拟CPU初始化虚拟CPU调度结构:(1.5) Initialize the virtual CPU scheduling structure for each virtual machine's virtual CPU:
    将虚拟CPU加入所属虚拟机的虚拟CPU链表中; Add the virtual CPU to the virtual CPU linked list of the virtual machine to which it belongs;
    将每个虚拟CPU的负载变量Hij初始化为0,Initialize the load variable H ij of each virtual CPU to 0,
    将每个虚拟CPU的I/O任务紧迫程度变量Iij初始化为0,Iij=0~1,Iij值越大表示I/O任务越紧迫,Iij=0,表示没有I/O负载;Initialize the I/O task urgency variable I ij of each virtual CPU to 0, I ij =0~1. The larger the I ij value, the more urgent the I/O task is, I ij =0, indicating no I/O load. ;
    并为每个虚拟CPU分配信用值,其中第i个虚拟机的第j个虚拟CPU的信用值Cij=G×10×T×Wi/(WT×Mi);And assigning a credit value to each virtual CPU, wherein the credit value of the jth virtual CPU of the i-th virtual machine is C ij = G × 10 × T main × W i / (W T × M i );
    其中,系统总权重
    Figure PCTCN2014094010-appb-100001
    Among them, the total weight of the system
    Figure PCTCN2014094010-appb-100001
    虚拟机中虚拟CPU的序数j=1~Mi,Mi为第i个虚拟机的虚拟CPU个数,由用户设定,为小于G的整数;The number of virtual CPUs in the virtual machine is j=1~M i , and M i is the number of virtual CPUs of the i-th virtual machine, which is set by the user and is an integer smaller than G;
    (1.6)将I/O位图Ab和计算位图Ac初始化:(1.6) Initialize the I/O bitmap A b and the calculated bitmap A c :
    建立I/O位图Ab和计算位图Ac,将Ab中的各位初始化为全0,Ac中的各位初始化为全1,表示系统默认初始化运行计算型负载;Establish I / O bit map bit map calculation and A b A c, A b is the bits are initialized to all-0, A c is initialized to all you, a system default initialization operation computational load;
    (1.7)初始化时,所有虚拟CPU默认运行计算型负载,建立各虚拟CPU与计算位图Ac中置1位的物理CPU的亲和性;(1.7) Upon initialization, all default virtual CPU computational load operation, establishing each of the virtual CPU calculates the bit map A c is set a physical CPU affinity;
    (1.8)设置全局的I/O负载变量Lb以及计算负载变量Lc,将Lb和Lc均初始化为0;(1.8) setting the global I / O load variable L b and calculating the load variable L c , and initializing both L b and L c to 0;
    (1.9)将各虚拟CPU的优先级Pij初始化为-1,表示其可被调度;(1.9) Initializing the priority P ij of each virtual CPU to -1, indicating that it can be scheduled;
    (2)插入虚拟CPU运行队列步骤,包括如下子步骤:(2) Insert the virtual CPU run queue step, including the following substeps:
    (2.1)判断当前虚拟CPU是否与计算位图Ac设置亲和性,是则表示该虚拟CPU运行计算型负载,进行子步骤(2.2),否则表示该虚拟CPU运行I/O型负载,转子步骤(2.3),(2.1) determining whether the current virtual CPU has an affinity with the calculation bitmap A c , and indicating that the virtual CPU is running a computational load, performing sub-step (2.2), otherwise indicating that the virtual CPU is running an I/O type load, the rotor Step (2.3),
    (2.2)从当前物理CPU的虚拟CPU运行队列队首开始,比较当前虚拟CPU的优先级Pij是否大于虚拟CPU运行队列中的虚拟CPU优先级Pij,是则将当前虚拟CPU插入虚拟CPU运行队列中进行比较的虚拟CPU之前,否则顺序往后比较,直至虚拟CPU运行队列队尾;插入完成后,转步骤(3); (2.2) Starting from the virtual CPU running queue head of the current physical CPU, comparing whether the current virtual CPU priority P ij is greater than the virtual CPU priority P ij in the virtual CPU running queue, and inserting the current virtual CPU into the virtual CPU. Before the virtual CPUs in the queue are compared, otherwise the sequence is compared backwards until the virtual CPU runs the queue tail; after the insertion is completed, go to step (3);
    (2.3)从当前物理CPU的虚拟CPU运行队列队首开始,比较当前虚拟CPU的优先级Pij是否大于虚拟CPU运行队列中的虚拟CPU优先级Pij,是则将当前虚拟CPU插入虚拟CPU运行队列中进行比较虚拟CPU之前并转步骤(3);否则进行子步骤(2.4);(2.3) Starting from the virtual CPU running queue head of the current physical CPU, comparing whether the current virtual CPU priority P ij is greater than the virtual CPU priority P ij in the virtual CPU running queue, and inserting the current virtual CPU into the virtual CPU. Before the virtual CPU is compared in the queue, go to step (3); otherwise, perform sub-step (2.4);
    (2.4)比较当前虚拟CPU的优先级Pij是否等于虚拟CPU运行队列中的虚拟CPU优先级Pij,是则进行子步骤(2.5),否则顺序往后比较,直至虚拟CPU运行队列队尾,插入完成后,转步骤(3);(2.4) Compare whether the priority P ij of the current virtual CPU is equal to the virtual CPU priority P ij in the virtual CPU running queue, and then perform sub-step (2.5), otherwise the sequence is compared backwards until the virtual CPU runs the queue tail. After the insertion is completed, go to step (3);
    (2.5)比较当前虚拟CPU的Iij值是否大于虚拟CPU运行队列中的虚拟CPU的Iij值,是则将当前虚拟CPU插入虚拟CPU运行队列中进行比较虚拟CPU之前并转步骤(3);否则顺序往后,比较当前虚拟CPU的优先级Pij是否大于进行比较的虚拟CPU优先级Pij,是则将当前虚拟CPU插入虚拟CPU运行队列中进行比较虚拟CPU之前并转步骤(3);否则进行子步骤(2.4);(2.5) comparing the current value of the virtual CPU if I ij I ij is greater than the value of the virtual CPU operation queue virtual CPU, and a transfer step (3) before insertion then the current virtual CPU virtual CPU compares the run queue virtual CPU; Otherwise, the order is backward, comparing whether the priority P ij of the current virtual CPU is greater than the virtual CPU priority P ij for comparison, and then inserting the current virtual CPU into the virtual CPU running queue to compare the virtual CPUs and then transferring to step (3); Otherwise sub-step (2.4);
    (3)虚拟CPU运行步骤,包括如下子步骤:(3) The virtual CPU running steps include the following sub-steps:
    (3.1)在当前物理CPU的虚拟CPU运行队列中,判断队首虚拟CPU信用值Cij是否大于0,是则进行子步骤(3.2);否则触发负载均衡策略,转步骤(4);(3.1) In the virtual CPU running queue of the current physical CPU, determine whether the team head virtual CPU credit value C ij is greater than 0, then proceed to sub-step (3.2); otherwise, trigger the load balancing policy, and then go to step (4);
    (3.2)判断虚拟CPU运行队列中队首虚拟CPU亲和性设置的目标物理CPU组是否为Ab位图中置1位所代表的物理CPU,是则表明其运行I/O型负载,设置其运行时间片长度Ts=1ms~5ms;否则表明其运行计算型负载,设置其运行时间片长度Ts=30ms~100ms;(3.2) Determine whether the target physical CPU group set by the first virtual CPU affinity of the virtual CPU running queue is the physical CPU represented by the 1 bit in the A b bitmap, indicating that it is running the I/O type load and setting it The running time slice length T s =1ms ~ 5ms; otherwise it indicates that it runs the computational load, set its running time slice length T s = 30ms ~ 100ms;
    (3.3)将所述队首虚拟CPU从所在虚拟CPU运行队列中删除;(3.3) deleting the team head virtual CPU from the virtual CPU running queue;
    (3.4)判断当前物理CPU是否为主物理CPU,是则进行子步骤(3.5);否则进行子步骤(3.8);(3.4) determining whether the current physical CPU is the primary physical CPU, if yes, performing sub-step (3.5); otherwise, performing sub-step (3.8);
    (3.5)在主物理CPU上运行所述队首虚拟CPU,主物理CPU的次级计时器、主计时器和调节计时器同时计时;同时监控用户是否发出修改虚 拟机类型命令,是则执行步骤(8);否则进行子步骤(3.6);(3.5) running the team head virtual CPU on the primary physical CPU, the secondary timer of the primary physical CPU, the primary timer, and the adjustment timer are simultaneously clocked; and simultaneously monitoring whether the user issues a modified virtual If the machine type command is executed, step (8) is performed; otherwise, sub-step (3.6) is performed;
    (3.6)判断该队首虚拟CPU的运行时间是否小于Ts,是则进行子步骤(3.7);否则将该队首虚拟CPU从主物理CPU上移除,转步骤(2);(3.6) determining whether the running time of the first virtual CPU of the team is less than T s , then proceeding to sub-step (3.7); otherwise, removing the first virtual CPU from the primary physical CPU, and then moving to step (2);
    (3.7)当次级计时器经历了时间T,则次级计时器复位,转步骤(5);当主计时器经历了时间T,则主计时器复位,转步骤(6);当调节计时器经历了时间T,则调节计时器复位,转步骤(7);如果在Ts时间内没有触发任何计时器,虚拟CPU持续运行时间Ts,将该队首虚拟CPU从主物理CPU上移除,转步骤(2);(3.7) When the secondary timer has experienced the time T times , the secondary timer is reset, go to step (5); when the master timer has experienced the time T master , the master timer is reset, go to step (6); The timer has experienced the time T adjustment , then adjust the timer reset, go to step (7); if no timer is triggered within T s time, the virtual CPU continues to run for T s , the team first virtual CPU from the main physical CPU Remove, go to step (2);
    (3.8)在当前物理CPU上运行所述队首虚拟CPU,当前物理CPU的次级计时器计时;同时监控用户是否修改虚拟机类型,是则执行步骤(8);否则进行子步骤(3.9);(3.8) Running the team head virtual CPU on the current physical CPU, and timing the secondary timer of the current physical CPU; and monitoring whether the user modifies the virtual machine type, if yes, performing step (8); otherwise, performing sub-step (3.9) ;
    (3.9)判断该队首虚拟CPU的运行时间是否小于Ts,是则进行子步骤(3.10);否则将该队首虚拟CPU从当前物理CPU上移除,转步骤(2);(3.9) determining whether the running time of the first virtual CPU of the team is less than T s , then proceeding to sub-step (3.10); otherwise, removing the first virtual CPU from the current physical CPU, and proceeding to step (2);
    (3.10)当次级计时器经历了时间T,则次级计时器复位,转步骤(5),如果在Ts时间内没有触发任何计时器,虚拟CPU持续运行时间Ts,将该队首虚拟CPU从当前物理CPU上移除,转步骤(2);(3.10) when subjected to a secondary timer times the time T, then the secondary timer is reset, go to step (5), if the timer does not trigger any time T S, the virtual CPU operation time duration T S, the team The first virtual CPU is removed from the current physical CPU, and the process proceeds to step (2);
    (4)负载均衡步骤,包括如下子步骤:(4) The load balancing step includes the following substeps:
    (4.1)选择进行负载均衡的物理CPU组:判断当前物理CPU在I/O位图Ab中对应位是否为1,是则表示该物理CPU的虚拟CPU运行队列上运行的是I/O型负载,将I/O位图Ab中置1位的非空闲物理CPU作为可进行负载均衡的目标物理CPU组,进行子步骤(4.2);否则表示该物理CPU队列上运行的是计算型负载,将计算位图Ac中置1位的非空闲物理CPU作为可进行负载均衡的目标物理CPU组,进行子步骤(4.2);(4.1) Select the physical CPU group for load balancing: determine whether the corresponding bit of the current physical CPU in the I/O bitmap A b is 1, indicating that the virtual CPU running queue of the physical CPU is running I/O type. Load, the non-idle physical CPU set to 1 bit in the I/O bitmap A b is used as the target physical CPU group for load balancing, and sub-step (4.2); otherwise, the physical CPU queue is running the computational load. Calculating a non-idle physical CPU set to 1 bit in the bitmap A c as a target physical CPU group for load balancing, and performing sub-step (4.2);
    (4.2)从目标物理CPU组中选择迁移最优的物理CPU:在相应的Ab或Ac中,遍历所述目标物理CPU组,判断是否找到与当前物理CPU在同一个物理核上的非空闲物理CPU,是则将其作为迁移的目标物理CPU,转 子步骤(4.8),否则转子步骤(4.3);(4.2) Selecting the optimal physical CPU from the target physical CPU group: traversing the target physical CPU group in the corresponding A b or A c , and determining whether to find the non-physical CPU on the same physical core The idle physical CPU is the target physical CPU of the migration, the rotor step (4.8), otherwise the rotor step (4.3);
    (4.3)在相应的Ab或Ac中,重新遍历目标物理CPU组,判断是否找到与当前物理CPU在同一个物理封装中的非空闲物理CPU,是则进行子步骤(4.4),否则转子步骤(4.5);(4.3) Re-traversing the target physical CPU group in the corresponding A b or A c to determine whether a non-idle physical CPU in the same physical package as the current physical CPU is found, and then sub-step (4.4), otherwise the rotor Step (4.5);
    (4.4)判断该非空闲物理CPU的Hp是否大于当前物理CPU的Hp,是则将该物理CPU作为迁移的目标物理CPU,转子步骤(4.8),否则转子步骤(4.5);If (4.4) determines the non-physical CPU idle is greater than the current H p H p physical CPU, the physical CPU is the target physical CPU, the rotor step (4.8) of the migration, otherwise step rotor (4.5);
    (4.5)在相应目标物理CPU组中,顺序向后判断是否找到与当前物理CPU在同一个物理封装中的非空闲物理CPU,是则转子步骤(4.4),否则转子步骤(4.6);(4.5) in the corresponding target physical CPU group, sequentially determine backwards whether to find a non-idle physical CPU in the same physical package as the current physical CPU, then the rotor step (4.4), otherwise the rotor step (4.6);
    (4.6)重新遍历目标物理CPU组,判断是否找到与当前物理CPU在不同物理封装上的非空闲物理CPU,是则进行子步骤(4.7),否则将当前物理CPU标记为空闲,运行空闲的虚拟CPU,转子步骤(3.4);(4.6) Re-traversing the target physical CPU group to determine whether to find a non-idle physical CPU on a different physical package than the current physical CPU. If yes, perform sub-step (4.7). Otherwise, mark the current physical CPU as idle and run idle virtual. CPU, rotor step (3.4);
    (4.7)判断该非空闲物理CPU的Hp是否大于当前物理CPU的Hp的两倍,是则将该非空闲物理CPU作为迁移的目标物理CPU,转子步骤(4.8);否则将当前物理CPU标记为空闲,运行空闲的虚拟CPU,转子步骤(3.4);(4.7) determining whether the H p of the non-idle physical CPU is greater than twice the H p of the current physical CPU, and the non-idle physical CPU is the target physical CPU of the migration, the rotor step (4.8); otherwise, the current physical CPU Marked as idle, running idle virtual CPU, rotor step (3.4);
    (4.8)在目标物理CPU上选择合适的虚拟CPU进行转移:(4.8) Select the appropriate virtual CPU to transfer on the target physical CPU:
    判断当前物理CPU在I/O位图Ab中对应位是否为1,是则遍历目标物理CPU的虚拟CPU运行队列,将其中Iij值最大的虚拟CPU作为迁移的目标虚拟CPU,转子步骤(4.9);否则遍历目标物理CPU的虚拟CPU运行队列,找到Hij最接近目标物理CPU的Hp与触发负载均衡的物理CPU的Hp差值一半的虚拟CPU作为迁移的目标虚拟CPU,转子步骤(4.9);Determine whether the corresponding bit of the current physical CPU in the I/O bitmap A b is 1, and traverse the virtual CPU running queue of the target physical CPU, and use the virtual CPU with the largest I ij value as the target virtual CPU of the migration, and the rotor step ( 4.9); H p half of the difference between the target virtual CPU or physical CPU traverse the virtual CPU run queue, find H ij closest to the target physical CPU H p and trigger load balancing physical CPU as the migration target virtual CPU, rotor step (4.9);
    (4.9)将迁移的目标虚拟CPU从目标物理CPU的虚拟CPU运行队列上移除并插入到当前物理CPU的虚拟CPU运行队列的队首,转子步骤(3.2); (4.9) removing the migrated target virtual CPU from the virtual CPU running queue of the target physical CPU and inserting it into the head of the virtual CPU running queue of the current physical CPU, and the rotor step (3.2);
    (5)更新信用值与系统负载步骤,包括如下子步骤:(5) The steps of updating the credit value and system load, including the following sub-steps:
    (5.1)更新当前虚拟CPU的信用值Cij:将Cij-10×T1的值赋予Cij(5.1) updating the credit value C ij of the current virtual CPU: assigning the value of C ij -10×T 1 to C ij ;
    更新当前虚拟CPU的负载变量Hij:将Hij+10×T1的值赋予HijUpdate the load variable H ij of the current virtual CPU: assign the value of H ij +10×T 1 to H ij ;
    更新运行当前虚拟CPU的物理CPU的历史负载变量Hp:将Hp+10×T1的值赋予HpUpdate the historical load variable H p of the physical CPU running the current virtual CPU: assign the value of H p +10×T 1 to H p ;
    一个虚拟CPU运行1ms消耗的信用值额度为10,T1为当前虚拟CPU从上次开始运行至今经历的时间,单位为ms;The credit value of a virtual CPU running for 1ms is 10, and T 1 is the time elapsed since the last virtual CPU has been running since the last time, in units of ms;
    (5.2)判断运行当前虚拟CPU的物理CPU在I/O位图Ab中对应位值是否为1,是则表示运行了I/O任务,更新其Iij,将Iij-1/(10×T1)的值赋予Iij,进行子步骤(5.3);否则直接进行子步骤(5.3);(5.2) Determine whether the physical CPU running the current virtual CPU has a corresponding bit value in the I/O bitmap A b , which means that the I/O task is run, and its I ij is updated, and I ij -1/(10 The value of ×T 1 ) is assigned to I ij , and sub-step (5.3) is performed; otherwise, sub-step (5.3) is directly performed;
    (5.3)根据当前虚拟CPU运行负载的类型,将其消耗掉的信用值累加到系统负载中:判断运行当前虚拟CPU的物理CPU在位图Ab中对应位值是否为1,是则更新全局的I/O负载变量Lb,将Lb+10×T1的值赋予Lb,转子步骤(3.4);否则更新全局的计算负载变量Lc,将Lc+10×T1的值赋予Lc,转子步骤(3.4);(5.3) According to the current type of virtual CPU running load, the credit value consumed by the virtual CPU is added to the system load: it is determined whether the physical CPU running the current virtual CPU has a corresponding bit value in the bitmap A b , and the global value is updated. The I/O load variable L b , the value of L b +10×T 1 is assigned to L b , the rotor step (3.4); otherwise the global calculated load variable L c is updated, and the value of L c +10×T 1 is assigned L c , rotor step (3.4);
    (6)重新分配信用值步骤,包括如下子步骤:(6) The step of reallocating the credit value includes the following substeps:
    (6.1)判断当前虚拟CPU信用值是否大于0,是则进行子步骤(6.2);否则将当前虚拟CPU的优先级Pij设置成-2,表示无法再调度,进行子步骤(6.2);(6.1) determining whether the current virtual CPU credit value is greater than 0, then proceeding to sub-step (6.2); otherwise, setting the current virtual CPU priority P ij to -2, indicating that the scheduling cannot be performed again, performing sub-step (6.2);
    (6.2)为每个虚拟机的虚拟CPU新分配信用值NCij(6.2) Newly assign a credit value NC ij to the virtual CPU of each virtual machine:
    NCij=G×T×10×Wi/(WT×Mi);NC ij = G × T main × 10 × W i / (W T × M i );
    其中NCij为第i个虚拟机的第j个虚拟CPU新得到的信用值;Where NC ij is the newly obtained credit value of the jth virtual CPU of the i-th virtual machine;
    (6.3)更新各虚拟CPU的信用值Cij(6.3) Update the credit value C ij of each virtual CPU:
    将NCij+Cij的值赋予CijAssign the value of NC ij +C ij to C ij ,
    判断是否Cij>0且Pij值为-2,是则将有关虚拟CPU的优先级Pij更改为-1,转子步骤(3.4),否则有关虚拟CPU的优先级Pij不改变,直接转子 步骤(3.4);Judging whether C ij >0 and P ij value is -2, is to change the priority P ij about the virtual CPU to -1, the rotor step (3.4), otherwise the priority P ij about the virtual CPU does not change, the direct rotor Step (3.4);
    (7)重新分配物理CPU步骤,包括如下子步骤:(7) The process of reallocating the physical CPU includes the following substeps:
    (7.1)计算相应物理CPU数目;(7.1) Calculate the number of corresponding physical CPUs;
    运行I/O型负载的物理CPU数目N(Ab):Number of physical CPUs running I/O type load N( Ab ):
    N(Ab)=(Lb/(Lb+Lc))×G;N( Ab )=(L b /(L b +L c ))×G;
    运行计算型负载的物理CPU数目N(Ac):The number of physical CPUs running the compute load, N( Ac ):
    N(Ac)=G-N(Ab);N( Ac )=G-N( Ab );
    (7.2)判断I/O位图Ab中置1位的物理CPU数目是否小于N(Ab),是则进行子步骤(7.3),否则转子步骤(7.4);(7.2) Determine whether the number of physical CPUs set to 1 bit in the I/O bitmap A b is less than N( Ab ), then proceed to sub-step (7.3), otherwise the rotor step (7.4);
    (7.3)从运行计算型负载的物理CPU中转移差值数目的物理CPU来运行I/O型负载:令Y=N(Ab)—I/O位图Ab中置1位的物理CPU数目,将I/O位图Ab中前Y个为0的位均置1,并将计算位图Ac中对应位清0,转子步骤(7.6);(7.3) Transfer the number of physical CPUs from the physical CPU running the computational load to run the I/O type load: Let Y=N( Ab )—I/O Bitmap A b Set the number of physical CPUs in Ab Set the first Y bits of the I/O bitmap A b to 1 and clear the corresponding bit in the calculated bitmap A c to the rotor step (7.6);
    (7.4)判断I/O位图Ab中置1位的物理CPU数目是否等于N(Ab),是则转子步骤(7.7);否则进行子步骤(7.5);(7.4) Determine whether the number of physical CPUs set to 1 in the I/O bitmap A b is equal to N( Ab ), then the rotor step (7.7); otherwise, perform sub-step (7.5);
    (7.5)从运行I/O型负载的物理CPU中转移差值数目的物理CPU来运行计算型负载:令Y=I/O位图Ab中置1位的物理CPU数目—N(Ab),将I/O位图Ab中前Y个置1位均清0,并将计算位图Ac中对应位置1,转子步骤(7.6);(7.5) Transfer the number of physical CPUs from the physical CPU running the I/O type load to run the computational load: Let Y=I/O bitmap A b set the number of physical CPUs - N( Ab ) , clear the first Y bits in the I/O bitmap A b to 0, and calculate the corresponding position in the bitmap A c , the rotor step (7.6);
    (7.6)重新设置虚拟CPU亲和性:重新建立运行I/O型负载的所有虚拟CPU与I/O位图Ab中置1位的物理CPU的亲和性;(7.6) reset the virtual CPU affinity: reestablish all virtual CPU and I Run I / O type load / O bit map A b is set in a physical affinity for the CPU;
    重新建立运行计算型负载的所有虚拟CPU与计算位图Ac中置1位的物理CPU的亲和性;Re-establish the operating computational load is calculated for all virtual CPU and bit map A c is set in a physical affinity for the CPU;
    (7.7)将I/O负载变量Lb及计算负载变量Lc清0,并更新所有虚拟CPU的I/O任务紧迫程度变量Iij:将1/Hij的值赋予Iij,转子步骤(3.4);(7.7) Clear the I/O load variable L b and the calculated load variable L c to 0, and update the I/O task urgency variable I ij of all virtual CPUs: assign the value of 1/H ij to I ij , the rotor step ( 3.4);
    (8)更改虚拟机类型步骤,包括如下子步骤: (8) Steps to change the virtual machine type, including the following sub-steps:
    (8.1)根据用户发出的修改虚拟机类型命令,读取其中的虚拟机ID、虚拟机类型Q以及虚拟CPU数目Xi,根据虚拟机ID,在其虚拟机调度结构中读取其虚拟机类型Si(8.1) According to the modified virtual machine type command issued by the user, read the virtual machine ID, the virtual machine type Q, and the virtual CPU number X i , and read the virtual machine type in the virtual machine scheduling structure according to the virtual machine ID. S i ;
    所述修改虚拟机类型命令包括虚拟机ID字段、虚拟机类型字段和虚拟CPU数目字段,虚拟机ID字段给出待修改类型的虚拟机ID;虚拟机类型字段给出待修改的虚拟机类型Q,Q为0表示计算型负载,Q为1表示I/O型负载,Q为2表示混合型负载;虚拟CPU数目字段给出混合型虚拟机中用于运行I/O负载的虚拟CPU数目,仅当Q=2时该字段才有效;The modify virtual machine type command includes a virtual machine ID field, a virtual machine type field, and a virtual CPU number field, and the virtual machine ID field gives a virtual machine ID of a type to be modified; the virtual machine type field gives a virtual machine type Q to be modified. Q is 0 for the computational load, Q is 1 for the I/O load, and Q is 2 for the hybrid load; the virtual CPU number field is for the number of virtual CPUs used to run the I/O load in the hybrid virtual machine. This field is valid only when Q=2;
    (8.2)判断是否Q=0,是则进行子步骤(8.3),否则进行子步骤(8.6);(8.2) judging whether Q=0, yes, proceeding to sub-step (8.3), otherwise performing sub-step (8.6);
    (8.3)判断是否Si=0,是则保持虚拟机类型Si不变,转子步骤(3.5);否则判断是否Si=1,是则进行子步骤(8.4),否则进行子步骤(8.5);(8.3) Determine whether S i =0, if yes, keep the virtual machine type S i unchanged, the rotor step (3.5); otherwise, judge whether S i =1, then proceed to sub-step (8.4), otherwise perform sub-step (8.5 );
    (8.4)判定Si=1,表示将运行I/O型负载的虚拟机转变为计算型负载的虚拟机,解除其各虚拟CPU与I/O位图Ab中置1位的物理CPU的亲和性,重新建立该虚拟机的所有虚拟CPU与计算位图Ac中置1位的物理CPU的亲和性,并且将Si修改为0,转子步骤(3.5);(8.4) Determining that S i =1 means that the virtual machine running the I/O type load is converted into a virtual machine of the computational load, and the physical CPUs of each virtual CPU and the I/O bitmap A b are removed. affinity, to re-establish the virtual machine and the virtual CPU is calculated for all bit map a physical CPU affinity of a center c, and the modified S i is 0, the rotor step (3.5);
    (8.5)判定Si=2,表示将运行混合型负载的虚拟机转变为运行计算型负载的虚拟机,解除其各虚拟CPU与I/O位图Ab中置1位的物理CPU的亲和性,重新建立其各个虚拟CPU与计算位图Ac中置1位的物理CPU的亲和性,并且将Si修改为0,转子步骤(3.5);(8.5) Determining S i = 2 means that the virtual machine running the hybrid load is converted into a virtual machine running the computational load, and the virtual CPUs of each virtual CPU and the I/O bitmap A b are deactivated. and resistance, the re-establishment of the virtual CPU which calculates the respective bit map a c is set in a physical CPU affinity, and S i 0 is modified, the rotor step (3.5);
    (8.6)判断是否Q=1,是则进行子步骤(8.7),否则进行子步骤(8.11);(8.6) judging whether Q=1, if yes, proceeding to sub-step (8.7), otherwise performing sub-step (8.11);
    (8.7)判断是否Si=0,是则进行步骤(8.8),否则进行子步骤(8.9);(8.7) judging whether S i =0, if yes, proceeding to step (8.8), otherwise performing sub-step (8.9);
    (8.8)表示将运行计算型负载的虚拟机转变为运行I/O型负载的虚拟机,解除其各虚拟CPU与计算位图Ac中置1位的物理CPU的亲和性,重新建立该虚拟机的所有虚拟CPU与I/O位图Ab中置1位的物理CPU的亲和性,并且将Si修改为1,转子步骤(3.5);(8.8) indicates that the virtual machine running the computational load is converted into a virtual machine running an I/O type load, and the affinity of each virtual CPU to the physical CPU that is set to one bit in the calculation bitmap A c is released, and the All virtual CPUs of the virtual machine have affinity with the physical CPU set to 1 bit in the I/O bitmap A b , and modify S i to 1, the rotor step (3.5);
    (8.9)判断是否Si=1,是则保持虚拟机类型Si不变,转子步骤(3.5); 否则进行子步骤(8.10);(8.9) judging whether S i =1, yes, keeping the virtual machine type S i unchanged, the rotor step (3.5); otherwise performing the sub-step (8.10);
    (8.10)判定Si=2,表示将运行混合型负载的虚拟机转变为运行I/O型负载的虚拟机,解除其各虚拟CPU与计算位图Ac中置1位的物理CPU的亲和性,重新建立其各虚拟CPU与I/O位图Ai中置1位的物理CPU的亲和性,并且将Si修改为1,转子步骤(3.5);(8.10) Judging that S i = 2 means that the virtual machine running the hybrid load is converted into a virtual machine running the I/O type load, and the virtual CPU of each of the virtual CPUs is calculated and the physical CPU of the bitmap A c is set. And re-establish the affinity of each virtual CPU with the physical CPU set to 1 bit in the I/O bitmap A i , and modify S i to 1, the rotor step (3.5);
    (8.11)判定Q=2,判断是否Si=0,是则进行子步骤(8.12),否则进行子步骤(8.13);(8.11) Determine Q=2, judge whether S i =0, if yes, perform sub-step (8.12), otherwise perform sub-step (8.13);
    (8.12)判定Si=0,表示将运行计算型负载的虚拟机转变为运行混合型负载的虚拟机,解除该虚拟机中前Xi个虚拟CPU与计算位图Ac中置1位的物理CPU的亲和性,重新建立该虚拟机中前Xi个虚拟CPU与I/O位图Ab中置1位的物理CPU的亲和性,并且将Si修改为2,转子步骤(3.5);(8.12) Determining S i =0, indicating that the virtual machine running the computational load is converted into a virtual machine running the hybrid load, and the first X i virtual CPUs in the virtual machine are removed and the calculation bitmap A c is set to 1 bit. The affinity of the physical CPU, re-establishing the affinity of the first X i virtual CPUs in the virtual machine and the physical CPU set in the I/O bitmap A b , and modifying the S i to 2, the rotor step ( 3.5);
    (8.13)判断是否Si=1,是则进行子步骤(8.14),否则进行子步骤(8.15);(8.13) Judging whether S i =1, then proceeding to sub-step (8.14), otherwise performing sub-step (8.15);
    (8.14)判定Si=1,表示将运行I/O型负载的虚拟机转变为运行混合型负载的虚拟机,解除该虚拟机中后Mi-Xi个虚拟CPU与I/O位图Ab中置1位的物理CPU的亲和性,重新建立该虚拟机中后Mi-Xi个虚拟CPU与计算位图Ac中置1位的物理CPU的亲和性,并且将Si修改为2,转子步骤(3.5);(8.14) determines S i = 1, represents the operation I / O type load into the virtual machine a virtual machine running the hybrid load is released after the virtual machine M i -X i virtual CPU and I / O bitmap The affinity of the physical CPU of the 1-bit is set in A b , and the affinity of the virtual CPU in the virtual machine after the M i -X i virtual CPU is calculated and the physical CPU set in the bitmap A c is set, and the S is i is modified to 2, rotor step (3.5);
    (8.15)判定Si=2,保持虚拟机类型Si不变,转子步骤(3.5)。(8.15) Determine S i = 2, keep the virtual machine type S i unchanged, and rotate the step (3.5).
  3. 如权利要求2所述的虚拟CPU调度方法,其特征在于:The virtual CPU scheduling method according to claim 2, wherein:
    所述调度初始化步骤、重新分配物理CPU步骤和更改虚拟机类型步骤中,建立各虚拟CPU与I/O位图Ab或者计算位图Ac中置1位的物理CPU的亲和性时,通过系统定义的设置亲和性函数;In the steps of the scheduling initialization step, the reallocation of the physical CPU step, and the change of the virtual machine type, when each virtual CPU is established with the I/O bitmap A b or the affinity of the physical CPU set in the bitmap A c is set, Set the affinity function through the system definition;
    解除各虚拟CPU与I/O位图Ab或者计算位图Ac中置1位的物理CPU的亲和性时,通过系统定义的设置亲和性函数,重新建立各虚拟CPU与I/O位图Ab或者计算位图Ac中置1位的物理CPU的亲和性。 When the virtual CPU is deactivated with the I/O bitmap A b or the physical CPU that is set to one bit in the bitmap A c , the virtual CPU and I/O are re-established by the system-defined setting affinity function. The bitmap A b or the affinity of the physical CPU set to 1 bit in the bitmap A c is calculated.
PCT/CN2014/094010 2014-11-23 2014-12-17 Virtual cpu scheduling method WO2016078178A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410676265.3A CN104503838B (en) 2014-11-23 2014-11-23 A kind of virtual cpu dispatching method
CN2014106762653 2014-11-23

Publications (1)

Publication Number Publication Date
WO2016078178A1 true WO2016078178A1 (en) 2016-05-26

Family

ID=52945238

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/094010 WO2016078178A1 (en) 2014-11-23 2014-12-17 Virtual cpu scheduling method

Country Status (2)

Country Link
CN (1) CN104503838B (en)
WO (1) WO2016078178A1 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108595249A (en) * 2018-05-02 2018-09-28 联想(北京)有限公司 A kind of virtual machine method for scheduling task and electronic equipment
CN109753339A (en) * 2017-11-06 2019-05-14 阿里巴巴集团控股有限公司 Resource allocation method and device and electronic equipment
CN111459622A (en) * 2020-04-15 2020-07-28 腾讯科技(深圳)有限公司 Method and device for scheduling virtual CPU, computer equipment and storage medium
CN113032154A (en) * 2021-04-19 2021-06-25 深信服科技股份有限公司 Virtual CPU scheduling method and device, electronic equipment and storage medium

Families Citing this family (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105045667B (en) * 2015-07-13 2018-11-30 中国科学院计算技术研究所 A kind of resource pool management method for virtual machine vCPU scheduling
CN105607950A (en) * 2015-10-30 2016-05-25 浪潮(北京)电子信息产业有限公司 Virtual machine resource configuration method and apparatus
WO2017107091A1 (en) * 2015-12-23 2017-06-29 Intel IP Corporation Virtual cpu consolidation to avoid physical cpu contention between virtual machines
US10445100B2 (en) 2016-06-09 2019-10-15 International Business Machines Corporation Broadcasting messages between execution slices for issued instructions indicating when execution results are ready
CN107544843A (en) * 2017-08-28 2018-01-05 北京翼辉信息技术有限公司 A kind of partition system dispatching algorithm
CN107506286A (en) * 2017-09-26 2017-12-22 郑州云海信息技术有限公司 CPU and memory block automatically upper inserting method and system
US20190370059A1 (en) * 2018-05-30 2019-12-05 Advanced Micro Devices, Inc. Multi-kernel wavefront scheduler
CN109062629A (en) * 2018-07-13 2018-12-21 成都泛美视界科技有限公司 A kind of performance optimization method of flight simulation software
CN109298972B (en) * 2018-09-06 2019-11-15 高盈量化云科技(深圳)有限公司 A kind of High Availabitity policy engine
CN109840135B (en) * 2019-01-30 2022-02-18 郑州云海信息技术有限公司 Load balancing method and device and electronic equipment
CN111274024B (en) * 2019-03-19 2023-05-30 中标软件有限公司 CFS scheduler-based ready queue average load optimization method and data structure
CN111343275B (en) * 2020-03-02 2022-09-30 北京奇艺世纪科技有限公司 Resource scheduling method and system
CN111427673B (en) * 2020-03-16 2023-04-07 杭州迪普科技股份有限公司 Load balancing method, device and equipment
CN113282366A (en) * 2021-04-02 2021-08-20 中国船舶重工集团公司第七研究院 Static virtual machine placement method oriented to embedded virtualization environment
CN112988399B (en) * 2021-04-30 2021-07-20 成都网安科技发展有限公司 Processor scheduling method and processor scheduling device based on virtualization technology

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020087611A1 (en) * 2000-12-28 2002-07-04 Tsuyoshi Tanaka Virtual computer system with dynamic resource reallocation
CN102253857A (en) * 2011-06-24 2011-11-23 华中科技大学 Xen virtual machine scheduling control method in multi-core environment
CN103049332A (en) * 2012-12-06 2013-04-17 华中科技大学 Virtual CPU scheduling method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103678003B (en) * 2013-12-18 2016-08-31 华中科技大学 The virtual cpu dispatching method that a kind of real-time strengthens

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020087611A1 (en) * 2000-12-28 2002-07-04 Tsuyoshi Tanaka Virtual computer system with dynamic resource reallocation
CN102253857A (en) * 2011-06-24 2011-11-23 华中科技大学 Xen virtual machine scheduling control method in multi-core environment
CN103049332A (en) * 2012-12-06 2013-04-17 华中科技大学 Virtual CPU scheduling method

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109753339A (en) * 2017-11-06 2019-05-14 阿里巴巴集团控股有限公司 Resource allocation method and device and electronic equipment
CN109753339B (en) * 2017-11-06 2023-04-28 阿里巴巴集团控股有限公司 Resource allocation method and device and electronic equipment
CN108595249A (en) * 2018-05-02 2018-09-28 联想(北京)有限公司 A kind of virtual machine method for scheduling task and electronic equipment
CN111459622A (en) * 2020-04-15 2020-07-28 腾讯科技(深圳)有限公司 Method and device for scheduling virtual CPU, computer equipment and storage medium
CN111459622B (en) * 2020-04-15 2023-10-13 腾讯科技(深圳)有限公司 Method, device, computer equipment and storage medium for scheduling virtual CPU
CN113032154A (en) * 2021-04-19 2021-06-25 深信服科技股份有限公司 Virtual CPU scheduling method and device, electronic equipment and storage medium
CN113032154B (en) * 2021-04-19 2023-11-07 深信服科技股份有限公司 Scheduling method and device for virtual CPU, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN104503838B (en) 2017-06-27
CN104503838A (en) 2015-04-08

Similar Documents

Publication Publication Date Title
WO2016078178A1 (en) Virtual cpu scheduling method
US10503704B2 (en) Isolating resources and performance in a database management system
EP3254196B1 (en) Method and system for multi-tenant resource distribution
AU2013206117B2 (en) Hierarchical allocation of network bandwidth for quality of service
US9483187B2 (en) Quality of service implementation in a networked storage system with hierarchical schedulers
JP3672236B2 (en) Method, system, and program product for managing a central processing unit in a computer environment
JP3813056B2 (en) Processing channel subsystem pending I / O work queue based on priority
JP3807916B2 (en) Method and system for managing a group of partitions in a computer environment
Aladwani Types of task scheduling algorithms in cloud computing environment
CN107122233B (en) TSN service-oriented multi-VCPU self-adaptive real-time scheduling method
Lai et al. Sol: Fast distributed computation over slow networks
Sonkar et al. A review on resource allocation and VM scheduling techniques and a model for efficient resource management in cloud computing environment
Ling et al. Efficient disk I/O scheduling with qos guarantee for xen-based hosting platforms
Suo et al. Preserving i/o prioritization in virtualized oses
Jin et al. Flubber: Two-level disk scheduling in virtualized environment
Xiao et al. Energy-efficiency enhanced virtual machine scheduling policy for mixed workloads in cloud environments
Komarasamy et al. ScHeduling of jobs and Adaptive Resource Provisioning (SHARP) approach in cloud computing
US11934890B2 (en) Opportunistic exclusive affinity for threads in a virtualized computing system
Komarasamy et al. Deadline constrained adaptive multilevel scheduling system in cloud environment
KR101639947B1 (en) Hadoop preemptive deadline constraint scheduling method, execution program thereof method and recorded medium of the program
Peng et al. BQueue: A coarse-grained bucket QoS scheduler
Alatawi et al. Hybrid load balancing approach based on the integration of QoS and power consumption in cloud computing
Ru et al. Providing fairer resource allocation for multi-tenant cloud-based systems
Gu et al. Elastic model aggregation with parameter service
Hu et al. Low latency big data processing without prior information

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 14906215

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 14906215

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 14906215

Country of ref document: EP

Kind code of ref document: A1