GPU real-time migration method, device and electronic device

By adopting the Pre-Copy pre-copy mechanism and hash-based software dirty page verification technology in GPU real-time migration, combined with the sampling and filtering optimization strategy, the problem of low real-time migration of GPU in the existing technology is solved, and efficient and stable vGPU real-time migration is achieved.

CN114461336BActive Publication Date: 2025-03-25CHINA TELECOM CLOUD TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111617580.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-27
Publication Date
2025-03-25
Estimated Expiration
2041-12-27

AI Technical Summary

Technical Problem

When real-time GPU migration is realized, the prior art faces the problems of long service downtime and low transmission efficiency, especially under the limitation of commercial GPUs, which is difficult to achieve efficient real-time vGPU migration.

Method used

The Pre-Copy pre-copy mechanism is used to combine the hash-based software dirty page verification technology to transmit dirty pages in memory through multiple iterations, use sampling filtering optimization strategy, and only dirty pages are sent, thereby real-time migration of the GPU.

Benefits of technology

Through this method, the number of transmissions in the final dirty page table can be significantly reduced, the efficiency and speed of real-time GPU migration can be improved, the limitations of commercial GPUs can be overcome, and the stability and efficiency of real-time migration of vGPUs can be achieved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114461336B_ABST
    Figure CN114461336B_ABST
Patent Text Reader

Abstract

The present invention discloses a GPU real-time migration method, device and electronic device, wherein the GPU real-time migration method comprises: an updating step: updating a memory dirty page table; a detecting step: detecting whether a memory page in the updated memory dirty page table is a dirty page; a transmitting step: transmitting page data of the dirty page; iterating the updating step, the detecting step and the transmitting step, and after the transmission time of the dirty page reaches a preset standard, continuing to update the memory dirty page table to obtain a final memory dirty page table; detecting whether a memory page in the final memory dirty page table is a dirty page, and transmitting the dirty page in the final memory dirty page table; thereby, the dirty pages in the memory pages can be transmitted through multiple rounds of iterations to minimize the number of transmissions in the final dirty page table, that is, the real-time migration of the GPU is realized by adopting a Pre-Copy mechanism.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of virtualization and cloud computing technology, and in particular to a GPU real-time migration method, device and electronic equipment. Background Art

[0002] Live migration, also known as hot migration, is one of the most widely used key features in virtualization and cloud computing. It can migrate a virtual machine from one host to another without affecting or notifying the users of the virtual machine. The effectiveness of live migration is measured by the required service downtime, which is the time the virtual machine must be stopped during the migration process. Service downtime is mainly caused by the memory transfer of the virtual machine.

[0003] For IaaS (Infrastructure as a Service) cloud platform providers, live migration of virtual machines is crucial. Through live migration of virtual machines, IaaS cloud platform providers can: ① provide HA (High Available) virtual machine instances; ② simplify system maintenance and management; ③ improve system load balancing; ④ enhance system error tolerance; ⑤ optimize system power management and contribute to energy conservation. GPU live migration is one of the core technologies in virtual machine migration, which can bring many benefits to IaaS providers who provide GPU virtualization instances. By supporting GPU live migration, cloud providers can provide all of the above features for GPU-enabled virtual machines. Summary of the invention

[0004] In view of this, an embodiment of the present invention provides a GPU real-time migration method, device and electronic device.

[0005] According to a first aspect, an embodiment of the present invention provides a GPU real-time migration method, comprising: an updating step: updating a memory dirty page table; a detecting step: detecting whether a memory page in the updated memory dirty page table is a dirty page; a transmitting step: transmitting page data of the dirty page; iterating the updating step, the detecting step and the transmitting step, and after the transmission time of the dirty page reaches a preset standard, continuing to update the memory dirty page table to obtain a final memory dirty page table; detecting whether a memory page in the final memory dirty page table is a dirty page, and transmitting the dirty page in the final memory dirty page table.

[0006] The GPU real-time migration method of the embodiment of the present invention obtains a memory dirty page table by scanning memory access; detects whether a memory page in the memory dirty page table is a dirty page; transmits page data of the dirty page; after the transmission time of the dirty page reaches a preset standard, continues to scan memory access to obtain a final dirty page table; detects whether a memory page in the final dirty page table is a dirty page, and transmits the dirty page in the final dirty page table; thereby, dirty pages in memory pages can be transmitted through multiple rounds of iterations to minimize the number of transmissions in the final dirty page table, that is, the real-time migration of the GPU is realized by adopting a Pre-Copy mechanism.

[0007] In combination with the first aspect, in the first implementation of the first aspect, the detecting whether the memory page in the updated memory dirty page table is a dirty page memory dirty page table includes: calculating the current hash value of the memory page in the updated memory dirty page table and saving it; obtaining the previous hash value of the memory page in the memory dirty page table before the update; for the same memory page, determining whether the current hash value of the memory page is the same as the previous hash value; when the current hash value is different from the previous hash value, determining that the memory page is a dirty page.

[0008] In combination with the first aspect, in the second implementation of the first aspect, before updating the memory dirty page table, it also includes: scanning GPU video memory accesses to build a memory dirty page table; calculating the hash values ​​of all memory pages in the memory dirty page table and saving them; transmitting all memory pages in the memory dirty page table.

[0009] In combination with the first aspect, in a third implementation of the first aspect, after updating the memory dirty page table, it also includes: saving sampling data of the memory pages in the updated memory dirty page table to obtain sampling records.

[0010] In combination with the third implementation manner of the first aspect, in the fourth implementation manner of the first aspect, the detection of whether the memory page in the final memory dirty page table is a dirty page includes: obtaining the sampling bytes of the memory page in the final memory dirty page table; for the same memory page, determining whether the sampling record contains the sampling data of the memory page, and when the sampling record does not contain the sampling data of the memory page, determining that the memory page is a dirty page.

[0011] In combination with the fourth implementation manner of the first aspect, in the fifth implementation manner of the first aspect, the GPU real-time migration method also includes: when the sampling record contains sampling data of the memory page, determining whether the sampling bytes of the memory page are the same as the sampling data; when the sampling bytes of the memory page are different from the sampling data, determining that the memory page is a dirty page; when the sampling bytes of the memory page are the same as the sampling data, calculating the current hash value of the memory page and obtaining the previous hash value of the memory page; when the current hash value is different from the previous hash value, determining that the memory page is a dirty page.

[0012] In combination with the first aspect, in a sixth implementation of the first aspect, the detecting step and the transmitting step are performed in parallel.

[0013] According to the second aspect, an embodiment of the present invention provides a GPU real-time migration device, including a scanning module, a detection module and a transmission module; the scanning module is used to update a memory dirty page table; the inspection module is used to detect whether the memory page in the updated memory dirty page table is a dirty page; the transmission module is used to transmit the page data of the dirty page; after the transmission time of the dirty page reaches a preset standard, the scanning module is also used to continue to update the memory dirty page table to obtain a final memory dirty page table; the inspection module is also used to detect whether the memory page in the final memory dirty page table is a dirty page; the transmission module is also used to transmit the dirty page in the final memory dirty page table.

[0014] According to the third aspect, an embodiment of the present invention further provides an electronic device, comprising a memory and a processor, wherein the memory and the processor are communicatively connected to each other, computer instructions are stored in the memory, and the processor executes the GPU real-time migration method described in the first aspect or any one of the embodiments of the first aspect by executing the computer instructions.

[0015] According to a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the GPU real-time migration method described in the first aspect or any one of the embodiments of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] The features and advantages of the present invention will be more clearly understood by referring to the accompanying drawings, which are schematic and should not be construed as limiting the present invention in any way. In the accompanying drawings:

[0017] Figure 1 Schematic diagram of the process of real-time GPU migration method in Embodiment 1 of the present invention;

[0018] Figure 2 This is the architecture diagram of GPU real-time migration in cloud host migration in Example 1;

[0019] Figure 3 Migrate workflow for vGPU;

[0020] Figure 4 To verify the workflow for hashing;

[0021] Figure 5 This is a schematic diagram of the structure of the GPU real-time migration device in Example 2 of the present invention. DETAILED DESCRIPTION

[0022] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0023] Example 1

[0024] Embodiment 1 of the present invention provides a GPU real-time migration method. The method adopts a Pre-Copy mechanism, combines a hash-based software dirty page verification technology, uses a sampling filtering optimization strategy, only sends dirty pages, speeds up vGPU migration, realizes vGPU real-time migration, and overcomes the limitations of commercial GPUs.

[0025] The key idea of ​​the Pre-Copy method is to minimize the number of memory pages transferred during downtime. This method divides the migration process into two phases: ① Pre-Copy phase, ② Stop and Copy phase. The Pre-Copy phase refers to the process of copying data while the virtual machine continues to run on the source. In this phase, memory dirty pages are transferred through multiple rounds of iterations to minimize the number of transfers in the Stop and Copy phase. The Stop and Copy phase refers to the process of transferring the memory dirty page data of the last round of iteration in the Pre-Copy phase when the virtual machine is restarted at the destination.

[0026] Figure 1 FIG. 1 is a flow chart of a GPU real-time migration method in Embodiment 1 of the present invention. Figure 1 As shown, the GPU real-time migration method of embodiment 1 of the present invention includes the following steps:

[0027] S101: Update the memory dirty page table.

[0028] Before updating the memory dirty page table, the method also includes: scanning GPU video memory access and building a memory dirty page table; calculating and saving hash values ​​of all memory pages in the memory dirty page table; and transmitting all memory pages in the memory dirty page table.

[0029] Specifically, memory access may be scanned through an interface of a GPU Driver (eg, NVIDIA vgpu-kvm Driver) to obtain a memory dirty page table.

[0030] Furthermore, after obtaining the memory dirty page table, it also includes: saving the sampling data of the memory page in the updated memory dirty page table to obtain a sampling record. For example, the first 1 byte of each memory page can be taken as the sampling data. The purpose of obtaining the sampling record here is to provide a basis for verifying whether the memory page is a dirty page in the stop and copy phases.

[0031] S102: Detect whether the updated memory page in the memory dirty page table is a dirty page.

[0032] Among the existing GPU virtualization solutions, those based on Pass-Through or SR-IOV (Single-root I / O virtualization) are not migration-friendly because the Hypervisor cannot perceive some hardware context states. To this end, MPT (Mediated Pass-Through) is the only solution. The Hypervisor can directly manipulate the GPU device state through the driver and control the vGPU (virtual GPU) execution flow, making it a perfect choice for GPU real-time migration. NVIDIA GRID is one of the examples of using MPT to virtualize IO devices. Through the successful virtualization of GPUs, NVIDIA GRID shows that MPT is an effective IO virtualization method.

[0033] The dirty pattern of GPU workload refers to the pattern of dirty memory pages of the GPU under workload. First, the dirty pattern of the GPU is similar to the dirty pattern of the CPU, that is, only part of the video memory is dirty. Second, under GPU-intensive workloads, the GPU's memory writes show stronger locality and higher frequency than the CPU. Once a GPU page is dirty, it is likely to be dirty more frequently. Based on the dirty pattern of GPU workload, it can be obtained that: ① The Pre-Copy method can be applied to GPU live migration and can reduce service downtime; ② The dirty pattern of the GPU shows that it is more suitable for live migration than the CPU.

[0034] Nevertheless, implementing GPU live migration on MPT-based platforms still faces challenges. First, due to the complexity of the GPU programming model and the lack of some special hardware features, as well as the commercial closed-source nature of some GPU drivers (e.g., NVIDIA GridDriver), it is difficult to implement live migration of vGPU instances while shielding the internal details of the driver.

[0035] Based on this, in Embodiment 1 of the present invention, the following scheme can be adopted to detect whether the memory page in the memory dirty page table is a dirty page: calculate the current hash value of the memory page in the updated memory dirty page table and save it; obtain the previous hash value of the memory page in the memory dirty page table before the update; for the same memory page, determine whether the current hash value of the memory page is the same as the previous hash value; when the current hash value is different from the previous hash value, determine that the memory page is a dirty page. The purpose of calculating and saving the current hash value of the memory page in the memory dirty page table is to provide a basis for judgment for the hash-based software dirty page verification technology in the next round.

[0036] In Example 1 of the present invention, a hash-based technology is introduced to verify and track modifications to memory space. In the page table, the dirty bit reflects whether the relevant memory page has been modified. However, traversing the entire memory page data and comparing it with the old record to verify the identity may consume time and space. Therefore, by calculating and recording the hash fingerprint of the memory page, and comparing the current fingerprint with the old fingerprint to verify the identity, real-time migration of vGPU instances can be achieved while shielding the internal details of the driver, overcoming the limitations of commercial GPUs.

[0037] S103: Transmitting page data of the dirty page.

[0038] It should be noted that the above step S102 and step S103 can be performed in parallel.

[0039] That is, dirty page detection and dirty page transfer can be processed simultaneously, that is, a producer-consumer model is adopted, whereby the hashing workload and the page transfer workload can be processed in an overlapping mode, reducing unnecessary suspension waiting for independent processing tasks and irrelevant system resources.

[0040] S104: After the transmission time of the dirty page reaches a preset standard, continue to update the memory dirty page table to obtain a final memory dirty page table.

[0041] In the first embodiment of the present invention, after step S103, the process returns to step S101, and steps S101, S102 and S103 are repeatedly executed until the transmission time of the dirty page reaches a preset standard, and then the process jumps to step S104.

[0042] In the first embodiment of the present invention, steps S101, S102 and S103 are repeatedly executed, which is equivalent to the pre-copy stage in the Pre-Copy mechanism. After the transmission time of a certain round of memory pages reaches a certain standard in the pre-copy stage, the stop and copy stage is entered, and step S104 is entered.

[0043] S105: Detect whether the memory pages in the final memory dirty page table are dirty pages, and transmit the dirty pages in the final memory dirty page table.

[0044] When the sampling data of all memory pages in the memory dirty page table are saved in the above step S101 to obtain the sampling record, the following scheme can be adopted to detect whether the memory page in the final dirty page table is a dirty page: obtain the sampling bytes of the memory page in the final memory dirty page table; for the same memory page, determine whether the sampling data of the memory page is included in the sampling record, and when the sampling record does not contain the sampling data of the memory page, determine that the memory page is a dirty page.

[0045] Furthermore, when the sampling record contains sampling data of the memory page, it is determined whether the sampling bytes of the memory page are the same as the sampling data; when the sampling bytes of the memory page are different from the sampling data, the memory page is determined to be a dirty page; when the sampling bytes of the memory page are the same as the sampling data, the current hash value of the memory page is calculated and the previous hash value of the memory page is obtained; when the current hash value is different from the previous hash value, the memory page is determined to be a dirty page.

[0046] Therefore, memory dirty pages can be initially filtered through sampling records, which reduces GPU live migration downtime and the overhead of the introduced hash-based software dirty page operations.

[0047] In order to explain the GPU real-time migration method of embodiment 1 of the present invention in detail, a specific example is given. Figure 2 This is the architecture diagram of GPU real-time migration in Example 1 cloud host migration.

[0048] like Figure 2 As shown, the architecture diagram includes a dirty page detector and a vGPU migration manager. The dirty page detector is responsible for performing memory page sampling, filtering, and hash verification on the dirty memory areas determined by the vGPU migration manager to determine the memory dirty pages. The vGPU migration manager is responsible for controlling the vGPU migration process. It first scans memory accesses through the interface of the GPU Driver (for example, NVIDIA vgpu-kvm Driver), determines the dirty areas, and reads the vGPU context state for post-migration reconstruction. It then transfers the dirty pages of the video memory detected in the dirty page detector using the hash fingerprint-based technology (i.e., software dirty pages) to the destination. In addition, dirty page detection and dirty page transfer can be processed simultaneously, that is, the dirty page detector and the vGPU migration manager are designed as two independent threads that can be executed in parallel to avoid hanging.

[0049] based on Figure 2 The architecture shown implements the following Figure 3The vGPU migration workflow shown in the figure has the following steps: ① First, the vGPU migration manager traverses the dirty records of the constructed vGPU memory pages to find the dirty page address; ② Once a page that may be dirty is found, the dirty page detector filters the dirty page through the sampling records; ③ Then, the dirty page detector performs hash fingerprint-based verification; ④ After that, the search and verification phase ends and the transmission phase begins, where the vGPU migration manager copies and transmits the dirty page data; ⑤ Finally, the vGPU migration manager recovers the dirty page data at the destination. Through the overlapping design, the ③ and ④ phases can be overlapped, and the system handles verification and transmission at the same time.

[0050] The following describes the overall workflow and two modules, including the dirty page detector module and the vGPU migration manager module.

[0051] (I) Overall workflow

[0052] 1. Overall design

[0053] The entire workflow is designed as two threads: the vGPU migration manager main thread and the dirty page detector worker thread. The entire execution process adopts a producer-consumer model, in which the main thread traverses the dirty page table to select dirty memory pages. In the pre-copy phase, the main thread submits the selected pages to the worker thread, the worker thread concurrently saves the sampling records and calculates the hash fingerprint, and the main thread concurrently transmits the page data. In the stop copy phase, the main thread submits the selected pages to the worker thread, and then obtains the detection results to determine the necessity of transmission.

[0054] 2. Pre-copy stage

[0055] In the pre-copy phase, the first round of memory page transmission is performed first. The vGPU migration manager main thread scans memory accesses, treats all video memory pages as dirty pages, and builds vGPU memory page dirty page table records. The main thread traverses the dirty page table to select dirty memory pages, submits the selected pages to the dirty page detector worker thread, and the main thread starts to transmit page data. The worker thread works concurrently: recording the sampling records configured for each page, generating and storing hash fingerprints of all pages. In the remaining transmission rounds, the main thread scans memory accesses, determines the dirty area of ​​video memory, and updates the vGPU memory page dirty page table records. After that, the main thread traverses the dirty page table to select dirty memory pages, submits the selected pages to the dirty page detector worker thread, and the main thread starts to transmit page data. The worker thread works concurrently: updating the sampling records configured for each page, and calculating and updating the hash fingerprint of each page.

[0056] 3. Stop and copy phase

[0057] When the transmission time of a certain round of memory pages in the pre-copy phase reaches a certain standard, the stop and copy phase begins. In the stop and copy phase, the vGPU migration manager main thread scans memory accesses, determines the dirty area of ​​video memory, and updates the dirty page table record of the vGPU memory page; then the main thread traverses the dirty page table to select dirty memory pages, submits the selected pages to the dirty page detector worker thread, and waits for the detection results. The worker thread first updates the sampling records configured for each page, performs sampling filtering, calculates and updates the hash fingerprints of possible dirty pages, performs hash verification, and then sends the detected dirty page results to the main thread, which performs the final dirty page copy and transmission, and finally restores the dirty page data at the destination, rebuilds the vGPU context, and completes the vGPU real-time migration.

[0058] (II) Dirty Page Detector Module

[0059] The dirty page detector detects the modification of the page by the software and collects a set of dirty vGPU memory pages, thus overcoming the hardware limitations of ordinary GPUs and implementing a software-based dirty page detection mechanism. The dirty page detector mainly performs sampling, filtering and hash verification on the memory pages in the dirty memory area determined by the vGPU migration manager to determine the real dirty memory pages.

[0060] 1. Sampling and filtering

[0061] The dirty pattern of GPU workloads indicates that GPU memory writes show stronger locality and higher frequency than CPU. This means that a dirty page may be modified repeatedly throughout the migration process. Based on this, it can be concluded that most pages marked as dirty in the pre-copy phase have been further modified and will be verified as dirty in the stop and copy phase.

[0062] Sampling filtering is performed before hash verification. A new field is added to the structure that records the log data related to the memory page to record the memory sampling record of each page. The dirty page table is another field of this data structure.

[0063] In the pre-copy phase, before calling the hash check method, the sampling records configured for each page are recorded. In the stop and copy phase, each page is sampled and filtered according to the sampling records, which are divided into three cases: ① The page is a newly added memory dirty page, skip the hash check, and hand it over to the vGPU migration manager to perform the copy and transfer tasks; ② The sampling bytes of the page are inconsistent with the recorded sampling records, proving that it is a dirty page, skip the hash check, and hand it over to the vGPU migration manager to perform the copy and transfer tasks; ③ The sampling bytes of the page are consistent with the recorded sampling records, and further hash check is required to verify whether it is a dirty page.

[0064] 2. Hash verification

[0065] Hash verification verifies dirty pages by monitoring changes in page hash values ​​to implement software dirty pages. The workflow is as follows Figure 4 As shown. Pre-copy phase: ① Generate and store hash values ​​of all pages during the first round of memory page transfer; ② Transfer all pages; ③ Recalculate hash values ​​in the remaining transfer rounds and update the maintained page hash value records. Stop and copy phase: ④ Transfer pages whose hash values ​​have changed.

[0066] (III) vGPU Migration Manager Module

[0067] The vGPU migration manager controls the overall migration process of the vGPU, mainly performing memory scanning, dirty page copying and transmission, destination dirty page data recovery, and vGPU context reconstruction. It first scans memory access through the interface of the GPU Driver (for example, NVIDIA vgpu-kvm Driver), determines the dirty area, and reads the vGPU context state at the same time, and then transmits the dirty pages of the video memory detected by the dirty page detector using the hash fingerprint-based technology (i.e., software dirty pages) to the destination. Finally, after the transmission is completed, the dirty page data is restored at the destination, the vGPU context is rebuilt, and the vGPU real-time migration is realized.

[0068] In the pre-copy phase, during the first round of memory page transfer, the vGPU migration manager scans memory accesses, logically treats all video memory pages as dirty pages, copies and transfers all memory pages, and hands over the pages to the dirty page detector, which generates and stores sampling records and hash fingerprints of all pages. In the remaining transfer rounds, memory accesses are scanned to determine dirty memory areas, dirty records of constructed vGPU memory pages are traversed, all pages in the dirty areas are copied and transferred, and these pages are handed over to the dirty page detector, hash values ​​are recalculated, and the maintained page hash fingerprints are updated.

[0069] During the stop and copy phase, the vGPU migration manager scans memory accesses, determines dirty memory areas, traverses dirty records of constructed vGPU memory pages, submits selected pages to the dirty page detector, obtains detection results, determines the necessity of transfer, performs page transfers, and finally restores dirty page data at the destination, rebuilds the vGPU context, and completes vGPU live migration.

[0070] It can be seen that the CPU real-time migration method provided by the embodiment of the present invention has the following beneficial effects:

[0071] 1. Support real-time migration of GPU cloud hosts: By supporting real-time migration of GPUs, IaaS cloud providers can: ① provide HA virtual machine instances for GPU-enabled virtual machines; ② simplify system maintenance and management; ③ improve system load balancing; ④ enhance system error tolerance; and ⑤ optimize system power management.

[0072] 2. General software-based memory dirty page mechanism: During the migration process, a hash-based technology is introduced to verify and track modifications to the memory space. In the page table, the dirty bit reflects whether the relevant memory page has been modified. However, traversing the entire memory page data and comparing it with the old record to verify the identity may consume time and space. Therefore, by calculating and recording the hash fingerprint of the memory page, and comparing the current fingerprint with the old fingerprint to verify the identity, the limitations of commercial GPUs are overcome.

[0073] 3. Based on the sampling migration optimization strategy, a new field is added to the structure of the log data related to the memory page to record the memory sampling record of each page, and this record is used to initially filter the memory dirty pages to reduce the GPU real-time migration downtime;

[0074] 4. The parallel execution migration model, based on the producer-consumer model, processes the hashing workload and the page transfer workload in an overlapping mode, reducing unnecessary suspension waiting for independent processing tasks and irrelevant system resources.

[0075] In addition, this method has been applied in cloud platforms, is well compatible with existing technologies and runs stably; it improves the functional support of self-developed cloud platforms in large-scale, high-concurrency scenarios and improves the quality of existing products.

[0076] 1. Deploy the scheduling system that implements this method in the self-developed cloud platform of Tianyi Cloud;

[0077] 2. Set the GPU real-time migration function in the configuration file to enabled;

[0078] 3. Set the configuration items related to GPU real-time migration. The sampling optimization strategy is set to take the first byte of each memory page as the sampling record, the hash fingerprint algorithm uses the xxHash algorithm, and the maximum migration time of the migration process is set to 800 (s);

[0079] 4. On the control node of the cloud platform cluster, the real-time migration command of the cloud host with GPU was concurrently executed through the Linux shell script. 100 GPU cloud hosts were migrated at the same time. All migrations were successful with an average downtime of 150ms. The migration process was stable, efficient and reliable.

[0080] Example 2

[0081] Embodiment 2 of the present invention provides a GPU real-time migration device, Figure 5 FIG. 2 is a schematic diagram of the structure of a GPU real-time migration device in Embodiment 2 of the present invention. Figure 5 As shown, the GPU real-time migration device of Embodiment 2 of the present invention includes a scanning module 20 , a checking module 21 and a transmission module 22 .

[0082] Specifically, the scanning module 20 is used to update the memory dirty page table;

[0083] A checking module 21, used for detecting whether a memory page in the updated memory dirty page table is a dirty page;

[0084] A transmission module 22, used for transmitting the page data of the dirty page;

[0085] The scanning module 20 is further used to continue updating the memory dirty page table to obtain a final memory dirty page table after the transmission time of the dirty page reaches a preset standard;

[0086] The checking module 21 is further used to detect whether the memory page in the final memory dirty page table is a dirty page;

[0087] The transmission module 22 is further used to transmit the dirty pages in the final memory dirty page table.

[0088] For details of the above GPU real-time migration device, please refer to Figures 1 to 4 The corresponding related descriptions and effects in the illustrated embodiments can be understood and will not be repeated here.

[0089] Example 3

[0090] An embodiment of the present invention further provides an electronic device, which may include a processor and a memory, wherein the processor and the memory may be connected via a bus or in other ways.

[0091] The processor may be a central processing unit (CPU). The processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or a combination of the above chips.

[0092] The memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs, non-transitory computer executable programs and modules, such as program instructions / modules corresponding to the GPU real-time migration method in the embodiment of the present invention (for example, Figure 5The processor executes various functional applications and data processing of the processor by running the non-transient software programs, instructions and modules stored in the memory, that is, the GPU real-time migration method in the above method embodiment is implemented.

[0093] The memory may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created by the processor, etc. In addition, the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0094] The one or more modules are stored in the memory and when executed by the processor, perform the following steps: Figure 1-4 The GPU real-time migration method in the illustrated embodiment.

[0095] For details of the above electronic equipment, please refer to Figures 1 to 5 The corresponding related descriptions and effects in the illustrated embodiments can be understood and will not be repeated here.

[0096] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM), a random access memory (RAM), a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD), etc.; the storage medium can also include a combination of the above-mentioned types of memory.

[0097] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A GPU real-time migration method, characterized in that: include: Update step: Update the memory dirty page table; Detection step: Detect whether the memory page in the updated memory dirty page table is a dirty page; Transmitting step: transmitting page data of the dirty page; Iterate the updating step, the detecting step and the transmitting step, and after the transmission time of the dirty page reaches a preset standard, continue to update the memory dirty page table to obtain a final memory dirty page table; Detecting whether a memory page in the final memory dirty page table is a dirty page, and transmitting the dirty page in the final memory dirty page table; The detecting whether the memory page in the updated memory dirty page table is a dirty page memory dirty page table comprises: Calculate the current hash value of the memory page in the updated memory dirty page table and save it; Obtain the previous hash value of the memory page in the memory dirty page table before the update; For the same memory page, determine whether the current hash value of the memory page is the same as the previous hash value; When the current hash value is different from the previous hash value, the memory page is determined to be a dirty page.

2. The method according to claim 1, characterized in that: Before updating the memory dirty page table, it also includes: Scan GPU memory access and build a memory dirty page table; Calculate the hash values ​​of all memory pages in the memory dirty page table and save them; All memory pages in the memory dirty page table are transferred.

3. The method according to claim 1, characterized in that After updating the memory dirty page table, it also includes: The sampling data of the memory pages in the updated memory dirty page table is saved to obtain a sampling record.

4. The method according to claim 3, characterized in that: The detecting whether the memory page in the final memory dirty page table is a dirty page comprises: Obtaining sampled bytes of memory pages in the final memory dirty page table; For the same memory page, it is determined whether the sampling record contains the sampling data of the memory page. When the sampling record does not contain the sampling data of the memory page, it is determined that the memory page is a dirty page.

5. The method according to claim 4, characterized in that Also includes: When the sampling record contains the sampling data of the memory page, determining whether the sampling bytes of the memory page are the same as the sampling data; When the sampled bytes of the memory page are different from the sampled data, the memory page is determined to be a dirty page; When the sampled bytes of the memory page are the same as the sampled data, calculating the current hash value of the memory page and obtaining the previous hash value of the memory page; When the current hash value is different from the previous hash value, the memory page is determined to be a dirty page.

6. The method according to claim 1, characterized in that The detecting step is performed in parallel with the transmitting step.

7. A GPU real-time migration device, characterized in that: include: Scanning module, used to update the memory dirty page table; A checking module, used for detecting whether a memory page in the updated memory dirty page table is a dirty page; A transmission module, used for transmitting the page data of the dirty page; The scanning module is further used to continue updating the memory dirty page table to obtain a final memory dirty page table after the transmission time of the dirty page reaches a preset standard; The inspection module is further used to detect whether the memory page in the final memory dirty page table is a dirty page; The transmission module is further used to transmit the dirty pages in the final memory dirty page table; The verification module is specifically used to: calculate the current hash value of the memory page in the updated memory dirty page table and save it; obtain the previous hash value of the memory page in the memory dirty page table before updating; For the same memory page, determine whether the current hash value of the memory page is the same as the previous hash value; when the current hash value is different from the previous hash value, determine that the memory page is a dirty page.

8. An electronic device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the GPU real-time migration method according to any one of claims 1 to 6 by executing the computer instructions.

9. A computer-readable storage medium, characterized in that: The method comprises a memory and a processor, wherein the memory stores computer instructions, and the computer instructions are used to enable the computer to execute the GPU real-time migration method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Virtual machine migration method and device based on distributed file system

    CN102521038A

  • On-line migration method, device and system of virtual machine

    CN106469085A