CN111258706A - Virtual machine system, control method thereof and electronic device - Google Patents

Virtual machine system, control method thereof and electronic device Download PDF

Info

Publication number
CN111258706A
CN111258706A CN201811457003.2A CN201811457003A CN111258706A CN 111258706 A CN111258706 A CN 111258706A CN 201811457003 A CN201811457003 A CN 201811457003A CN 111258706 A CN111258706 A CN 111258706A
Authority
CN
China
Prior art keywords
disk
virtual machine
cache
dynamically
schedulable
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201811457003.2A
Other languages
Chinese (zh)
Other versions
CN111258706B (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.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201811457003.2A priority Critical patent/CN111258706B/en
Publication of CN111258706A publication Critical patent/CN111258706A/en
Application granted granted Critical
Publication of CN111258706B publication Critical patent/CN111258706B/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
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/061Improving I/O performance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0646Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
    • 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
    • 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/45579I/O management, e.g. providing access to device drivers or storage
    • 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/45583Memory management, e.g. access or allocation
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

The embodiment of the invention provides a virtual machine system, a control method thereof and electronic equipment. The system comprises: a virtualization simulator and at least one virtual machine created by the virtualization simulator, the virtualization simulator comprising: and the cache device is independent of the kernel cache and is used for providing cache support for the disk of the virtual machine. According to the embodiment of the invention, the cache device independent of the kernel cache is used as the disk cache of the virtual machine, and the cache is converted from the kernel mode to the user mode, so that the disk cache is easy to maintain and update, the IO path is shortened, and the read-write performance of the hard disk is improved.

Description

Virtual machine system, control method thereof and electronic device
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a virtual machine system, a control method thereof, and an electronic device.
Background
In the field of computer technology, when the speed difference between two storage media is large and data transmission is required, a Cache (Cache) is usually arranged between the two storage media for storing part of data which is just used or recycled so as to coordinate the difference of the data transmission speed between the two storage media. If the hit rate of the Cache is higher, the read-write performance of the storage medium can be greatly improved.
In a virtualization scenario, virtualization of resources is typically achieved by emulating a controller (e.g., QEMU for emulating a processor). In the prior art, QEMU uses the kernel Cache of the physical machine as a disk Cache.
In the process of implementing the invention, the inventor finds that the prior art has at least the following problems: due to the complexity of the kernel module, the disk cache is difficult to maintain and update.
Disclosure of Invention
The embodiment of the invention provides a virtual machine system, a control method thereof and electronic equipment, aiming at solving the defects that in the prior art, the inner core cache of a physical machine is adopted as a disk cache, so that the disk cache is difficult to maintain and update.
To achieve the above object, an embodiment of the present invention provides a virtual machine system, including: a virtualization simulator and at least one virtual machine created by the virtualization simulator, the virtualization simulator comprising: and the cache device is independent of the kernel cache and is used for providing cache support for the disk of the virtual machine.
The embodiment of the invention also provides a control method of a virtual machine system, wherein the virtual machine system comprises at least one virtual machine and a cache device independent of the kernel cache, the cache device consists of a fixed cache unit and a dynamically-scheduled cache unit, and the method comprises the following steps:
allocating the fixed cache unit to the virtual machine;
acquiring disk information in the virtual machine;
and according to the disk information, performing dynamic scheduling operation on the dynamically-schedulable cache unit.
An embodiment of the present invention further provides an electronic device, including:
a memory for storing a program;
a processor for executing the program stored in the memory for:
allocating a fixed cache unit to a virtual machine in a virtual machine system;
acquiring disk information in the virtual machine;
and according to the disk information, performing dynamic scheduling operation on the dynamically-schedulable cache unit, wherein the fixed cache unit and the dynamically-schedulable cache unit form a cache device independent of the kernel cache.
According to the virtual machine system, the control method and the electronic device provided by the embodiment of the invention, the cache device independent of the kernel cache is adopted as the disk cache of the virtual machine, and the cache is converted from the kernel mode to the user mode, so that the disk cache is easy to maintain and update, the IO path is shortened, and the read-write performance of the hard disk is improved.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the application. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
FIG. 1 is a system block diagram of one embodiment of a virtual machine system provided by the present invention;
FIG. 2 is a system diagram of another embodiment of a virtual machine system provided by the present invention;
fig. 3 is a flowchart of an embodiment of a control method for a virtual machine system according to the present invention;
fig. 4 is a flowchart of another embodiment of a control method of a virtual machine system according to the present invention;
fig. 5 is a schematic structural diagram of an embodiment of an electronic device provided in the present invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
In existing virtualization scenarios, virtualization of resources is typically achieved through a virtualization simulator (e.g., QEMU for simulating a processor). Whereas in the prior art, QEMU employs the kernel Cache (Cache) of a physical machine as a disk Cache. Due to the complexity of the kernel module, the disk memory is difficult to maintain and update. Therefore, aiming at the defects of the prior art, the present application provides a solution for a virtual machine system, and the main principle is as follows: the cache device independent of the kernel cache is used as the disk cache of the virtual machine, the kernel state of the cache is converted into the user state, the disk cache is easy to maintain and update, the IO path is shortened, and the read-write performance of the hard disk can be improved. Meanwhile, in the prior art, since the cache data is transmitted to the backend storage medium through the physical machine kernel, it is impossible to distinguish whether the backend storage is a virtualized disk or a physical disk of a local process, and therefore, optimization cannot be performed for the virtual disk. In the virtual machine system provided by the application, the cache device independent of the kernel cache is used as the disk cache of the virtual machine, so that the virtualized disk cache can be optimized, the user behavior is predicted by counting the relevant data of the disk, the size of the cache area is dynamically adjusted, the utilization rate of the cache device is greatly improved, and the user obtains higher performance improvement.
The above embodiments are illustrations of technical principles of the embodiments of the present invention, and specific technical solutions of the embodiments of the present invention are further described in detail below by using a plurality of embodiments.
Example one
Fig. 1 is a system block diagram of an embodiment of a virtual machine system provided by the present invention, and the structure shown in fig. 1 is only one example of a business system to which the technical solution of the present invention can be applied. As shown in fig. 1, the virtual machine system includes: a virtualization simulator 11 and at least one virtual machine 12.
At least one virtual machine (only one is shown in the figure) 12 is created by the virtualization simulator 11, and the virtualization simulator 11 includes: a cache device 111 independent of the kernel cache, the cache device 111 being configured to provide caching support to the disk 121 of the virtual machine 12.
The virtual machine system provided by the embodiment of the present invention may be used to execute the processing flows shown in fig. 3 and fig. 4. The virtual machine system can be applied to data caching in a virtualization scene. In the virtual machine system, the cache device 111 is arranged on the virtualization simulator (e.g., QEMU)11, so that the adoption of a kernel cache as a cache of the hard disk 121 in the virtual machine 12 is avoided, and the defects caused by the use of a kernel module can be avoided.
According to the virtual machine system provided by the embodiment of the invention, the cache device independent of the kernel cache is used as the disk cache of the virtual machine, and the cache is converted from the kernel mode to the user mode, so that the disk cache is easy to maintain and update, the IO path is shortened, and the read-write performance of the hard disk is improved.
Example two
Fig. 2 is a system block diagram of another embodiment of a virtual machine system provided in the present invention. As shown in fig. 2, in the virtual machine system provided in the embodiment of the present invention, the cache device 111 is composed of a fixed cache unit 111a and a dynamically schedulable cache unit 111b, where the fixed cache unit 111a is fixedly allocated to the virtual machine 12.
In addition, the virtualization simulator 11 may further include: the overall scheduler 112. The general scheduler 112 may be configured to perform a dynamic scheduling operation on the dynamically schedulable cache unit 111b according to the disk information in the virtual machine 12.
In the embodiment of the present invention, the overall scheduler 112 is responsible for the control of the caching device 111. During initialization, the cache device 111 may be classified into two types. One is a fixed buffer unit 111a of basic tranches and one is a dynamically schedulable buffer unit 111b of dynamically schedulable tranches. The user can divide the sizes of the two types of storage media according to the proportion selected by the user. Wherein the size of the cache molecules of each share may be the same. When the virtual machine 12 creates the disks 121, a plurality of basic shares of the fixed cache units 111a may be allocated to each disk 121 according to requirements, and the larger the number is, the larger the performance acceleration that can be obtained finally is.
In addition, in the virtual machine system provided in the present invention, the virtual machine 12 may include: an information collection module 122 and a scheduling module 123.
The information acquisition module 122 may be configured to acquire disk information of each disk 121, where; the scheduling module 123 may be configured to calculate a load weight of each disk 121 according to the disk information acquired by the information acquisition module 122 and a preset cache policy.
In the embodiment of the present invention, the disk information may include: read IOPS information (RIOPS), write IOPS information (WIOPS), read bandwidth information (RBW), and write bandwidth information (WBW).
For example, the load weight (W) of each disk 121 may be calculated using the following equation (1):
W=RIOPS*A1+WIOPS*A2+RBW*A3+WBW*A4…………………(1)
wherein, A1, A2, A3 and A4 are the proportions of the information and need to satisfy the condition that A1+ A2+ A3+ A4 is 1. In the embodiment of the present invention, different duty ratios may be set according to different caching policies, for example, if the caching policy is a write through policy (WT), the RIOPS duty ratio a1 may be set to be larger; for Write Back policy (Write Back; WB), the a2 value may be increased to increase Write performance. Typically, the values of a1, a2 are greater than the values of A3, a 4. The user can also configure different A1, A2, A3 and A4 values according to actual situations.
In this embodiment of the present invention, the total scheduler 112 may be specifically configured to, when there is a first type of disk (i.e., a disk with a load weight higher than a first preset weight threshold), allocate the dynamically schedulable cache unit 111b to the virtual machine 12, where for each disk in the first type of disk, the allocation amount is a product of an increase rate of the load weight of the disk relative to the first preset weight threshold and an initial share. That is, the allocation amount (a) per disk can be calculated according to the following formula (2):
A=((W-W1)/W)*a………………………………………………..(2)
wherein W is the load weight of the disk, W1 is a first preset weight threshold, and a is the initial allocated cache share to the disk.
At this time, the scheduling module 123 in the virtual machine 12 may be further configured to allocate the dynamically schedulable buffer unit 111b, which is allocated to the virtual machine 12 by the overall scheduler 112, to each disk in the first class of disks according to the load weight of each disk in the first class of disks. The scheduling module 123 may update cache metadata and the like, expand the available space of the cache disk, and use the newly added space according to the corresponding cache policy.
In addition, the total scheduler 112 may be further configured to, when there is a second type of disk (i.e., a disk whose load weight is lower than a second preset weight threshold), send an instruction to remove the allocated dynamically-schedulable cache unit 111b to the virtual machine 12, where for each disk in the second type of disk, the removal amount is a product of a reduction rate of the load weight of the disk relative to the second preset weight threshold and the initial share. That is, the removal amount (B) of each disk can be calculated according to the following formula (3):
B=((W2-W)/W)*a………………………………………………..(3)
wherein W is the load weight of the disk, W2 is a second preset weight threshold, and a is the initial allocated cache share to the disk.
At this time, the scheduling module 123 in the virtual machine 12 may be further configured to remove the dynamically schedulable buffer unit 111b that has been allocated to each disk in the second class of disks according to the removal indication of the overall scheduler 112.
Further, in the embodiment of the present invention, the scheduling module 123 may calculate the load weight of each disk 121 according to the first preset time interval T1, and send the load weight to the overall scheduler 112; the general scheduler 112 may perform a dynamic scheduling operation on the dynamically schedulable buffer unit 111b according to a second preset time interval T2; preferably, the second predetermined time interval T2 should be greater than the first predetermined time interval T1, so as to implement dynamic scheduling of the dynamically schedulable buffer unit 111 b.
In addition, in the virtual machine system provided in the embodiment of the present invention, the total scheduler 112 may be further configured to, when the number (share) of the currently available dynamically schedulable cache units 111b is lower than the cache demand of the virtual machine 12, send an indication to remove the allocated dynamically schedulable cache units 111b to the virtual machine 12, so that the number of the currently available dynamically schedulable cache units 111b is not lower than the cache demand of the virtual machine 12; the scheduling module 123 may be configured to sequentially remove the dynamically schedulable buffer units 111b that have been allocated to each disk 121 according to the removal indication of the overall scheduler 112 and the order of the load weight of each disk 121 from low to high.
In the embodiment of the present invention, after receiving the removal instruction, the scheduling module 123 completes information storage of the corresponding disk space according to the cache policy, and then updates the meta information, so that the space is not used any more. After the operation of removing the dynamically schedulable buffer unit 111b is completed, the allocation is performed according to the condition that the dynamically schedulable buffer unit 111b is sufficient.
In the case that the number of currently available dynamically schedulable buffer units 111b is lower than the buffer demand of the virtual machine 12, the total allocation amount of the dynamically schedulable buffer units 111b allocated to the virtual machine 12 is the number of currently available dynamically schedulable buffer units 111 b. That is, if the number (share) of the currently available dynamically schedulable cache units 111b after removal is lower than the cache demand of the virtual machine 12, the schedulable shares are allocated proportionally. For N disks in the first class of disks (i.e., disks with load weights higher than a first preset weight threshold), the required allocation amounts of each disk are: WA1, WA2, …, WAN; the J-th disk can be allocated the amount of (WAJ/(WA1+ WA2+ … + WAN)). TATOL, where TOTAL is the number of dynamically schedulable storage units 111b currently available.
According to the virtual machine system provided by the embodiment of the invention, the cache device independent of the kernel cache is used as the disk cache of the virtual machine, and the cache is converted from the kernel state to the user state, so that the disk cache is easy to maintain and update, the IO path is shortened, and the read-write performance of the hard disk is improved; meanwhile, the method can optimize the virtualized disk cache, predict the user behavior by counting the relevant data of the disk, dynamically adjust the size of the cache area, greatly improve the utilization rate of the cache equipment and enable the user to obtain higher performance improvement.
EXAMPLE III
Fig. 3 is a flowchart of an embodiment of a method for controlling a virtual machine system according to the present invention, and an execution subject of the method may be the virtual machine system. The virtual machine system comprises at least one virtual machine and a cache device independent of kernel cache, wherein the cache device consists of a fixed cache unit and a dynamically-scheduled cache unit. As shown in fig. 3, the control method of the virtual machine system includes the following steps:
s301, a fixed cache unit is allocated to the virtual machine.
In the embodiment of the present invention, during the initialization process, the cache devices may be divided into two types. One is a fixed buffer unit of basic share, and the other is a dynamically schedulable buffer unit of dynamically schedulable share. The user can divide the sizes of the two types of storage media according to the proportion selected by the user. Wherein the size of the cache molecules of each share may be the same. When the virtual machine creates the disk, a plurality of fixed cache units of basic shares can be allocated to each disk according to requirements, and the larger the number is, the larger the performance acceleration which can be finally obtained is.
S302, acquiring the disk information in the virtual machine.
S303, according to the disk information, the dynamic scheduling operation is carried out on the dynamically-schedulable cache unit.
In the embodiment of the invention, the cache resources can be dynamically scheduled according to the real-time performance data of each disk in the virtual machine, the disk performance of the virtual machine with large partial load can be improved, the throughout of the whole machine is increased, and the utilization rate of equipment is improved.
According to the control method of the virtual machine system, the cache device independent of the kernel cache is used as the disk cache of the virtual machine, the kernel mode of the cache is converted into the user mode, the disk cache is easy to maintain and update, the IO path is shortened, and the read-write performance of a hard disk is improved; meanwhile, the method can optimize the virtualized disk cache, predict the user behavior by counting the relevant data of the disk, dynamically adjust the size of the cache area, greatly improve the utilization rate of the cache equipment and enable the user to obtain higher performance improvement.
Example four
Fig. 4 is a flowchart of another embodiment of a control method of a virtual machine system according to the present invention. As shown in fig. 4, on the basis of the embodiment shown in fig. 3, the method for controlling a virtual machine system provided in this embodiment may further include the following steps:
s401, a fixed cache unit is allocated to the virtual machine.
S402, acquiring the disk information in the virtual machine.
In the embodiment of the present invention, steps S401 and S402 are the same as steps S301 and S302 in the embodiment shown in fig. 3, and are not repeated herein.
In addition, in the embodiment of the present invention, the disk information in the virtual machine may be obtained according to the first preset time interval T1, and the dynamically schedulable cache unit may be dynamically scheduled according to the disk information and the second preset time interval T2, and preferably, the second preset time interval T2 should be greater than the first preset time interval T1, so as to implement the dynamic scheduling for the dynamically schedulable cache unit. The specific scheduling process is shown as the following steps:
and S403, calculating the load weight of each disk according to the disk information.
In the embodiment of the present invention, the disk information may include: read IOPS information (RIOPS), write IOPS information (WIOPS), read bandwidth information (RBW), and write bandwidth information (WBW).
For example, the load weight (W) of each disk 121 may be calculated using the following equation (1):
W=RIOPS*A1+WIOPS*A2+RBW*A3+WBW*A4…………………(1)
wherein, A1, A2, A3 and A4 are the proportions of the information and need to satisfy the condition that A1+ A2+ A3+ A4 is 1. In the embodiment of the present invention, different duty ratios may be set according to different caching policies, for example, if the caching policy is a write through policy (WT), the RIOPS duty ratio a1 may be set to be larger; for Write Back policy (Write Back; WB), the a2 value may be increased to increase Write performance. Typically, the values of a1, a2 are greater than the values of A3, a 4. The user can also configure different A1, A2, A3 and A4 values according to actual situations.
S404, when the first type of disk exists, a dynamically-schedulable cache unit is allocated to each disk according to the load weight of each disk in the first type of disk.
In the embodiment of the present invention, for each disk in the first class of disks (i.e., the disk whose load weight is higher than the first preset weight threshold), the allocation amount is the product of the initial share and the increase rate of the load weight of the disk relative to the first preset weight threshold. That is, the allocation amount (a) per disk can be calculated according to the following formula (2):
A=((W-W1)/W)*a………………………………………………..(2)
wherein W is the load weight of the disk, W1 is a first preset weight threshold, and a is the initial allocated cache share to the disk.
S405, when the second type of disk exists, removing the dynamically-schedulable cache units which are allocated to each disk in the second type of disk.
In the embodiment of the present invention, for each disk in the second class of disks (i.e., the disk whose load weight is lower than the second preset weight threshold), the removal amount is the product of the initial share and the reduction rate of the load weight of the disk relative to the second preset weight threshold. That is, the removal amount (B) of each disk can be calculated according to the following formula (3):
B=((W2-W)/W)*a………………………………………………..(3)
wherein W is the load weight of the disk, W2 is a second preset weight threshold, and a is the initial allocated cache share to the disk.
S406, when the number of the currently available dynamically schedulable cache units is lower than the cache demand of the virtual machine, the dynamically schedulable cache units that have been allocated to the disk are sequentially removed in the order from low to high according to the load weight of each disk, so that the number of the currently available dynamically schedulable cache units is not lower than the cache demand of the virtual machine.
In the embodiment of the invention, after the removal instruction is received, the information storage of the corresponding disk space can be completed according to the cache strategy, and then the meta information is updated, so that the space is not used any more. And after the operation of removing the dynamically-schedulable cache unit is completed, allocating the dynamically-schedulable cache unit according to the condition that the dynamically-schedulable cache unit is sufficient.
And when the number of the currently available dynamically-schedulable cache units is lower than the cache demand of the virtual machine, allocating the total allocation amount of the dynamically-schedulable cache units to the virtual machine as the number of the currently available dynamically-schedulable cache units. That is, if the number (share) of the currently available dynamically schedulable cache units 111b after removal is lower than the cache demand of the virtual machine 12, the schedulable shares are allocated proportionally. For N disks in the first class of disks (i.e., disks with load weights higher than a first preset weight threshold), the required allocation amounts of each disk are: WA1, WA2, …, WAN; the J-th disk can be allocated the amount of (WAJ/(WA1+ WA2+ … + WAN)). TATOL, where TOTAL is the number of dynamically schedulable storage units 111b currently available.
According to the control method of the virtual machine system, the cache device independent of the kernel cache is used as the disk cache of the virtual machine, the kernel mode of the cache is converted into the user mode, the disk cache is easy to maintain and update, the IO path is shortened, and the read-write performance of a hard disk is improved; meanwhile, the method can optimize the virtualized disk cache, predict the user behavior by counting the relevant data of the disk, dynamically adjust the size of the cache area, greatly improve the utilization rate of the cache equipment and enable the user to obtain higher performance improvement.
EXAMPLE five
The internal functions and structure of the virtual machine system, which can be implemented as an electronic device, are described above. Fig. 5 is a schematic structural diagram of an embodiment of an electronic device provided in the present invention. As shown in fig. 5, the electronic device includes a memory 51 and a processor 52.
The memory 51 stores programs. In addition to the above-described programs, the memory 51 may also be configured to store other various data to support operations on the electronic device. Examples of such data include instructions for any application or method operating on the electronic device, contact data, phonebook data, messages, pictures, videos, and so forth.
The memory 51 may be implemented by any type or combination of volatile or non-volatile memory devices, such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
A processor 52, coupled to the memory 51, for executing programs stored in the memory 51 for:
allocating a fixed cache unit to a virtual machine in a virtual machine system;
acquiring disk information in a virtual machine;
and according to the disk information, performing dynamic scheduling operation on the dynamically-schedulable cache unit, wherein the fixed cache unit and the dynamically-schedulable cache unit form a cache device independent of the kernel cache.
Further, as shown in fig. 5, the electronic device may further include: communication components 53, power components 54, audio components 55, display 56, and other components. Only some of the components are schematically shown in fig. 5, and it is not meant that the electronic device comprises only the components shown in fig. 5.
The communication component 53 is configured to facilitate wired or wireless communication between the electronic device and other devices. The electronic device may access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 53 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 53 further comprises a Near Field Communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
A power supply component 54 provides power to the various components of the electronic device. The power components 54 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for an electronic device.
The audio component 55 is configured to output and/or input audio signals. For example, the audio component 55 includes a Microphone (MIC) configured to receive external audio signals when the electronic device is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal may further be stored in the memory 51 or transmitted via the communication component 53. In some embodiments, audio assembly 55 also includes a speaker for outputting audio signals.
The display 56 includes a screen, which may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.

Claims (13)

1. A virtual machine system, comprising: a virtualization simulator and at least one virtual machine created by the virtualization simulator, the virtualization simulator comprising: and the cache device is independent of the kernel cache and is used for providing cache support for the disk of the virtual machine.
2. The virtual machine system according to claim 1, wherein the cache device is composed of a fixed cache unit and a dynamically schedulable cache unit, the fixed cache unit being fixedly allocated to the virtual machine,
the virtualization simulator further comprises:
and the master scheduler is used for implementing dynamic scheduling operation on the dynamically-schedulable cache unit according to the disk information in the virtual machine.
3. The virtual machine system according to claim 2,
the virtual machine includes:
the information acquisition module is used for acquiring the disk information of each disk, and the disk information comprises: reading IOPS information, writing IOPS information, reading bandwidth information and writing bandwidth information;
the scheduling module is used for calculating the load weight of each disk according to the disk information acquired by the information acquisition module and a preset cache strategy;
the total scheduler is specifically configured to, when a first-class disk exists, allocate the dynamically schedulable cache unit to the virtual machine, where, for each disk in the first-class disk, an allocation amount is a product of an increase rate of a load weight of the disk relative to a first preset weight threshold and an initial share, the first-class disk is a disk whose load weight is higher than the first preset weight threshold, and the initial share is a cache share initially allocated to the disk;
the scheduling module is further configured to allocate the dynamically-schedulable cache unit, which is allocated to the virtual machine by the master scheduler, to each disk in the first class of disks according to the load weight of each disk in the first class of disks.
4. The virtual machine system according to claim 3,
the master scheduler is further configured to send, to the virtual machine, an instruction to remove the allocated dynamically-schedulable cache unit when a second type of disk exists, where, for each disk in the second type of disk, a removal amount is a product of a reduction rate of a load weight of the disk relative to a second preset weight threshold and the initial share, and the second type of disk is a disk whose load weight is lower than the second preset weight threshold;
the scheduling module is further configured to remove the dynamically schedulable buffer unit that has been allocated to each disk in the second class of disks according to the removal indication of the overall scheduler.
5. The virtual machine system according to claim 3 or 4,
the scheduling module calculates the load weight of each disk according to a first preset time interval and sends the load weight to the total scheduler;
the master scheduler implements dynamic scheduling operation on the dynamically-schedulable cache unit according to a second preset time interval;
the second preset time interval is greater than the first preset time interval.
6. The virtual machine system according to claim 3,
the total scheduler is further configured to, when the number of the dynamically schedulable buffer units currently available is lower than the buffer demand of the virtual machine, send an indication to remove the allocated dynamically schedulable buffer units to the virtual machine, so that the number of the dynamically schedulable buffer units currently available is not lower than the buffer demand of the virtual machine;
the scheduling module is further configured to sequentially remove the dynamically schedulable buffer units that have been allocated to the disks according to the removal indication of the total scheduler and the order of the load weight of each disk from low to high.
7. The virtual machine system according to claim 6, wherein in a case that the number of the dynamically schedulable buffer units currently available is lower than the buffer demand of the virtual machine, the total allocation amount of the dynamically schedulable buffer units allocated to the virtual machine is the number of the dynamically schedulable buffer units currently available.
8. A control method of a virtual machine system is characterized in that the virtual machine system comprises at least one virtual machine and a cache device independent of a kernel cache, the cache device is composed of a fixed cache unit and a dynamically-scheduled cache unit, and the method comprises the following steps:
allocating the fixed cache unit to the virtual machine;
acquiring disk information in the virtual machine;
and according to the disk information, performing dynamic scheduling operation on the dynamically-schedulable cache unit.
9. The method according to claim 8, wherein said performing a dynamic scheduling operation on the dynamically schedulable cache unit according to the disk information includes:
calculating the load weight of each disk according to the disk information, wherein the disk information comprises: reading IOPS information, writing IOPS information, reading bandwidth information and writing bandwidth information;
when a first type of disk exists, allocating the dynamically-schedulable cache unit to each disk according to the load weight of each disk in the first type of disk, wherein the allocation amount is the product of the increase rate of the load weight of the disk relative to a first preset weight threshold and an initial share for each disk in the first type of disk, and the first type of disk is a disk with the load weight higher than the first preset weight threshold;
and when a second type of disk exists, removing the dynamically-scheduled cache unit which is allocated to each disk in the second type of disk, wherein for each disk in the second type of disk, the removal amount is the product of the reduction rate of the load weight of the disk relative to a second preset weight threshold and the initial share, and the second type of disk is a disk with the load weight lower than the second preset weight threshold.
10. The method of controlling a virtual machine system according to claim 8 or 9,
the acquiring the disk information in the virtual machine includes:
acquiring disk information in the virtual machine according to a first preset time interval;
the performing dynamic scheduling operation on the dynamically schedulable cache unit according to the disk information includes:
and according to the disk information, performing dynamic scheduling operation on the dynamically-schedulable cache unit according to a second preset time interval, wherein the second preset time interval is greater than the first preset time interval.
11. The method for controlling a virtual machine system according to claim 8 or 9, further comprising:
when the number of the currently available dynamically-schedulable cache units is lower than the cache demand of the virtual machine, sequentially removing the dynamically-schedulable cache units allocated to the disks according to the sequence of the load weight of each disk from low to high, so that the number of the currently available dynamically-schedulable cache units is not lower than the cache demand of the virtual machine.
12. The method according to claim 11, wherein when the number of dynamically schedulable cache units currently available is lower than the cache demand of the virtual machine, the total allocation amount of the dynamically schedulable cache units allocated to the virtual machine is the number of the dynamically schedulable cache units currently available.
13. An electronic device, comprising:
a memory for storing a program;
a processor for executing the program stored in the memory for:
allocating a fixed cache unit to a virtual machine in a virtual machine system;
acquiring disk information in the virtual machine;
and according to the disk information, performing dynamic scheduling operation on the dynamically-schedulable cache unit, wherein the fixed cache unit and the dynamically-schedulable cache unit form a cache device independent of the kernel cache.
CN201811457003.2A 2018-11-30 2018-11-30 Virtual machine system, control method thereof and electronic equipment Active CN111258706B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811457003.2A CN111258706B (en) 2018-11-30 2018-11-30 Virtual machine system, control method thereof and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811457003.2A CN111258706B (en) 2018-11-30 2018-11-30 Virtual machine system, control method thereof and electronic equipment

Publications (2)

Publication Number Publication Date
CN111258706A true CN111258706A (en) 2020-06-09
CN111258706B CN111258706B (en) 2023-05-02

Family

ID=70948288

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811457003.2A Active CN111258706B (en) 2018-11-30 2018-11-30 Virtual machine system, control method thereof and electronic equipment

Country Status (1)

Country Link
CN (1) CN111258706B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101763226A (en) * 2010-01-19 2010-06-30 北京航空航天大学 Cache method for virtual storage devices
US20120137062A1 (en) * 2010-11-30 2012-05-31 International Business Machines Corporation Leveraging coalesced memory
CN103049219A (en) * 2012-12-12 2013-04-17 华中科技大学 Virtual disk write cache system applicable to virtualization platform and operation method of write cache system
CN103218252A (en) * 2013-04-23 2013-07-24 深圳市京华科讯科技有限公司 First-level system acceleration method based on virtualization

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101763226A (en) * 2010-01-19 2010-06-30 北京航空航天大学 Cache method for virtual storage devices
US20120137062A1 (en) * 2010-11-30 2012-05-31 International Business Machines Corporation Leveraging coalesced memory
CN103049219A (en) * 2012-12-12 2013-04-17 华中科技大学 Virtual disk write cache system applicable to virtualization platform and operation method of write cache system
CN103218252A (en) * 2013-04-23 2013-07-24 深圳市京华科讯科技有限公司 First-level system acceleration method based on virtualization

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
SUNDARESAN RAJASEKARAN等: "Multi-cache: Dynamic, Efficient Partitioning for Multi-tier Caches in Consolidated VM Environments" *
严峥: "面向桌面云的I/O访存模式及缓存管理策略" *
余林琛;廖小飞;: "多虚拟机环境下磁盘写优化机制" *
陈昊罡;汪小林;王振林;靳辛欣;温翔;罗英伟;李晓明;: "面向虚拟机的远程磁盘缓存" *

Also Published As

Publication number Publication date
CN111258706B (en) 2023-05-02

Similar Documents

Publication Publication Date Title
KR102380670B1 (en) Fine-grained bandwidth provisioning in a memory controller
US9098462B1 (en) Communications via shared memory
US10585623B2 (en) Software defined FIFO buffer for multithreaded access
AU2010319840A1 (en) Allocating storage memory based on future use estimates
KR102077149B1 (en) Method for managing memory and apparatus thereof
KR20200122364A (en) Resource scheduling method and terminal device
CN109656691A (en) Processing method, device and the electronic equipment of computing resource
CN112445725A (en) Method and device for pre-reading file page and terminal equipment
US20190155641A1 (en) Method and apparatus for collecting information, and method and apparatus for releasing memory
CN108958950A (en) Task management method, host and the storage device of electronic storage device
CN112765084A (en) Computer device, virtualization acceleration device, data transmission method, and storage medium
KR20160071685A (en) Scratchpad memory management method, scratchpad memory management apparatus performing the same and storage medium storing the same
JP2024521963A (en) Data access method, device and non-transitory computer-readable storage medium
CN105260138A (en) Read/write control system and method
CN105094742B (en) A kind of method and apparatus for writing data
CN111258706B (en) Virtual machine system, control method thereof and electronic equipment
KR101575369B1 (en) Method for writing to and erasing a non-volatile memory
CN113127438A (en) Method, apparatus, server and medium for storing data
CN106575226B (en) Apparatus, method and computer-readable medium for computing
US8281091B2 (en) Automatic selection of storage volumes in a data storage system
CN109753339B (en) Resource allocation method and device and electronic equipment
CN108132757B (en) Data storage method and device and electronic equipment
CN110018987A (en) Snapshot creation method, apparatus and system
CN109753340B (en) Virtual machine snapshot processing method, device and system
CN110018985B (en) Snapshot deleting method, device and system

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
GR01 Patent grant
GR01 Patent grant