Method and apparatus for marking dirty page during live migration of virtual machine, back-end device, and chip
By combining dirty page write requests during the virtual machine hot migration process, the performance problems caused by frequent memory dirtyness are solved, and the effect of reducing the number of PCIe write operations and improving performance is achieved.
Patent Information
- Application Number
- PCT/CN2024/117430
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-10-19
- Filing Date
- 2024-09-06
- Publication Date
- 2025-04-24
AI Technical Summary
During the hot migration of virtual machines, frequent dirty memory operations lead to an increase in the number of PCIe write operations, which has poor performance.
A virtual machine hot migration method and device is designed to receive DMA write requests through the input module, and the dirty page recording module determines whether to generate dirty page write requests. The dirty page merging module merges the repeated dirty page write requests to reduce the number of PCIe write operations.
By merging dirty page write requests, the number of PCIe write operations is reduced, the system resource consumption is reduced, and the performance of hot migration of virtual machines is improved.
Smart Images

Figure CN2024117430_24042025_PF_FP_ABST
Abstract
Description
Virtual machine hot migration dirty marking method and device, back-end equipment, and chip
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application claims priority to a Chinese patent application filed with the Patent Office of China on October 19, 2023, with application number 202311358093.0 and invention name “Virtual machine hot migration dirty marking method and its device, back-end equipment, and chip”. The entire contents of the patent application are incorporated into this application by reference. Technical Field
[0003] The present application relates to the field of hot migration technology, and in particular to a method for marking a virtual machine hot migration dirty and an apparatus thereof, a VIRTIO backend device, a chip, an electronic device, and a computer-readable storage medium. Background Art
[0004] Live migration of virtual machines (VMs) is a technology that migrates running VMs from one physical host to another. Its purpose is to achieve dynamic resource adjustment and load balancing without interrupting VM operations. In live migration, the VM running before the migration is called the source VM, and the VM running after the migration is called the destination VM. The migration process involves copying the memory contents of the source VM to the destination VM. Because it is a "hot" migration, meaning the source VM does not shut down during the migration, it is possible that a section of the source VM's memory could be overwritten by the destination VM after it has been copied to the source VM. For example, a VIRTIO-net device might receive a network packet. In this case, this memory section needs to be recorded and copied to the destination VM. This memory section is called "dirty" memory, and the process of recording this memory section is called dirtying. Dirtying is performed on a page-by-page basis, and these pages are called dirty pages.
[0005] VIRTIO is a virtualization technology that provides a standard interface for efficient device communication between virtual machines and host machines. VIRTIO defines a set of common device interface specifications, including device registers, commands, and data transfer. VIRTIO devices are specific device implementations that comply with the VIRTIO specification. They can be network devices (VIRTIO-net), disk devices (VIRTIO-blk), graphics devices (VIRTIO-gpu), etc. They communicate with the driver in the virtual machine by implementing the interface defined in the VIRTIO specification. The hot migration process of a virtual machine based on VIRTIO devices mainly includes the following stages 1 to 3;
[0006] In phase 1, the following steps are performed:
[0007] Step 1: Enable dirty page logging on the source VM.
[0008] Step 2: Mark all source VM memory as dirty and copy it to the destination VM.
[0009] In phase 2, the following steps are performed:
[0010] Step 3: The source VM VIRTIO device repeatedly marks the memory dirty based on the actual situation.
[0011] Step 4: The console software repeatedly copies the dirty memory of the source VM to the destination VM, clearing the dirty page flag.
[0012] Repeat steps 3 and 4;
[0013] The number of dirty pages on the source VM gradually converges after the above stage 2, and all remaining dirty memory is copied to the destination VM for the final time.
[0014] In phase 3, the following steps are performed:
[0015] Step 5: Stop the source VM.
[0016] Step 6: Start the destination virtual machine.
[0017] Steps 3 and 4 of the aforementioned phase 2, marking memory dirty, are repetitive tasks that need to be performed frequently. Consequently, frequent PCIe write operations are required, resulting in poor performance.
[0018] Summary of the Invention
[0019] According to various embodiments of the present application, a method and apparatus for marking a virtual machine hot migration dirty, a VIRTIO backend device, a chip, a computer-readable storage medium, and an electronic device are proposed.
[0020] According to a first aspect of the present application, a device for marking a virtual machine as dirty during hot migration is provided, the device comprising:
[0021] An input module, configured to receive a current DMA write request of a target virtual function device and output the current DMA write request to a dirty page recording module;
[0022] a dirty page recording module, configured to determine whether to generate a current dirty page write request according to the current DMA write request, and if so, output the generated current dirty page write request to the dirty page merging module;
[0023] A dirty page merging module is configured to store the current dirty page write request if a previous dirty page write request of the target virtual function device is not stored; and to determine whether to merge the two based on the write address of the current dirty page write request and the write address of the previous dirty page write request if a previous dirty page write request of the target virtual function device is already stored; if so, to store the merged dirty page write request; if not, to output the previous dirty page write request to a subsequent module and to store the current dirty page write request.
[0024] In some embodiments, the dirty page recording module includes a dirty page marking logic unit, a mapping table, and a configuration table;
[0025] The mapping table is used to store the hot migration identifier of the target virtual function device, and the hot migration identifier indicates whether the virtual machine where the target virtual function device is located is performing hot migration;
[0026] The configuration table is used to store the preset memory address range and preset memory address of the virtual machine where the target virtual function device is located;
[0027] The dirty page marking logic unit is used to determine whether the virtual machine where the target virtual function device is located is performing hot migration according to the mapping table. If so, it determines whether to generate a current dirty page write request based on the write address of the current DMA write request and the preset memory address range. If so, it generates a current dirty page write request based on the preset memory address and the write address of the current DMA write request.
[0028] In some embodiments, the mapping table includes mapping units corresponding to a plurality of virtual function devices, each mapping unit is used to store a hot migration identifier and idx information of a corresponding virtual function device, the hot migration identifier indicating whether the virtual machine where the virtual function device is located is performing hot migration;
[0029] The configuration table includes a plurality of configuration units, each configuration unit is used to store a preset memory address range and a preset memory address of a virtual machine;
[0030] The logic unit is used to obtain the hot migration identifier and idx information corresponding to the target virtual function device according to the mapping table, and determine whether the virtual machine where the target virtual function device is located is performing hot migration according to the hot migration identifier; if so, obtain a preset memory address range and a preset memory address stored in a configuration unit corresponding to the idx information; determine whether to generate a current dirty page write request according to the write address of the current DMA write request and the preset memory address range; if so, generate the current dirty page write request according to the preset memory address and the write address of the current DMA write request.
[0031] In some embodiments, each configuration unit is specifically configured to store multiple preset memory address ranges and a preset memory address of a virtual machine.
[0032] In some embodiments, the number of the configuration units is smaller than the number of the mapping units.
[0033] In some embodiments, the current dirty page write request includes a device number, a write address, and a write length of the target virtual function device.
[0034] In some embodiments, the dirty page merging module includes a merging logic unit and a plurality of dirty page storage units;
[0035] Each dirty page storage unit is used to store a dirty page write request of a virtual function device;
[0036] The merging logic unit is used to store the current dirty page write request if the dirty page storage unit corresponding to the target virtual function device does not store the previous dirty page write request; if the dirty page storage unit corresponding to the target virtual function device has stored the previous dirty page write request, determine whether to merge the two according to the write address of the current dirty page write request and the write address of the previous dirty page write request; if so, store the merged dirty page write request; if not, output the previous dirty page write request to the subsequent module and store the current dirty page write request.
[0037] In some embodiments, the merging logic unit is specifically configured to determine to merge the current dirty page write request and the previous dirty page write request if add1 / m=add2 / m, add1 / m=1+add2 / m, or 1+add1 / m=add2 / m.
[0038] Wherein, add1 is the write address of the current dirty page write request, add2 is the write address of the previous dirty page write request, and m is the preset data bit width value.
[0039] In some embodiments, the merging logic unit is specifically configured to:
[0040] If add1 / m=add2 / m, the write address of the merged dirty page write request is the sum of the preset memory address and the write address of the previous dirty page write request, and the write length is 1 unit length;
[0041] If add1 / m=1+add2 / m, the write address of the merged dirty page write request is the sum of the preset memory address and the write address of the previous dirty page write request, and the write length is 2 unit lengths;
[0042] If 1+add1 / m=add2 / m is satisfied, the write address of the merged dirty page write request is the sum of the preset memory address and the write address of the current dirty page write request, and the write length is 2 unit lengths.
[0043] In some embodiments, the dirty page storage unit is further used to store a timestamp of a dirty page write request;
[0044] The merging logic unit is further configured to determine whether the dirty page write request has timed out according to the timestamp of the dirty page write request and a preset time threshold, and if so, output the timed-out dirty page write request to a subsequent module.
[0045] In some embodiments, the merging logic unit is specifically configured to determine whether multiple dirty page write requests have timed out according to a preset polling algorithm.
[0046] In some embodiments, further comprising a DMA write request path;
[0047] The input module is further configured to output the current DMA write request to a DMA write request path;
[0048] The DMA write request path is used to output the current DMA write request to a subsequent module.
[0049] In some embodiments, the apparatus further comprises a scheduling module;
[0050] The dirty page merging module is specifically configured to output the dirty page write request to the subsequent module through the scheduling module;
[0051] The DMA write request path is specifically used to output the DMA write request to the subsequent module through the scheduling module;
[0052] The scheduling module is used to schedule the dirty page write request output by the dirty page merging module and the DMA write request output by the DMA write request path according to a preset scheduling algorithm, and output the dirty page write request or the DMA write request to the subsequent module according to the scheduling result.
[0053] According to a second aspect of the present application, a method for marking a virtual machine as dirty during live migration is provided, the method comprising:
[0054] Receive the current DMA write request of the target virtual function device;
[0055] Determine whether to generate a current dirty page write request according to the current DMA write request, and if so, generate a corresponding current dirty page write request;
[0056] If the previous dirty page write request of the target virtual function device is not stored, the current dirty page write request is stored; if the previous dirty page write request of the target virtual function device is already stored, it is determined whether to merge the two according to the write address of the current dirty page write request and the write address of the previous dirty page write request. If so, the merged dirty page write request is stored; if not, the previous dirty page write request is output to the subsequent module, and the current dirty page write request is stored.
[0057] In some embodiments, the method specifically includes:
[0058] Querying a mapping table, determining whether the virtual machine where the target virtual function device is located is performing hot migration based on the query result; if so, querying a configuration table to obtain a preset memory address range and a preset memory address of the virtual machine; determining whether to generate a current dirty page write request based on the write address of the current DMA write request and the preset memory address range; and if so, generating a current dirty page write request based on the preset memory address and the write address of the current DMA write request;
[0059] The mapping table stores the hot migration identifier of the target virtual function device, which indicates whether the virtual machine where the target virtual function device is located is performing hot migration; the configuration table is used to store the preset memory address range and preset memory address of the virtual machine where the target virtual function device is located.
[0060] In some embodiments, the mapping table includes mapping units corresponding to a plurality of virtual function devices, each mapping unit storing a hot migration identifier and idx information of a corresponding virtual function device, the hot migration identifier indicating whether the virtual machine where the virtual function device is located is performing hot migration;
[0061] The configuration table includes a plurality of configuration units, each configuration unit is used to store a preset memory address range and a preset memory address of a virtual machine;
[0062] The method specifically includes:
[0063] According to the mapping table, a hot migration identifier and idx information corresponding to the target virtual function device are obtained, and according to the hot migration identifier, it is determined whether the virtual machine where the target virtual function device is located is performing hot migration. If so, a preset memory address range and a preset memory address stored in a configuration unit corresponding to the idx information are obtained, and according to the write address of the current DMA write request and the preset memory address range, it is determined whether a current dirty page write request is generated. If so, a current dirty page write request is generated according to the preset memory address and the write address of the current DMA write request.
[0064] In some embodiments, each configuration unit stores a plurality of preset memory address ranges and a preset memory address of a virtual machine.
[0065] In some embodiments, the number of the configuration units is smaller than the number of the mapping units.
[0066] In some embodiments, the current dirty page write request includes a device number, a write address, and a write length of the target virtual function device.
[0067] In some embodiments, the method specifically includes:
[0068] If the dirty page storage unit corresponding to the target virtual function device does not store the previous dirty page write request, the current dirty page write request is stored; if the dirty page storage unit corresponding to the target virtual function device has stored the previous dirty page write request, it is determined based on the write address of the current dirty page write request and the write address of the previous dirty page write request whether to merge the two. If so, the merged dirty page write request is stored; if not, the previous dirty page write request is output to the subsequent module, and the current dirty page write request is stored.
[0069] In some embodiments, the method specifically includes:
[0070] If add1 / m=add2 / m, or add1 / m=1+add2 / m, or 1+add1 / m=add2 / m, then determining to merge the current dirty page write request and the previous dirty page write request;
[0071] Wherein, add1 is the write address of the current dirty page write request, add2 is the write address of the previous dirty page write request, and m is the preset data bit width value.
[0072] In some embodiments, the method specifically includes:
[0073] If add1 / m=add2 / m, the write address of the merged dirty page write request is the sum of the preset memory address and the write address of the previous dirty page write request, and the write length is 1 unit length;
[0074] If add1 / m=1+add2 / m, the write address of the merged dirty page write request is the sum of the preset memory address and the write address of the previous dirty page write request, and the write length is 2 unit lengths;
[0075] If 1+add1 / m=add2 / m is satisfied, the write address of the merged dirty page write request is the sum of the preset memory address and the write address of the current dirty page write request, and the write length is 2 unit lengths.
[0076] In some embodiments, the dirty page storage unit further stores a timestamp of a dirty page write request;
[0077] The method specifically further includes:
[0078] Determine whether the dirty page write request has timed out based on the timestamp of the dirty page write request and a preset time threshold. If so, output the timed-out dirty page write request to a subsequent module.
[0079] In some embodiments, the method specifically includes:
[0080] Determine whether multiple dirty page write requests have timed out based on a preset polling algorithm.
[0081] In some embodiments, the method further comprises:
[0082] The dirty page write request and the DMA write request are scheduled according to a preset scheduling algorithm, and the dirty page write request or the DMA write request is output to a subsequent module according to the scheduling result.
[0083] According to a third aspect of the present application, a VIRTIO backend device is provided, comprising the virtual machine hot migration dirty marking device according to the first aspect.
[0084] According to a fourth aspect of the present application, a chip is provided, comprising the virtual machine hot migration dirty marking device according to the first aspect.
[0085] According to the fifth aspect of the present application, an electronic device is provided, comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor implements the virtual machine hot migration dirty marking method of the second aspect when executing the computer program.
[0086] According to a sixth aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the virtual machine hot migration dirty marking method according to the second aspect is implemented.
[0087] The details of one or more embodiments of the present application are set forth in the following drawings and description. Other features, objects, and advantages of the present application will become apparent from the description, drawings, and claims. BRIEF DESCRIPTION OF THE DRAWINGS
[0088] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0089] FIG1 is a structural diagram of a virtual machine hot migration dirty marking device in one embodiment of the present application.
[0090] FIG2 is a structural diagram of a virtual machine hot migration dirty marking device in another embodiment of the present application.
[0091] FIG3 is a structural diagram of a virtual machine hot migration dirty marking device in another embodiment of the present application.
[0092] FIG4 is a flowchart of a method for marking a virtual machine as dirty during live migration in one embodiment of the present application. DETAILED DESCRIPTION
[0093] The detailed description of the accompanying drawings is intended to serve as an illustration of the presently preferred embodiment of the present application, and is not intended to represent the only form in which the present application can be implemented. It should be understood that the same or equivalent functions can be accomplished by different embodiments intended to be included in the spirit and scope of the present application.
[0094] One embodiment of the present application provides a device for marking dirty pages during live migration of a virtual machine. Referring to FIG1 , the device of this embodiment includes an input module, a dirty page recording module, a dirty page merging module, and a DMA write request path.
[0095] An input module is configured to receive a current DMA write request from a target virtual function device and output the current DMA write request to a dirty page recording module. Specifically, a virtual machine includes multiple virtual function devices (Virtual Function Devices), such as a network device (VIRTIO-net) and a disk device (VIRTIO-blk). The target virtual function device is one of the multiple virtual function devices. For ease of context, this article uses the target virtual function device for description. A DMA write request from a virtual function device refers to a request from a virtual function device in the virtual machine to perform a write operation on the host's physical memory, and the write operation request is implemented by the DMA processing module. DMA (Direct Memory Access) is a data transmission method that allows a device to directly access the host's memory without CPU intervention.
[0096] The dirty page recording module is used to determine whether to generate a current dirty page write request based on the current DMA write request. If so, the generated current dirty page write request is output to the dirty page merging module. Specifically, the current DMA write request includes the ID (VFid), write address and write length of the target virtual function device. The corresponding target virtual machine can be determined based on the VFid, and then it is determined whether the target virtual machine is in the hot migration process. Dirty marking is only required during the hot migration of the virtual machine. Further, the corresponding write address can be determined based on the current DMA write request. Dirty marking is only required when the write address falls into the corresponding memory address range. Based on the above two points, it can be determined whether the current dirty page write request needs to be generated based on the current DMA write request.
[0097] A dirty page merging module is configured to store a current dirty page write request if a previous dirty page write request of the target virtual function device is not stored; if a previous dirty page write request of the target virtual function device is already stored, determine whether to merge the two based on the write address of the current dirty page write request and the write address of the previous dirty page write request; if so, store the merged dirty page write request; if not, output the previous dirty page write request to a subsequent module and store the current dirty page write request; specifically, a storage unit can be provided for storing the dirty page write request of the target virtual function device; if the current dirty page write request is obtained and the previous dirty page write request of the target virtual function device is already stored in the storage unit, determine whether the dirty page write requests can be merged based on the write addresses of the two; if not, output the previous dirty page write request to the subsequent module first, and then store the current dirty page write request in the storage unit for subsequent merging or output; if the previous dirty page write request of the target virtual function device is not stored in the storage unit, directly store the current dirty page write request in the storage unit for subsequent merging or output. Therefore, in this embodiment, when a dirty page write request is obtained, it is not output directly, but it is determined whether it can be merged.
[0098] Specifically, the subsequent module is usually a PCIe controller. Ultimately, the current DMA write request and the dirty page write request need to be sent to the DMA processing module for processing. The DMA processing module is an important component in the computer system and is used to achieve high-speed data transmission. When the processor needs to write data from the peripheral device to the memory, the write request can be processed by the DMA processing module; when the DMA processing module processes the dirty page write request, it will write the preset dirty page flag data to the corresponding memory address to determine which memory is "dirty" memory.
[0099] In summary, the method of this embodiment can make judgments based on the write addresses of different dirty page write requests, and merge multiple dirty page write requests into one dirty page write request, which can reduce the number of PCIe write operations. By reducing the number of PCIe write operations, the requirements for data transmission and storage can be reduced, and the resource consumption of the system can be reduced. At the same time, the bandwidth of the PCIe bus is limited. Reducing the number of PCIe write operations can also improve the efficiency of data transmission and reduce transmission delays. In summary, the present application has advantages in reducing data transmission and storage requirements, reducing system resource consumption, and improving processing efficiency, and can improve the performance of virtual machine hot migration dirty marking.
[0100] In some embodiments, the dirty page recording module includes a dirty page marking logic unit, a mapping table, and a configuration table;
[0101] The mapping table is used to store the hot migration identifier of the target virtual function device, and the hot migration identifier indicates whether the virtual machine where the target virtual function device is located is performing hot migration; specifically, the hot migration identifier can be set to, when the hot migration identifier is 1, it indicates that the virtual machine where the target virtual function device is located is performing hot migration, and when the hot migration identifier is 0, it indicates that the virtual machine where the target virtual function device is located is not performing hot migration; therefore, the corresponding hot migration identifier can be obtained by querying the mapping table according to VFid, and then determining whether the virtual machine where the target virtual function device is located is performing hot migration.
[0102] The configuration table is used to store the preset memory address range and preset memory address of the virtual machine where the target virtual function device is located; specifically, when the write address of the current DMA write request falls into the preset memory address range, it is determined that dirty marking is required. The preset memory address refers to the starting address for writing dirty page flag data.
[0103] The dirty page marking logic unit is used to determine whether the virtual machine where the target virtual function device is located is performing hot migration according to the mapping table. If so, it determines whether to generate a current dirty page write request based on the write address of the current DMA write request and the preset memory address range. If so, it generates a current dirty page write request based on the preset memory address and the write address of the current DMA write request.
[0104] Specifically, assuming that the preset memory address is address a, a memory space is divided with address a as the starting address for dirty marking. Assuming that this memory space includes n address units, an address unit corresponding to the write address of the current DMA write request can be determined, and then this address unit can be marked. Each address unit can correspond to a write address range.
[0105] In some embodiments, the mapping table includes mapping units corresponding one-to-one to multiple virtual function devices, each mapping unit is used to store the hot migration identifier and idx information (index information) of a corresponding virtual function device, and the hot migration identifier indicates whether the virtual machine where the virtual function device is located is performing hot migration; specifically, the address or index of each mapping unit in the mapping table is the VFid of the corresponding virtual function device, so the corresponding mapping unit can be found according to the VFid, and the corresponding hot migration identifier and idx information can be further read out.
[0106] The configuration table includes a plurality of configuration units, each of which is used to store a preset memory address range and a preset memory address of a virtual machine.
[0107] The logic unit is used to obtain a hot migration identifier and idx information corresponding to a target virtual function device according to a mapping table, and determine whether the virtual machine where the target virtual function device is located is performing hot migration according to the hot migration identifier; if so, obtain a preset memory address range and a preset memory address stored in a configuration unit corresponding to the idx information; determine whether to generate a current dirty page write request according to the write address of a current DMA write request and the preset memory address range; if so, generate the current dirty page write request according to the preset memory address and the write address of the current DMA write request.
[0108] Specifically, if the hot migration identifier corresponding to the target virtual function device indicates that the virtual machine where the target virtual function device is located is performing hot migration, then its corresponding idx information is the index or table address of a configuration unit. According to the idx information, a corresponding configuration unit can be found, and the corresponding preset memory address range and preset memory address can be read from it.
[0109] In some embodiments, each configuration unit is specifically configured to store multiple preset memory address ranges and a preset memory address of a virtual machine.
[0110] Specifically, considering that not the entire memory of a virtual machine will be rewritten during hot migration, and that some memory may not need to be migrated to the destination virtual machine even if it is rewritten, the memory range that needs to be marked dirty can be further refined. Based on this, the method of this embodiment segments the virtual machine memory addresses that need to be compared to obtain multiple preset memory address ranges. When performing address comparison, the write address of the DMA write request is only compared with these segmented addresses. If it falls into any preset memory address range, a dirty page write request is generated. If it does not fall into any preset memory address range, no dirty page write request is generated. The advantage of this is that the record space for dirty page records becomes smaller, and thus the range of search records also becomes smaller, thereby reducing the burden on computing resources.
[0111] In some embodiments, the number of configuration units is less than the number of mapping units.
[0112] Specifically, in a system supporting virtualization, there may be hundreds to thousands of virtual function devices, each of which is bound to different virtual machines. The number of virtual machines that can be hot migrated concurrently in a system is limited (on the order of dozens), and it is impossible for all virtual function devices to be hot migrated simultaneously. Therefore, the method of this embodiment sets up a mapping table and a configuration table. The depth of the mapping table is relatively large (thousands), representing the number of virtual function devices (all virtual function devices have a position in the mapping table, indexed by VFid), while the depth of the configuration table is relatively small (dozens), representing the number of concurrent hot migrations.
[0113] In this embodiment, when a virtual machine needs to be hot migrated, the management software first selects an unused configuration unit from the configuration table, writes the corresponding preset memory address range and a preset memory address into the configuration unit, and then, the management software writes the index (VFid) of the configuration unit just selected into the mapping unit of the VFid index corresponding to the current virtual machine as its idx information.
[0114] In some embodiments, the current dirty page write request includes a device number, a write address, and a write length of a target virtual function device.
[0115] Specifically, traditional dirty page marking is generally performed at a 4KB page granularity. In this embodiment, dirty page marking is not limited to a 4KB page granularity; it can be 4KB, 8KB, 16KB, 32KB, etc. Granularity. Taking 32KB as an example, the method of this embodiment can merge dirty page write requests of adjacent or repeated 32KB memory address spaces.
[0116] It should be noted that the reason for introducing dirty page merging in the method of this embodiment is mainly to take into account the following situation: program execution usually has spatial locality. When a memory address in the virtual machine is updated, the memory addresses adjacent to it are usually also updated. If a dirty page record is issued every time a memory address is updated, it is a bit wasteful. The dirty page write requests caused by multiple DMA write requests with the same or adjacent addresses can be merged into one dirty page write request, thereby reducing the number of dirty page write requests and reducing the waste of PCIe write bandwidth. Therefore, when the method of this embodiment merges the repeated dirty operations (dirty page write requests) of the memory address space of 2 unit granularities, the merged write length is 1 unit length. When the dirty operations (dirty page write requests) of the memory address space of 2 adjacent unit granularities are merged, the merged write length is 2 unit lengths.
[0117] In some embodiments, the dirty page merging module includes a merging logic unit and a plurality of dirty page storage units;
[0118] Each dirty page storage unit is used to store a dirty page write request of a virtual function device;
[0119] The merging logic unit is used to store the current dirty page write request if the dirty page storage unit corresponding to the target virtual function device does not store the previous dirty page write request; if the dirty page storage unit corresponding to the target virtual function device has stored the previous dirty page write request, determine whether to merge the two according to the write address of the current dirty page write request and the write address of the previous dirty page write request; if so, store the merged dirty page write request; if not, output the previous dirty page write request to the subsequent module, and store the current dirty page write request as the next previous dirty page write request, which is subsequently used to determine whether it needs to be merged with the next dirty page write request.
[0120] In some embodiments, the merging logic unit is specifically configured to determine to merge the current dirty page write request and the previous dirty page write request if add1 / m=add2 / m, add1 / m=1+add2 / m, or 1+add1 / m=add2 / m.
[0121] Wherein, add1 is the write address of the current dirty page write request, add2 is the write address of the previous dirty page write request, and m is a preset data bit width value, that is, the dirty granularity, for example, 32KB.
[0122] Specifically, add1 / m=1+add2 / m indicates that the write addresses of the current dirty page write request coincide with those of the previous dirty page write request, and 1+add1 / m=add2 / m and 1+add1 / m=add2 / m both indicate that the write addresses of the current dirty page write request are adjacent to those of the previous dirty page write request.
[0123] In some embodiments, the merging logic unit is specifically configured to:
[0124] If add1 / m=add2 / m, the write address of the merged dirty page write request is the sum of the preset memory address and the write address of the previous dirty page write request, and the write length is 1 unit length;
[0125] If add1 / m=1+add2 / m, the write address of the merged dirty page write request is the sum of the preset memory address and the write address of the previous dirty page write request, and the write length is 2 units.
[0126] If 1+add1 / m=add2 / m, the write address of the merged dirty page write request is the sum of the preset memory address and the write address of the current dirty page write request, and the write length is 2 units.
[0127] Specifically, assuming the dirty page size m is 32KB, dirty page marking is performed at a granularity of 8 times the size of a page (4KB). In other words, one byte in the dirty page record represents 32KB. Therefore, a 32GB memory space requires 32GB / 32KB = 1MB of dirty page record space, meaning one unit length is one byte.
[0128] If add1 / m=add2 / m, 0xFF (dirty page mark data) is written to the corresponding write address; if add1 / m=1+add2 / m or 1+add1 / m=add2 / m, 0xFFFF is written to the corresponding write address, indicating that the 64KB memory starting from the last requested address is dirty, or that the 64KB memory starting from this requested address is dirty.
[0129] In some embodiments, the dirty page storage unit is further used to store a timestamp tscnt of the dirty page write request;
[0130] The merging logic unit is further configured to determine whether the dirty page write request has timed out based on the timestamp tscnt of the dirty page write request and a preset time threshold, and if so, output the timed-out dirty page write request to a subsequent module.
[0131] Specifically, the method of this embodiment sets a timeout mechanism to prevent a dirty page write request of a certain virtual function device from being delayed due to merging.
[0132] In a specific example, the timestamp tscnt can refer to the submission time / generation time of the dirty page write request. Specifically, it can be determined by calculating the time difference between the current time and the timestamp. If the time difference is greater than or equal to the preset time threshold, it is determined to be a timeout. If the time difference is less than the preset time threshold, it is determined that there is no timeout.
[0133] In some embodiments, the merging logic unit is specifically configured to determine whether multiple dirty page write requests have timed out according to a preset polling algorithm.
[0134] In a specific example, each dirty page storage unit stores a valid signal. When the valid signal is 1, it indicates that the dirty page write request in the corresponding dirty page storage unit is valid. When the valid signal is 0, it indicates that the dirty page write request in the corresponding dirty page storage unit is invalid. The dirty page write request in the dirty page storage unit whose valid signal is 1 is queried in a polling manner to see whether it has timed out. If it has timed out, the timed-out dirty page write request is sent out; if it has not timed out, tscnt=tscnt+1 is set, and the initial value of tscnt can be 0; if all dirty page write requests whose valid signals are 1 have completed the current polling, the next polling is entered.
[0135] In some embodiments, referring to FIG2 , the apparatus further includes a DMA write request path;
[0136] The input module is further used to output the current DMA write request to the DMA write request path;
[0137] The DMA write request path is used to output the current DMA write request to the subsequent module.
[0138] Specifically, the subsequent module is usually a PCIe controller. Ultimately, the current DMA write request and the dirty page write request need to be sent to the DMA processing module for processing. When the DMA processing module processes the current DMA write request, it will write the data to be written of the current DMA write request into the corresponding memory address.
[0139] In some embodiments, referring to FIG3 , the apparatus further includes a scheduling module;
[0140] The dirty page merging module is specifically used to output the dirty page write request to the subsequent module through the scheduling module;
[0141] The DMA write request path is specifically used to output the DMA write request to the subsequent module through the scheduling module;
[0142] The scheduling module is used to schedule the dirty page write request output by the dirty page merging module and the DMA write request output by the DMA write request path according to a preset scheduling algorithm, and output the dirty page write request or the DMA write request to the subsequent module according to the scheduling result.
[0143] Specifically, an example of a scheduling algorithm is Round Robin, which assigns tasks to two outputs in a round-robin manner. Each output gets a task in turn, and then the next output gets its turn. This algorithm is simple and fair, but may not fully utilize the performance difference between the two outputs. Another example is Weighted Round Robin, which assigns a weight to each output and determines the distribution of tasks based on the weight ratio. The output with the higher weight gets more tasks. The weight can be set based on the performance difference of the outputs to fully utilize the performance of the two outputs.
[0144] It should be noted that each module in the apparatus of the above embodiment may be a software module, a hardware module, or a module implemented by combining software and hardware.
[0145] Another embodiment of the present application provides a method for marking a virtual machine during hot migration. The method can be implemented based on the virtual machine hot migration marking device of the above embodiment. Referring to FIG4 , the method includes the following steps:
[0146] Step S1, receiving a current DMA write request of a target virtual function device;
[0147] Step S2, determining whether to generate a current dirty page write request according to the current DMA write request, and if so, generating a corresponding current dirty page write request;
[0148] Step S3: If the previous dirty page write request of the target virtual function device is not stored, the current dirty page write request is stored; if the previous dirty page write request of the target virtual function device is stored, it is determined whether to merge the two according to the write address of the current dirty page write request and the write address of the previous dirty page write request. If so, the merged dirty page write request is stored; if not, the previous dirty page write request is output to the subsequent module, and the current dirty page write request is stored.
[0149] In some embodiments, step S2 specifically includes:
[0150] Query the mapping table, and determine whether the virtual machine where the target virtual function device is located is performing hot migration based on the query result. If so, query the configuration table to obtain the preset memory address range and preset memory address of the virtual machine, and determine whether to generate a current dirty page write request based on the write address of the current DMA write request and the preset memory address range. If so, generate the current dirty page write request based on the preset memory address and the write address of the current DMA write request;
[0151] The mapping table stores the hot migration identifier of the target virtual function device, which indicates whether the virtual machine where the target virtual function device is located is performing hot migration; the configuration table is used to store the preset memory address range and preset memory address of the virtual machine where the target virtual function device is located.
[0152] In some embodiments, the mapping table includes mapping units corresponding to a plurality of virtual function devices, each mapping unit is used to store a hot migration identifier and idx information of a corresponding virtual function device, the hot migration identifier indicating whether the virtual machine where the virtual function device is located is performing hot migration;
[0153] The configuration table includes a plurality of configuration units, each configuration unit being used to store a preset memory address range and a preset memory address of a virtual machine;
[0154] In some embodiments, step S2 specifically includes:
[0155] According to the mapping table, the hot migration identifier and idx information corresponding to the target virtual function device are obtained, and according to the hot migration identifier, it is determined whether the virtual machine where the target virtual function device is located is performing hot migration. If so, a preset memory address range and a preset memory address stored in a configuration unit corresponding to the idx information are obtained, and according to the write address of the current DMA write request and the preset memory address range, it is determined whether a current dirty page write request is generated. If so, the current dirty page write request is generated according to the preset memory address and the write address of the current DMA write request.
[0156] In some embodiments, each configuration unit is specifically configured to store multiple preset memory address ranges and a preset memory address of a virtual machine.
[0157] In some embodiments, the number of configuration units is less than the number of mapping units.
[0158] In some embodiments, the current dirty page write request includes a device number, a write address, and a write length of a target virtual function device.
[0159] In some embodiments, step S3 specifically includes:
[0160] If the dirty page storage unit corresponding to the target virtual function device does not store the previous dirty page write request, the current dirty page write request is stored; if the dirty page storage unit corresponding to the target virtual function device has stored the previous dirty page write request, it is determined whether to merge the two according to the write address of the current dirty page write request and the write address of the previous dirty page write request. If so, the merged dirty page write request is stored; if not, the previous dirty page write request is output to the subsequent module, and the current dirty page write request is stored.
[0161] In some embodiments, step S3 specifically includes:
[0162] If add1 / m=add2 / m, or add1 / m=1+add2 / m, or 1+add1 / m=add2 / m, then the current dirty page write request and the previous dirty page write request are merged.
[0163] Wherein, add1 is the write address of the current dirty page write request, add2 is the write address of the previous dirty page write request, and m is the preset data bit width value.
[0164] In some embodiments, step S3 specifically includes:
[0165] If add1 / m=add2 / m, the write address of the merged dirty page write request is the sum of the preset memory address and the write address of the previous dirty page write request, and the write length is 1 unit length;
[0166] If add1 / m=1+add2 / m, the write address of the merged dirty page write request is the sum of the preset memory address and the write address of the previous dirty page write request, and the write length is 2 units.
[0167] If 1+add1 / m=add2 / m is satisfied, the write address of the merged dirty page write request is the sum of the preset memory address and the write address of the current dirty page write request, and the write length is 2 unit lengths.
[0168] In some embodiments, the dirty page storage unit is further used to store a timestamp of a dirty page write request;
[0169] In some embodiments, step S3 specifically includes:
[0170] Determine whether the dirty page write request has timed out based on the timestamp of the dirty page write request and a preset time threshold. If so, output the timed-out dirty page write request to a subsequent module.
[0171] In some embodiments, step S3 specifically includes:
[0172] Determine whether multiple dirty page write requests have timed out based on a preset polling algorithm.
[0173] In some embodiments, the method further comprises:
[0174] Step S4: output the current DMA write request to the subsequent module.
[0175] In some embodiments, the method further comprises:
[0176] The dirty page write request and the DMA write request are scheduled according to a preset scheduling algorithm, and the dirty page write request or the DMA write request is output to a subsequent module according to the scheduling result.
[0177] It should be noted that the virtual machine hot migration dirty marking method of this embodiment corresponds to the virtual machine hot migration dirty marking device of the above embodiment. Therefore, the parts of the virtual machine hot migration dirty marking method of this embodiment that are not described in detail can be obtained by referring to the contents of the virtual machine hot migration dirty marking device of the above embodiment, so they will not be repeated here.
[0178] Another embodiment of the present application provides a VIRTIO backend device, including the virtual machine hot migration dirty marking device of the above embodiment.
[0179] Specifically, VIRTIO is a general semi-virtualized I / O framework through which the VMM simulates a series of virtualized devices. The VIRTIO framework mainly consists of three parts: front-end driver, back-end device, and virtualization queue (Virtqueue). Among them, the front-end driver is the driver corresponding to the VIRTIO simulated device inside the virtual machine (such as the common VIRTIO network device, VIRTIO disk device, etc.). The role of the front-end driver is to receive user-mode requests, then encapsulate these requests according to the protocol and send them to the back-end device; the back-end device is usually implemented in QEMU. The back-end device is used to receive I / O requests sent by the front-end driver, then parse the received data, and complete the receiving and sending requests from the actual physical device, and finally notify the front-end driver through the interrupt mechanism; the data between the front-end driver and the back-end device interacts through the Virtqueue queue. In this embodiment, the VIRTIO back-end device is designed to include the virtual machine hot migration dirty marking device of the above embodiment to implement the virtual machine hot migration dirty marking method.
[0180] Another embodiment of the present application provides a chip including the virtual machine hot migration dirty marking device of the above embodiment.
[0181] Another embodiment of the present application provides an electronic device, including a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the virtual machine hot migration dirty marking method as described in the above embodiment is implemented.
[0182] Wherein, electronic equipment can also include the bus connecting different components (including memory and processor).Memory can include computer-readable medium in the form of volatile memory, such as random access memory (RAM) and / or cache memory.Memory can also include at least one program product, and this program product has one group (such as at least one) program module, and these program modules are configured to perform the function of each embodiment of the present application.Electronic equipment can also communicate with one or more external devices (such as keyboard, pointing device, display etc.), can also communicate with one or more devices that enable users to interact with this electronic equipment, and / or communicate with any device (such as network card) that enables this electronic equipment to communicate with one or more other computing devices, this communication can be carried out through input / output (I / O) interface, and electronic equipment can also communicate with one or more networks (such as local area network (LAN), wide area network (WAN) and / or public network, such as Internet) through network adapter.
[0183] Another embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the virtual machine hot migration dirty marking method as described in the above embodiment.
[0184] Specifically, computer-readable storage media may include: any physical or recording medium that can carry computer program instructions, USB flash drives, mobile hard drives, magnetic disks, optical disks, computer memories, read-only memories (ROM), random access memories (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc.
[0185] While various embodiments of the present application have been described above, the above descriptions are illustrative, non-exhaustive, and not intended to be limiting of the disclosed embodiments. Many updates and modifications will be readily apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is selected to best explain the principles of the embodiments, their practical applications, or technological improvements in the marketplace, or to enable others skilled in the art to understand the embodiments disclosed herein.
Claims
1. A virtual machine hot migration dirty marking device, characterized in that: The device comprises: An input module, used for receiving a current DMA write request sent by a target virtual function device, and outputting the current DMA write request to a dirty page recording module; a dirty page recording module, configured to determine whether to generate a current dirty page write request according to the current DMA write request, and if so, output the generated current dirty page write request to the dirty page merging module; A dirty page merging module is used to store the current dirty page write request if the previous dirty page write request of the target virtual function device is not stored; if the previous dirty page write request of the target virtual function device is already stored, determine whether to merge the two according to the write address of the current dirty page write request and the write address of the previous dirty page write request; if so, store the merged dirty page write request; if not, output the previous dirty page write request to the subsequent module and store the current dirty page write request.
2. The virtual machine hot migration dirty marking device according to claim 1, characterized in that: The dirty page recording module includes a dirty page marking logic unit, a mapping table and a configuration table; The mapping table is used to store the hot migration identifier of the target virtual function device, and the hot migration identifier indicates whether the virtual machine where the target virtual function device is located is performing hot migration; The configuration table is used to store a preset memory address range and a preset memory address of the virtual machine where the target virtual function device is located; The dirty page marking logic unit is used to determine whether the virtual machine where the target virtual function device is located is performing hot migration according to the mapping table. If so, determine whether to generate a current dirty page write request according to the write address of the current DMA write request and the preset memory address range. If so, generate the current dirty page write request according to the preset memory address and the write address of the current DMA write request.
3. The virtual machine hot migration dirty marking device according to claim 2, characterized in that: The mapping table includes mapping units corresponding to a plurality of virtual function devices one by one, each mapping unit is used to store a hot migration identifier and idx information of a virtual function device corresponding thereto, the hot migration identifier indicating whether the virtual machine where the virtual function device is located is performing hot migration; The configuration table includes a plurality of configuration units, each configuration unit being used to store a preset memory address range and a preset memory address of a virtual machine; The logic unit is used to obtain the hot migration identifier and idx information corresponding to the target virtual function device according to the mapping table, and determine whether the virtual machine where the target virtual function device is located is performing hot migration according to the hot migration identifier; if so, obtain a preset memory address range and a preset memory address stored in a configuration unit corresponding to the idx information, and determine whether to generate a current dirty page write request according to the write address of the current DMA write request and the preset memory address range; if so, generate the current dirty page write request according to the preset memory address and the write address of the current DMA write request.
4. The virtual machine hot migration dirty marking device according to claim 3, characterized in that: Each configuration unit is specifically used to store multiple preset memory address ranges and a preset memory address of a virtual machine.
5. The virtual machine hot migration dirty marking device according to claim 3, characterized in that: The number of the configuration units is smaller than the number of the mapping units.
6. The virtual machine hot migration dirty marking device according to claim 3, characterized in that: The current dirty page write request includes the device number, write address and write length of the target virtual function device.
7. The virtual machine hot migration dirty marking device according to claim 6, characterized in that: The dirty page merging module includes a merging logic unit and a plurality of dirty page storage units; Each dirty page storage unit is used to store a dirty page write request of a virtual function device; The merging logic unit is used for storing the current dirty page write request if the dirty page storage unit corresponding to the target virtual function device does not store the previous dirty page write request; If the dirty page storage unit corresponding to the target virtual function device has stored a previous dirty page write request, determine whether to merge the two according to the write address of the current dirty page write request and the write address of the previous dirty page write request. If so, store the merged dirty page write request; if not, output the previous dirty page write request to the subsequent module and store the current dirty page write request.
8. The virtual machine hot migration dirty marking device according to claim 7, characterized in that: The merging logic unit is specifically used to determine to merge the current dirty page write request and the previous dirty page write request if add1 / m=add2 / m is satisfied, or add1 / m=1+add2 / m is satisfied, or 1+add1 / m=add2 / m is satisfied; Wherein, add1 is the write address of the current dirty page write request, add2 is the write address of the previous dirty page write request, and m is the preset data bit width value.
9. The virtual machine hot migration dirty marking device according to claim 8, characterized in that: The merging logic unit is specifically used for: If add1 / m=add2 / m, the write address of the merged dirty page write request is the sum of the preset memory address and the write address of the previous dirty page write request, and the write length is 1 unit length; If add1 / m=1+add2 / m is satisfied, the write address of the merged dirty page write request is the sum of the preset memory address and the write address of the previous dirty page write request, and the write length is 2 unit lengths; If 1+add1 / m=add2 / m is satisfied, the write address of the merged dirty page write request is the sum of the preset memory address and the write address of the current dirty page write request, and the write length is 2 unit lengths.
10. The virtual machine hot migration dirty marking device according to claim 7, characterized in that: The dirty page storage unit is also used to store the timestamp of the dirty page write request; The merging logic unit is further used to determine whether the dirty page write request has timed out according to the timestamp of the dirty page write request and a preset time threshold, and if so, output the timed out dirty page write request to a subsequent module.
11. The virtual machine hot migration dirty marking device according to claim 10, characterized in that: The merging logic unit is specifically used to determine whether multiple dirty page write requests have timed out according to a preset polling algorithm.
12. The virtual machine hot migration dirty marking device according to any one of claims 1 to 10, characterized in that: Also includes a DMA write request path; The input module is further used to output the current DMA write request to the DMA write request path; The DMA write request path is used to output the current DMA write request to a subsequent module.
13. The virtual machine hot migration dirty marking device according to claim 12, characterized in that: The device also includes a scheduling module; The dirty page merging module is specifically used to output the dirty page write request to the subsequent module through the scheduling module; The DMA write request path is specifically used to output the DMA write request to the subsequent module through the scheduling module; The scheduling module is used to schedule the dirty page write request output by the dirty page merging module and the DMA write request output by the DMA write request path according to a preset scheduling algorithm, and output the dirty page write request or the DMA write request to a subsequent module according to the scheduling result.
14. A method for marking a virtual machine as dirty during hot migration, characterized in that: The method comprises: Receive the current DMA write request sent by the target virtual function device; Determine whether to generate a current dirty page write request according to the current DMA write request, and if so, generate a corresponding current dirty page write request; If the previous dirty page write request of the target virtual function device is not stored, the current dirty page write request is stored; if the previous dirty page write request of the target virtual function device is already stored, it is determined whether to merge the two according to the write address of the current dirty page write request and the write address of the previous dirty page write request. If so, the merged dirty page write request is stored; if not, the previous dirty page write request is output to the subsequent module and the current dirty page write request is stored.
15. The method for marking dirty during hot migration of a virtual machine according to claim 14, characterized in that: The method specifically comprises: Query the mapping table, determine whether the virtual machine where the target virtual function device is located is performing hot migration according to the query result, and if so, query the configuration table to obtain the preset memory address range and preset memory address of the virtual machine, and determine whether to generate a current dirty page write request according to the write address of the current DMA write request and the preset memory address range, and if so, generate the current dirty page write request according to the preset memory address and the write address of the current DMA write request; The mapping table stores the hot migration identifier of the target virtual function device, and the hot migration identifier indicates whether the virtual machine where the target virtual function device is located is performing hot migration; The configuration table is used to store the preset memory address range and the preset memory address of the virtual machine where the target virtual function device is located.
16. The method for marking dirty during hot migration of a virtual machine according to claim 15, characterized in that: The mapping table includes mapping units corresponding to a plurality of virtual function devices one by one, each mapping unit stores a hot migration identifier and idx information of a virtual function device corresponding thereto, the hot migration identifier indicating whether the virtual machine where the virtual function device is located is performing hot migration; The configuration table includes a plurality of configuration units, each configuration unit being used to store a preset memory address range and a preset memory address of a virtual machine; The method specifically comprises: According to the mapping table, a hot migration identifier and idx information corresponding to the target virtual function device are obtained, and according to the hot migration identifier, it is determined whether the virtual machine where the target virtual function device is located is performing hot migration; if so, a preset memory address range and a preset memory address stored in a configuration unit corresponding to the idx information are obtained, and according to the write address of the current DMA write request and the preset memory address range, it is determined whether to generate a current dirty page write request; if so, a current dirty page write request is generated according to the preset memory address and the write address of the current DMA write request.
17. The method for marking a virtual machine as dirty during hot migration according to claim 16, characterized in that: Each configuration unit stores multiple preset memory address ranges and a preset memory address of a virtual machine.
18. The method for marking a virtual machine as dirty during hot migration according to claim 16, characterized in that: The number of the configuration units is smaller than the number of the mapping units.
19. The method for marking a virtual machine as dirty during hot migration according to claim 16, characterized in that: The current dirty page write request includes the device number, write address and write length of the target virtual function device.
20. The method for marking dirty during hot migration of a virtual machine according to claim 19, characterized in that: The method specifically comprises: If the dirty page storage unit corresponding to the target virtual function device does not store the previous dirty page write request, the current dirty page write request is stored; if the dirty page storage unit corresponding to the target virtual function device has stored the previous dirty page write request, it is determined whether to merge the two according to the write address of the current dirty page write request and the write address of the previous dirty page write request. If so, the merged dirty page write request is stored; if not, the previous dirty page write request is output to the subsequent module, and the current dirty page write request is stored.
21. The method for marking dirty during hot migration of a virtual machine according to claim 20, characterized in that: The method specifically comprises: If add1 / m=add2 / m, or add1 / m=1+add2 / m, or 1+add1 / m=add2 / m, then determine to merge the current dirty page write request and the previous dirty page write request; Wherein, add1 is the write address of the current dirty page write request, add2 is the write address of the previous dirty page write request, and m is the preset data bit width value.
22. The method for marking dirty during hot migration of a virtual machine according to claim 21, characterized in that: The method specifically comprises: If add1 / m=add2 / m, the write address of the merged dirty page write request is the sum of the preset memory address and the write address of the previous dirty page write request, and the write length is 1 unit length; If add1 / m=1+add2 / m is satisfied, the write address of the merged dirty page write request is the sum of the preset memory address and the write address of the previous dirty page write request, and the write length is 2 unit lengths; If 1+add1 / m=add2 / m is satisfied, the write address of the merged dirty page write request is the sum of the preset memory address and the write address of the current dirty page write request, and the write length is 2 unit lengths.
23. The method for marking dirty during hot migration of a virtual machine according to claim 20, characterized in that: The dirty page storage unit also stores a timestamp of a dirty page write request; The method specifically also includes: Whether the dirty page write request has timed out is determined according to the timestamp of the dirty page write request and a preset time threshold. If so, the timed out dirty page write request is output to a subsequent module.
24. The method for marking dirty during hot migration of a virtual machine according to claim 23, characterized in that: The method specifically comprises: Determine whether multiple dirty page write requests have timed out based on a preset polling algorithm.
25. The method for marking dirty virtual machines during hot migration according to any one of claims 14 to 24, characterized in that: The method specifically also includes: The dirty page write request and the DMA write request are scheduled according to a preset scheduling algorithm, and the dirty page write request or the DMA write request is output to a subsequent module according to the scheduling result.
26. A VIRTIO backend device, characterized in that: The invention comprises the virtual machine hot migration dirty marking device according to any one of claims 1 to 13.
27. A chip, characterized in that: The invention comprises the virtual machine hot migration dirty marking device according to any one of claims 1 to 13.
28. An electronic device, characterized in that: The method comprises a processor, a memory and a computer program stored in the memory and executable on the processor, wherein the processor implements the virtual machine hot migration dirty marking method as claimed in any one of claims 14 to 25 when executing the computer program.
29. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for marking dirty during hot migration of a virtual machine according to any one of claims 14 to 25 is implemented.
Citation Information
Patent Citations
Virtual machine thermal migration processing method and system
CN107797878A
Virtual machine migration method and device
CN112148421A
Virtual machine thermal migration dirty marking method and device, back-end equipment and chip
CN117389685A
Methods and systems for tracking a virtual memory of a virtual machine
US10592271B1
Cited By
Virtual function migration method and equipment
CN121050836A
Fusion method and device for non-aligned storage of write request split fragments
CN122331837A