CN107273188B - Virtual machine Central Processing Unit (CPU) binding method and device - Google Patents

Virtual machine Central Processing Unit (CPU) binding method and device Download PDF

Info

Publication number
CN107273188B
CN107273188B CN201710592879.7A CN201710592879A CN107273188B CN 107273188 B CN107273188 B CN 107273188B CN 201710592879 A CN201710592879 A CN 201710592879A CN 107273188 B CN107273188 B CN 107273188B
Authority
CN
China
Prior art keywords
cpu
binding
virtual machine
resource occupancy
occupancy rate
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710592879.7A
Other languages
Chinese (zh)
Other versions
CN107273188A (en
Inventor
解琰
曾鹏
庞慷宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology Co Ltd
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 Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN201710592879.7A priority Critical patent/CN107273188B/en
Publication of CN107273188A publication Critical patent/CN107273188A/en
Application granted granted Critical
Publication of CN107273188B publication Critical patent/CN107273188B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • 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/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/4557Distribution of virtual machine instances; Migration and load balancing

Abstract

The invention discloses a method and a device for binding a Central Processing Unit (CPU) of a virtual machine, and relates to the virtual machine technology. The invention discloses a virtual machine CPU binding method, which comprises the following steps: binding a virtual machine with a memory resource occupancy rate reaching or exceeding a first set threshold value with a physical CPU (central processing unit) of a shared L2 cache according to a first binding policy, wherein the first binding policy comprises the following conditions: and binding the virtual machines with the memory resource occupancy rates reaching or exceeding the first set threshold value on the physical CPUs sharing the cache of the L2, and only running one virtual machine with the memory resource occupancy rate reaching or exceeding the first set threshold value on the bound physical CPU.

Description

Virtual machine Central Processing Unit (CPU) binding method and device
Technical Field
The invention relates to a virtual machine technology, in particular to a virtual machine performance management scheme based on a physical CPU sharing L2 cache.
Background
Each virtual CPU of the virtual machine in the virtualized environment may be independently allocated to a physical CPU, for example, the virtual machine CPU1 of the virtual machine a may be allocated to the physical CPU3, so that the virtual machine CPU can only use the resources of the physical CPU3, but in the multi-core CPU of the present day, each physical CPU is not completely isolated, and if the virtual machine CPU is not correctly allocated to the corresponding physical CPU, the performance may be reduced.
Disclosure of Invention
The technical problem to be solved by the invention is to provide a virtual machine CPU binding method and device, which can solve the problem of low performance of a virtual machine.
In order to solve the technical problem, the invention discloses a method for binding a Central Processing Unit (CPU) of a virtual machine, which comprises the following steps:
binding a virtual machine with a memory resource occupancy rate reaching or exceeding a first set threshold value with a physical CPU (central processing unit) of a shared L2 cache according to a first binding policy, wherein the first binding policy comprises the following conditions:
and binding the virtual machines with the memory resource occupancy rates reaching or exceeding the first set threshold value on the physical CPUs sharing the cache of the L2, and only running one virtual machine with the memory resource occupancy rate reaching or exceeding the first set threshold value on the bound physical CPU.
Optionally, the method further includes:
binding the virtual machine with the CPU resource occupancy rate reaching or exceeding a second set threshold value with the physical CPU cached in the shared L2 according to a second binding policy, wherein the second binding policy comprises the following conditions:
binding the virtual machine with the CPU resource occupancy rate reaching or exceeding a second set threshold value on the physical CPU sharing the L2 cache
Optionally, in the above method, the second binding policy further includes:
and binding the virtual machine with the CPU resource occupancy rate reaching or exceeding a second set threshold value on the physical CPU cached by the shared L2 with lower CPU resource utilization rate.
Optionally, in the above method, before the binding the virtual machine whose memory resource occupancy rate reaches or exceeds the first set threshold with the physical CPU sharing the L2 cache according to the first binding policy, the method further includes:
and monitoring the resource use condition of each virtual machine of the host, wherein the resource use condition at least comprises memory resource occupancy rate and CPU resource occupancy rate.
This document also discloses a virtual machine Central Processing Unit (CPU) binding apparatus, comprising:
the binding unit is used for binding the virtual machine with the memory resource occupancy rate reaching or exceeding a first set threshold value with the physical CPU cached in the shared L2 according to a first binding strategy;
a storage unit, configured to store the first binding policy, where the first binding policy includes the following conditions:
and binding the virtual machines with the memory resource occupancy rates reaching or exceeding the first set threshold value on the physical CPUs sharing the cache of the L2, and only running one virtual machine with the memory resource occupancy rate reaching or exceeding the first set threshold value on the bound physical CPU.
Optionally, in the foregoing apparatus, the binding unit binds, according to a second binding policy, the virtual machine whose CPU resource occupancy rate reaches or exceeds a second set threshold, with the physical CPU that shares the cache of L2;
the storage unit stores the second binding policy, and the second binding policy includes the following conditions:
binding the virtual machine with the CPU resource occupancy rate reaching or exceeding a second set threshold value on the physical CPU sharing the L2 cache
Optionally, in the foregoing apparatus, the second binding policy further includes:
and binding the virtual machine with the CPU resource occupancy rate reaching or exceeding a second set threshold value on the physical CPU cached by the shared L2 with lower CPU resource utilization rate.
Optionally, the apparatus further comprises:
and the monitoring unit is used for monitoring the resource use condition of each virtual machine of the host, wherein the resource use condition at least comprises the memory resource occupancy rate and the CPU resource occupancy rate.
According to the technical scheme, whether the physical CPU shares the L2 cache or not is combined with the binding of the virtual machine CPU to manage the virtual machine, namely the CPU binding scheme is realized based on the technology of sharing the L2 cache, the most original strategy that the user determines the binding relation of the CPU is abandoned, the problem of performance reduction caused by memory competition is effectively solved, the binding strategy of the memory-intensive virtual machine and the CPU-intensive virtual machine is reasonably formulated, and the performance of the virtual machine is improved.
Drawings
FIG. 1 is a flow chart of virtual machine CPU binding based on physical host CPU sharing L2 cache according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the technical solutions of the present invention will be further described in detail with reference to the accompanying drawings. It should be noted that the embodiments and features of the embodiments of the present application may be arbitrarily combined with each other without conflict.
The inventor of the present application proposes that the performance of the virtual machine may be managed according to the binding of the virtual machine CPUs and whether each CPU of the physical machine shares the L2 cache, that is, for the virtual machine with a higher memory load, the virtual machine needs to be bound to the physical CPU sharing the L2 cache to improve the performance, and if there are other virtual machine CPUs with a high memory load also bound to these physical CPUs, the performance of the virtual machine is greatly reduced, so that the physical CPU sharing the L2 cache cannot run multiple virtual machines with a high memory load at the same time. In addition, since the performance of one virtual machine with a higher CPU load and one virtual machine with a higher memory load are bound to the physical CPU sharing the L2 cache without causing the performance degradation of the two virtual machines, the virtual machine with the higher CPU load and the virtual machine with the higher memory load can be bound to the physical CPU sharing the L2 cache.
Based on the above thought, this embodiment provides a virtual machine CPU binding method based on the physical host CPU sharing L2 cache, and the specific implementation process is as shown in fig. 1, and includes the following steps:
step 100: monitoring the use conditions of the memory and the CPU of each virtual machine of the host;
in this step, the usage of other resources of the host, that is, the occupancy of other resources affecting the binding policy, may also be monitored.
Step 200: and binding the virtual machine with high memory resource occupancy rate (namely the memory resource occupancy rate reaches or exceeds a first set threshold) and the virtual machine with high CPU resource occupancy rate (namely the CPU resource occupancy rate reaches or exceeds a second set threshold) with the physical CPU according to a preset binding strategy.
In this step, the first binding policy corresponding to the virtual machine with high memory resource occupancy rate includes the following conditions:
1. binding the virtual machine with higher memory load on the physical CPU sharing the L2 cache:
for example, virtual machine a has 8 vcpus, CPU nos. 0-7 on the physical machine share L2 cache, and CPU nos. 8-15 share L2 cache, and if the memory load of virtual machine a is higher at this time, 8 vcpus of virtual machine a are bound on physical CPU nos. 0-7 or 8-15 to improve performance.
2. Multiple virtual machines with high memory load cannot be bound to the same physical CPU sharing the L2 cache at the same time:
for example, the virtual machine B has 8 vcpus, and if the memory load of the virtual machine a is high and the virtual machine a is already bound to physical CPUs nos. 0 to 7, the virtual machine B can only be bound to physical CPUs nos. 8 to 15 in order to ensure the performance, otherwise, the performance is greatly reduced.
The binding policy is followed, that is, the virtual machine with high memory resource occupancy rate is bound to the physical CPU sharing the cache of L2, and only one virtual machine with high memory resource occupancy rate can be operated on the bound physical CPU;
the second binding policy corresponding to the virtual machine with high CPU resource occupancy includes the following conditions:
the virtual machine with higher CPU load is bound to the physical CPU sharing the L2 cache, wherein the virtual machine with higher CPU load and the virtual machine with higher memory load can be bound to the same physical CPU sharing the L2 cache at the same time:
for example, the virtual machine C has 8 CPUs, and the CPU load is high, at this time, the 8 CPUs of the virtual machine C can be bound to any 8 CPUs of CPUs 0 to 15 on the physical host, and the performance of the virtual machine a and the virtual machine B is not affected.
It should be noted that, it may also be determined which virtual machines on 16 CPUs of the physical host have lower CPU occupancy rates, and the virtual machines are bound to the physical CPUs with lower CPU occupancy rates as much as possible, so as to ensure that no CPU resource contention occurs. That is, the second binding policy may further include binding the virtual machine with the high CPU resource occupancy rate to the physical CPU with the low CPU resource utilization rate, so as to balance resource usage of each physical CPU.
In addition, for the virtual machine whose memory resource occupancy rate does not reach the first set threshold value and the virtual machine whose CPU resource occupancy rate does not reach the second set threshold value, the physical CPU may be bound in other manners according to the existing manner, which is not particularly limited in this embodiment.
The embodiment also provides a virtual machine Central Processing Unit (CPU) binding device, which can realize the binding method. The device mainly comprises a binding unit and a storage unit.
The binding unit is used for binding the virtual machine with high memory resource occupancy rate (namely the memory resource occupancy rate reaches or exceeds a first set threshold) with the physical CPU cached by the shared L2 according to a first binding strategy;
the unit can also bind the virtual machine with high CPU resource occupancy rate (namely, the CPU resource occupancy rate reaches or exceeds a second set threshold value) with the physical CPU sharing the cache of the L2 according to a second binding strategy
A storage unit storing a binding policy, wherein the first binding policy includes the following conditions:
and binding the virtual machine with high memory resource occupancy rate on the physical CPU sharing the cache of the L2, and only operating one virtual machine with high memory resource occupancy rate on the bound physical CPU.
The second binding policy mainly includes the following conditions:
binding virtual machines with high CPU resource occupancy rate on physical CPUs sharing L2 cache
It should be noted that, for the virtual machine with high CPU resource occupancy, the CPU usage of the physical machine is also considered, that is, the second binding policy further includes:
and binding the virtual machine with high CPU resource occupancy rate on the physical CPU of the shared L2 cache with lower CPU resource utilization rate.
In practical application, the apparatus may further include a monitoring unit, which is mainly configured to monitor resource usage of each virtual machine of the host, where the resource usage at least includes memory resource occupancy rate and CPU resource occupancy rate.
According to the technical scheme, different virtual machine CPU binding strategies are scientifically formulated according to the real-time monitoring data of the virtual machine, and performance reduction caused by blind binding of a user is avoided; the corresponding binding strategy is formulated by combining different use requirements of the memory-intensive virtual machine and the CPU-intensive virtual machine on the physical CPU shared L2 cache, so that the performance reduction of the virtual machine due to resource competition is avoided, and the certain performance can be improved by binding the memory-intensive virtual machine on the physical CPU sharing the L2 cache.
It will be understood by those skilled in the art that all or part of the steps of the above methods may be implemented by instructing the relevant hardware through a program, and the program may be stored in a computer readable storage medium, such as a read-only memory, a magnetic or optical disk, and the like. Alternatively, all or part of the steps of the above embodiments may be implemented using one or more integrated circuits. Accordingly, each module/unit in the above embodiments may be implemented in the form of hardware, and may also be implemented in the form of a software functional module. The present application is not limited to any specific form of hardware or software combination.
The above description is only a preferred example of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (6)

1. A CPU binding method of a virtual machine Central Processing Unit (CPU), comprising the following steps:
binding a virtual machine with a memory resource occupancy rate reaching or exceeding a first set threshold value with a physical CPU (central processing unit) of a shared L2 cache according to a first binding policy, wherein the first binding policy comprises the following conditions:
binding the virtual machines with the memory resource occupancy rates reaching or exceeding a first set threshold value on the physical CPUs sharing the cache of the L2, and only running one virtual machine with the memory resource occupancy rate reaching or exceeding the first set threshold value on the bound physical CPU,
binding the virtual machine with the CPU resource occupancy rate reaching or exceeding a second set threshold value with the physical CPU cached in the shared L2 according to a second binding policy, wherein the second binding policy comprises the following conditions:
the virtual machines with the CPU resource occupancy rate reaching or exceeding the second set threshold are bound on the physical CPUs sharing the L2 cache,
the virtual machine with the CPU resource occupancy rate reaching or exceeding the second set threshold and the virtual machine with the memory resource occupancy rate reaching or exceeding the first set threshold may be bound to the same physical CPU sharing the L2 cache.
2. The method of claim 1, wherein the second binding policy further comprises:
and binding the virtual machine with the CPU resource occupancy rate reaching or exceeding a second set threshold value on the physical CPU cached by the shared L2 with lower CPU resource utilization rate.
3. The method as claimed in any one of claims 1 to 2, wherein before binding the virtual machine whose memory resource occupancy rate meets or exceeds the first set threshold with the physical CPU sharing the L2 cache according to the first binding policy, the method further comprises:
and monitoring the resource use condition of each virtual machine of the host, wherein the resource use condition at least comprises memory resource occupancy rate and CPU resource occupancy rate.
4. A virtual machine Central Processing Unit (CPU) binding apparatus, comprising:
the binding unit is used for binding the virtual machine with the memory resource occupancy rate reaching or exceeding a first set threshold value with the physical CPU cached in the shared L2 according to a first binding strategy; binding the virtual machine with the CPU resource occupancy rate reaching or exceeding a second set threshold value with the physical CPU cached in the shared L2 according to a second binding strategy, wherein the virtual machine with the CPU resource occupancy rate reaching or exceeding the second set threshold value and the virtual machine with the memory resource occupancy rate reaching or exceeding the first set threshold value can be simultaneously bound with the physical CPU cached in the shared L2;
a storage unit that stores the first binding policy and the second binding policy,
the first binding policy includes the following conditions:
binding the virtual machines with the memory resource occupancy rates reaching or exceeding a first set threshold value on the physical CPUs sharing the cache of the L2, and only running one virtual machine with the memory resource occupancy rate reaching or exceeding the first set threshold value on the bound physical CPU,
the second binding policy includes the following conditions:
and binding the virtual machine with the CPU resource occupancy rate reaching or exceeding a second set threshold value on the physical CPU sharing the L2 cache.
5. The apparatus of claim 4, wherein the second binding policy further comprises:
and binding the virtual machine with the CPU resource occupancy rate reaching or exceeding a second set threshold value on the physical CPU cached by the shared L2 with lower CPU resource utilization rate.
6. The apparatus of any of claims 4 to 5, further comprising:
and the monitoring unit is used for monitoring the resource use condition of each virtual machine of the host, wherein the resource use condition at least comprises the memory resource occupancy rate and the CPU resource occupancy rate.
CN201710592879.7A 2017-07-19 2017-07-19 Virtual machine Central Processing Unit (CPU) binding method and device Active CN107273188B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710592879.7A CN107273188B (en) 2017-07-19 2017-07-19 Virtual machine Central Processing Unit (CPU) binding method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710592879.7A CN107273188B (en) 2017-07-19 2017-07-19 Virtual machine Central Processing Unit (CPU) binding method and device

Publications (2)

Publication Number Publication Date
CN107273188A CN107273188A (en) 2017-10-20
CN107273188B true CN107273188B (en) 2020-08-18

Family

ID=60077823

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710592879.7A Active CN107273188B (en) 2017-07-19 2017-07-19 Virtual machine Central Processing Unit (CPU) binding method and device

Country Status (1)

Country Link
CN (1) CN107273188B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110442423B (en) * 2019-07-09 2022-04-26 苏州浪潮智能科技有限公司 Method and equipment for realizing CPU reservation of virtual machine by using control group

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101788920A (en) * 2010-02-05 2010-07-28 北京航空航天大学 CPU virtualization method based on processor partitioning technology
CN103268297A (en) * 2013-05-20 2013-08-28 浙江大学 Accelerating core virtual scratch pad memory method based on heterogeneous multi-core platform
CN103403689A (en) * 2012-07-30 2013-11-20 华为技术有限公司 Resource failure management method, device and system
CN106383747A (en) * 2016-08-31 2017-02-08 华为技术有限公司 Method and device for scheduling computing resources

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101788920A (en) * 2010-02-05 2010-07-28 北京航空航天大学 CPU virtualization method based on processor partitioning technology
CN103403689A (en) * 2012-07-30 2013-11-20 华为技术有限公司 Resource failure management method, device and system
CN103268297A (en) * 2013-05-20 2013-08-28 浙江大学 Accelerating core virtual scratch pad memory method based on heterogeneous multi-core platform
CN106383747A (en) * 2016-08-31 2017-02-08 华为技术有限公司 Method and device for scheduling computing resources

Also Published As

Publication number Publication date
CN107273188A (en) 2017-10-20

Similar Documents

Publication Publication Date Title
US9292448B2 (en) Dynamic sizing of memory caches
US8996811B2 (en) Scheduler, multi-core processor system, and scheduling method
US20160306680A1 (en) Thread creation method, service request processing method, and related device
US10248175B2 (en) Off-line affinity-aware parallel zeroing of memory in non-uniform memory access (NUMA) servers
US9858120B2 (en) Modifying memory space allocation for inactive tasks
US20130219404A1 (en) Computer System and Working Method Thereof
CN108459913B (en) Data parallel processing method and device and server
CN110119304B (en) Interrupt processing method and device and server
US8954969B2 (en) File system object node management
US11940915B2 (en) Cache allocation method and device, storage medium, and electronic device
US8458719B2 (en) Storage management in a data processing system
US20130061009A1 (en) High Performance Free Buffer Allocation and Deallocation
US20200272526A1 (en) Methods and systems for automated scaling of computing clusters
US20180336034A1 (en) Near memory computing architecture
US20160364145A1 (en) System and Method for Managing a Non-Volatile Storage Resource as a Shared Resource in a Distributed System
US9189405B2 (en) Placement of data in shards on a storage device
CN107273188B (en) Virtual machine Central Processing Unit (CPU) binding method and device
KR101198400B1 (en) Memory management apparatus and method
EP3188026B1 (en) Memory resource management method and apparatus
US9858204B2 (en) Cache device, cache system, and cache method
US20090320036A1 (en) File System Object Node Management
US11016685B2 (en) Method and defragmentation module for defragmenting resources
EP3962031A1 (en) System, apparatus and method for advanced monitoring in an edge system
US20120137082A1 (en) Global and local counts for efficient memory page pinning in a multiprocessor system
CN117873694A (en) Heap space allocation method, heap space allocation device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20200623

Address after: 215100 No. 1 Guanpu Road, Guoxiang Street, Wuzhong Economic Development Zone, Suzhou City, Jiangsu Province

Applicant after: SUZHOU LANGCHAO INTELLIGENT TECHNOLOGY Co.,Ltd.

Address before: 450018 Henan province Zheng Dong New District of Zhengzhou City Xinyi Road No. 278 16 floor room 1601

Applicant before: ZHENGZHOU YUNHAI INFORMATION TECHNOLOGY Co.,Ltd.

GR01 Patent grant
GR01 Patent grant