Virtual machine live migration method and computing device

By using the processor's hard set function of the processor during the hot migration of the virtual machine, the problem of virtual machine being trapped due to changes in the write permission bit is solved, reducing the performance loss of the host and improving the thermal migration efficiency.

WO2025044430A1PCT designated stage expired Publication Date: 2025-03-06HUAWEI TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/100593
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-08-30
Filing Date
2024-06-21
Publication Date
2025-03-06

AI Technical Summary

Technical Problem

During the virtual machine hot migration process, the virtual machine is trapped due to changes in write permission bits, resulting in a degradation of the host performance.

Method used

Through the processor's hardware set function, when the virtual machine writes the data page, the write permission bit of the data page is dynamically modified to make it meaning it can be written, thereby avoiding it being trapped.

Benefits of technology

It reduces the number of times a virtual machine is trapped during the hot migration process, reduces the performance loss of the host, and improves the thermal migration efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024100593_06032025_PF_FP_ABST
    Figure CN2024100593_06032025_PF_FP_ABST
Patent Text Reader

Abstract

A virtual machine live migration method and a computing device. The method is applied to a host machine, and a virtual machine, a first executor, and a second executor run on a processor of the host machine; the host machine stores write permission bits of multiple data pages of the virtual machine; the processor is provided with a hardware setting function for the write permission bits, and the write permission bit of a first data page among the multiple data pages is a first value indicating that the first data page is non-writable. The method comprises: when the virtual machine performs a write operation on the first data page, the processor modifies the write permission bit of the first data page to a second value indicating that the first data page is writable; the second executor updates a dirty page bitmap of the virtual machine on the basis of the write permission bit of the first data page; and the first executor determines a dirty page of the virtual machine on the basis of the dirty page bitmap, notifies the second executor to modify the write permission bit of the dirty page of the virtual machine to the first value, and migrates the dirty page of the virtual machine, the dirty page of the virtual machine comprising the first data page.
Need to check novelty before this filing date? Find Prior Art

Description

A virtual machine hot migration method and computing device

[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office of China on August 30, 2023, with application number 202311104714.2 and application name “A method for hot migration of virtual machines and computing devices”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to the field of computer technology, and in particular to a virtual machine hot migration method and a computing device. Background Art

[0003] In related art, when hot migrating a virtual machine in a computing device, dirty pages of the virtual machine are typically determined based on changes in the virtual machine's write permission bits, and these dirty pages are then migrated. Specifically, each time a data page is migrated, the write permission bits of the data page are cleared. After the migration, if the virtual machine attempts to write to the data page, the virtual machine will be trapped because it does not have write permission for the data page, and the computing device's kernel will reset the write permission bits for the data page.

[0004] In the above scheme, if a virtual machine is trapped during hot migration, it will increase the performance loss of the host machine. During hot migration, if the virtual machine has a large number of write operations, the performance of the host machine will be more seriously degraded.

[0005] Summary of the Invention

[0006] The present application provides a virtual machine hot migration method and computing device, which can reduce the number of times a virtual machine is trapped during hot migration, thereby solving the problem of host machine performance degradation caused by virtual machine trapping.

[0007] In a first aspect, the present application provides a method for live migration of a virtual machine. This method can be applied to a host computer, which includes a processor running a virtual machine, a first executable, and a second executable. The first executable is an application running in an operating system for managing the virtual machine. The second executable is a program located in the kernel of the operating system and configured to assist the first executable in managing the virtual machine.

[0008] The host computer stores write permission bits for multiple data pages of the virtual machine, and the processor is currently configured with a hardware setting function for the write permission bits. The multiple data pages include a first data page, and the write permission bit of the first data page is currently a first value, which is used to indicate that the first data page is not writable.

[0009] The method includes: when a virtual machine performs a write operation on a first data page, a processor modifies the write permission bit of the first data page to a second value, where the second value indicates that the first data page is writable; a second executive body updates a dirty page bitmap of the virtual machine based on the write permission bit of the first data page; and the first executive body migrates dirty pages of the virtual machine based on the dirty page bitmap. Specifically, the first executive body can determine the dirty pages of the virtual machine based on the dirty page bitmap, then notify the second executive body to modify the write permission bit of the dirty pages of the virtual machine to the first value, and migrate the dirty pages of the virtual machine, where the dirty pages of the virtual machine include the first data page.

[0010] In the above scheme, during the hot migration process of the virtual machine, when the virtual machine writes data to a certain data page, the write permission position of the data page is set to writable (i.e., the second value) through the hardware setting function of the processor, which can avoid the virtual machine from being trapped due to not having the write permission of the data page, thereby solving the problem of virtual machine performance degradation caused by trapping.

[0011] In a possible implementation of the first aspect, before the virtual machine performs a write operation on the first data page, the method further includes: the first executor enabling the hardware set function. Specifically, the first executor may modify a flag corresponding to the hardware set function in a register of the modification processor to a value indicating enabled, so that the processor can execute the hardware set function.

[0012] In the above solution, the first execution body enables the hardware setting function of the processor before the virtual machine performs a write operation on the data page, so that the processor can reset the write permission bit of the data page when the virtual machine performs a write operation.

[0013] In a possible implementation of the first aspect, before the processor modifies the write permission bit of the first data page to the second value, the method further includes: determining, by the processor, a hardware set flag of the first data page; and when the hardware set flag is a third value, determining, by the processor, to modify the write permission bit of the first data page. The third value indicates that the processor can modify the write permission bit.

[0014] In a possible implementation of the first aspect, before the processor modifies the write permission bit of the first data page to the second value, the method further includes: the second execution body modifies the hardware set flags of the multiple data pages to the third value.

[0015] In the above solution, the hardware setting flag of the data page can be used to control the processor to perform hardware setting on the data page through the hardware setting function.

[0016] In a possible implementation of the first aspect, before the virtual machine performs a write operation on the first data page, the method further includes: the second executor determines a hot data page and a cold data page among the multiple data pages; the second executor modifies the hardware set flag of the hot data page of the virtual machine to the third value, and / or modifies the hardware set flag of the cold data page of the virtual machine to a fourth value, wherein the fourth value indicates that the processor cannot modify the write permission bit, and the hot data page includes the first data page. The hot data page is a data page that is written more frequently among the multiple data pages, and the cold data page is a data page that is written less frequently among the multiple data pages.

[0017] In the above solution, the processor only sets the write permission bit for the virtual machine's hot data pages. This is because the second executor needs to read the write permission bits of each data page from memory when updating the dirty page bitmap. When the processor only sets the write permission bit for the hot data pages, the second executor can read only the write permission bits of the hot data pages, thereby reducing the second executor's read time and improving migration efficiency.

[0018] In a possible implementation of the first aspect, the method also includes: in the event that a trap occurs when the virtual machine performs a write operation on the second data page, the second executable body modifies the write permission bit of the second data page to the second value, and updates the dirty page bitmap, and the cold data page includes the second data page.

[0019] In the above solution, if the hardware write permission bit is set only for the virtual machine's hot data pages, when the virtual machine writes to the cold data pages, the virtual machine can be trapped. The second executive body then modifies the write permission bit of the cold data pages, allowing the virtual machine to write to the cold data pages. Because cold data pages are accessed less frequently, the number of traps caused by cold data pages is also low, and the impact on host machine performance is minimal.

[0020] In a possible implementation of the first aspect, the second execution body determining the hot data pages and the cold data pages among the multiple data pages includes: the second execution body updating the activity of the multiple data pages according to the dirty page bitmap; and the second execution body determining the hot data pages and the cold data pages according to the activity of the multiple data pages.

[0021] In the above solution, whether a data page is a hot data page can be determined based on the activity of the data page.

[0022] In a possible implementation of the first aspect, the second executive body determining the hot data page and the cold data page according to the activity of the multiple data pages includes: the second executive body updating a hot page pool corresponding to the virtual machine according to the activity of the multiple data pages, the hot page pool being used to record the hot data pages of the virtual machine; and the second executive body determining that data pages other than the hot data pages recorded in the hot page pool among the multiple data pages are the cold data pages.

[0023] In a possible implementation of the first aspect, the second execution body updates the activity of the multiple data pages according to the dirty page bitmap, including: determining whether the target data page is a dirty page according to the dirty page bitmap, the multiple data pages including the target data page; when the target data page is a dirty page, if the activity of the target data page is not the maximum activity, modifying the activity of the target data page to the maximum activity, or, if the activity of the target data page is the maximum activity, not modifying the activity of the target data page; when the target data page is not a dirty page, if the activity of the target data page is not the minimum activity, reducing the activity of the target data page, or, if the activity of the target data page is the minimum activity, not modifying the activity of the target data page.

[0024] In a possible implementation of the first aspect, the second execution body updates the hot page pool corresponding to the virtual machine according to the activity of the multiple data pages, including: determining whether the hot page pool includes a target data page; if the hot page pool does not include the target data page, if the number of hot data pages recorded by the hot page pool is less than a target threshold, adding the target data page to the hot page pool, or if the number of hot data pages recorded by the hot page pool is equal to or greater than the target threshold, deleting a third data page in the hot page pool and adding the target data page to the hot page pool, wherein the activity of the third data page is less than the activity of other data pages in the hot page pool except the third data page.

[0025] In a possible implementation of the first aspect, before the second executive body updates the dirty page bitmap of the virtual machine based on the write permission bit of the first data page, the method further includes: the second executive body reading a page table entry for the first data page from the memory using a hardware vector acceleration instruction, where the page table entry for the first data page includes the write permission bit of the first data page. The hardware acceleration instruction may, for example, include a NEON instruction that can read page table entries for eight data pages at a time, thereby accelerating the speed at which the second executive body reads page table entries.

[0026] In a second aspect, the present application provides a virtual machine live migration device. The device is applied to a host machine, the host machine including a processor, the host machine storing write permission bits for multiple data pages of the virtual machine, the multiple data pages including a first data page, the write permission bit of the first data page currently having a first value, the first value being used to indicate that the first data page is not writable. The device includes: a first module, a second module, and a third module.

[0027] The first module is configured to modify the write permission bit of the first data page to a second value when the virtual machine performs a write operation on the first data page, wherein the second value indicates that the first data page is writable.

[0028] The second module is configured to update the dirty page bitmap of the virtual machine according to the write permission bit of the first data page.

[0029] The third module is configured to migrate dirty pages of the virtual machine according to the dirty page bitmap. Specifically, the third module may determine dirty pages of the virtual machine marked in the dirty page bitmap, notify the second executor to modify the write permission bit of the dirty page of the virtual machine to the first value, and migrate the dirty pages of the virtual machine, where the dirty pages of the virtual machine include the first data page.

[0030] In a possible implementation manner of the second aspect, before the virtual machine performs a write operation on the first data page, the third module is further configured to: enable the hardware setting function.

[0031] In a possible implementation of the second aspect, before modifying the write permission bit of the first data page to the second value, the first module is further used to: determine a hardware set flag of the first data page; and when the hardware set flag is a third value, determine to modify the write permission bit of the first data page.

[0032] In a possible implementation of the second aspect, before modifying the write permission bit of the first data page to the second value, the second module is further configured to modify the hardware set flags of the multiple data pages to the third value.

[0033] In a possible implementation of the second aspect, before the virtual machine performs a write operation on the first data page, the second module is further used to: determine a hot data page and a cold data page among the multiple data pages; modify the hardware set flag of the hot data page of the virtual machine to the third value, and modify the hardware set flag of the cold data page of the virtual machine to a fourth value, wherein the fourth value indicates that the processor cannot modify the write permission bit, and the hot data page includes the first data page.

[0034] In a possible implementation of the second aspect, in the event that a write operation on a second data page by the virtual machine fails, the second module is used to modify the write permission bit of the second data page to the second value and update the dirty page bitmap, and the cold data page includes the second data page.

[0035] In a possible implementation of the second aspect, the second module is configured to: update the activity of the multiple data pages according to the dirty page bitmap; and determine the hot data page and the cold data page according to the activity of the multiple data pages.

[0036] In a possible implementation of the second aspect, the second module is used to: update a hot page pool corresponding to the virtual machine according to the activity of the multiple data pages, where the hot page pool is used to record the hot data pages of the virtual machine; and determine that data pages other than the hot data pages recorded in the hot page pool among the multiple data pages are the cold data pages.

[0037] In a possible implementation of the second aspect, the second module is specifically used to: determine whether the target data page is a dirty page according to the dirty page bitmap, the target data page being included in the multiple data pages; if the target data page is a dirty page, if the activity of the target data page is not the maximum activity, modify the activity of the target data page to the maximum activity, or, if the activity of the target data page is the maximum activity, do not modify the activity of the target data page; if the target data page is not a dirty page, if the activity of the target data page is not the minimum activity, reduce the activity of the target data page, or, if the activity of the target data page is the minimum activity, do not modify the activity of the target data page.

[0038] In a possible implementation of the second aspect, the second module is specifically used to: determine whether the hot page pool includes a target data page; if the hot page pool does not include the target data page, if the number of hot data pages recorded in the hot page pool is less than a target threshold, add the target data page to the hot page pool, or if the number of hot data pages recorded in the hot page pool is equal to or greater than the target threshold, delete a third data page in the hot page pool and add the target data page to the hot page pool, wherein the activity of the third data page is less than the activity of other data pages in the hot page pool except the third data page.

[0039] In a possible implementation of the second aspect, before updating the dirty page bitmap of the virtual machine according to the write permission bit of the first data page, the second module is specifically used to: read the page table entry of the first data page from the memory through a hardware vector acceleration instruction, and the page table entry of the first data page includes the write permission bit of the first data page.

[0040] In a third aspect, the present application provides a server comprising: a processor and a memory, wherein the processor is configured to execute a computer program stored in the memory to implement the virtual machine live migration method provided in the first aspect or any possible implementation of the first aspect.

[0041] In a fourth aspect, the present application provides a computing device comprising: a processor and a memory, wherein the processor is configured to execute a computer program stored in the memory to implement the virtual machine live migration method provided in the first aspect or any possible implementation of the first aspect.

[0042] In a fifth aspect, the present application provides a computer-readable storage medium, which stores instructions. When the computer-readable storage medium is run on a computer, it enables the computer to execute the virtual machine hot migration method provided by the above-mentioned first aspect or any possible implementation of the first aspect.

[0043] In a sixth aspect, the present application provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute the virtual machine hot migration method provided in the first aspect or any possible implementation of the first aspect.

[0044] Any of the above-mentioned devices, computing equipment, computer storage media, or computer program products is used to execute the method provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects of the corresponding schemes in the corresponding methods provided above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] FIG1 is a schematic diagram of a software structure of a host machine provided in an embodiment of the present application;

[0046] FIG2 is a flow chart of a virtual machine migration method provided in an embodiment of the present application;

[0047] 3 is a schematic diagram of a structure in which a processor and a KVM asynchronously modify write permission bits according to an embodiment of the present application;

[0048] FIG4 is a flowchart of another virtual machine migration method provided in an embodiment of the present application;

[0049] 5 is a flowchart of KVM determining the activity of a data page in another virtual machine migration method provided in an embodiment of the present application;

[0050] 6 is a flowchart of a method for KVM to determine cold data pages and hot data pages according to the activity of data pages in another virtual machine migration method provided in an embodiment of the present application;

[0051] FIG7 is a flowchart of another virtual machine migration method provided in an embodiment of the present application;

[0052] FIG8 is a schematic structural diagram of a virtual machine migration device provided in an embodiment of the present application;

[0053] FIG9 is a schematic diagram of the structure of a computing device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0054] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described below with reference to the accompanying drawings.

[0055] In the description of the embodiments of the present application, words such as "exemplary," "for example," or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary," "for example," or "for example" in the embodiments of the present application should not be construed as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary," "for example," or "for example" is intended to present the relevant concepts in a concrete manner.

[0056] In the description of the embodiments of the present application, the term "and / or" is merely a description of the association relationship between associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, B exists alone, and A and B exist at the same time. In addition, unless otherwise specified, the term "plurality" means two or more. For example, "multiple systems" refers to two or more systems, and "multiple screen terminals" refers to two or more screen terminals.

[0057] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly identifying the technical features being referred to. Thus, features specified as "first" or "second" may explicitly or implicitly include one or more of such features. The terms "include," "comprising," "having," and their variations all mean "including but not limited to," unless otherwise specifically emphasized.

[0058] Before introducing the embodiments of the present application, the terms appearing in the embodiments of the present application are explained below.

[0059] A host machine (HOST) refers to a server that runs a virtual machine in virtualization technology.

[0060] A virtual machine (VM, or GUEST) is a computer system that is virtualized by software and has complete hardware system functions and runs in an isolated environment of a host machine.

[0061] A data page is a storage unit in the host's memory that stores virtual machine business data. Data pages can be divided into hot data pages and cold data pages. Hot data pages are the most frequently written data pages, while cold data pages are the least frequently written data pages.

[0062] A page table entry refers to a data structure that records information about a data page, including the physical address of the data page, write permission bits, hardware set flags, and the like.

[0063] Live migration of a virtual machine (VM) involves migrating a VM while it's still running. In other words, the VM remains operational during the migration process and continues to provide services to users. Specifically, migration involves moving the VM's corresponding data pages from the VM's host to another host.

[0064] FIG1 is a schematic diagram of the software structure of a host machine provided in an embodiment of the present application. As shown in FIG1 , the host machine includes a quick emulator (QEMU), a kernel-based virtual machine (KVM), and a virtual machine (VM) running on a processor. KVM is located in the kernel of the host machine. The host machine may include computing devices such as servers, desktop computers, and laptop computers, and the present application embodiment does not specifically limit this.

[0065] During host maintenance, live migration of virtual machines (VMs) is necessary to ensure that the services running on them are not affected. During the migration process, the VMs continue to run and provide services to users. Specifically, live migration of virtual machines can be used for host hardware upgrades, host software upgrades (e.g., updating the host kernel and / or QEMU), and / or host maintenance and load balancing.

[0066] A virtual machine includes multiple data pages. When the virtual machine is running, these data pages are loaded into the host machine's memory. Generally, virtual machine live migration is performed iteratively, with each iteration migrating only the data pages that have been modified at the current time (i.e., dirty pages). In the first iteration, all of the virtual machine's data pages are dirty, meaning that all of the virtual machine's data pages are migrated in the first iteration.

[0067] In a virtual machine live migration method, whether a data page is dirty is determined based on changes in the write permission bits of the data page. Specifically, the host machine's memory stores a page table for the virtual machine, which includes page table entries corresponding to each data page. Each page table entry records the write permission bits of the corresponding data page. KVM maintains a dirty page bitmap corresponding to the virtual machine based on the write permission bits corresponding to each data page. During each iteration, QEMU obtains the dirty page bitmap from KVM, determines the current dirty page of the virtual machine based on the dirty page bitmap, and notifies KVM to clear the write permission bits of the current dirty page of the virtual machine and migrate the dirty page. After the write permission bits of the data page are cleared, the virtual machine cannot perform write operations on the data page. When the virtual machine attempts to write to the data page, a trap occurs because it does not have write permission for the data page, and KVM is notified to reset the write permission bits of the data page. After KVM resets the write permission bits of the data page, the virtual machine can perform write operations on the data page. In this way, KVM can determine whether the data page is dirty based on changes in the write permission bits of the data page, thereby updating the dirty page bitmap.

[0068] In this method, QEMU notifies KVM to clear the write permission bits of data pages, causing the virtual machine to crash. This crash can cause service loss to the virtual machine and degrade the host machine's performance during hot migration. When the virtual machine writes data pages frequently, the service loss to the virtual machine and the performance degradation of the host machine are more severe. In some applications, the virtual machine's service is sensitive to the performance of the virtual machine and / or the host machine. When service loss occurs and / or the host machine's performance degrades, the virtual machine's hot migration will be terminated, making it impossible to continue hot migration.

[0069] In another VM live migration method, the host machine's hardware module records modified data pages. Specifically, when a VM writes to a data page, the host machine's hardware module records the address of the data page in the hardware module's buffer pool. When the buffer pool is full, the hardware module triggers a trap, and the KVM updates the dirty page bitmap based on the data pages recorded in the buffer pool, marking the data page as dirty.

[0070] Compared to the previous method, this method does not clear the write permissions of the data page, preventing the host from trapping during a virtual machine write operation. This reduces the number of host traps, thus avoiding service losses for the virtual machine and a significant decrease in host performance. However, this method is only applicable to hosts that have the aforementioned hardware module capabilities and cannot be applied to hosts that do not have these hardware modules. Furthermore, while this method reduces the number of host traps, the host still experiences traps, resulting in reduced performance.

[0071] To this end, an embodiment of the present application provides a virtual machine hot migration method that can solve the above problems.

[0072] In the virtual machine hot migration method provided in the embodiment of the present application, after each clearing of the write permission bit of a data page, the data page of the virtual machine is set using the hardware setting function of the processor in the host machine. After the hardware setting function of the processor is turned on, when the virtual machine performs a write operation on a data page and the write permission bit of the data page indicates that it is not writable, the write permission bit of the data page can be reset so that the write permission bit of the data page indicates that it is writable. In this way, it is possible to avoid the virtual machine being unable to perform a write operation on the data page and being stuck, and to solve the problem of business loss caused by the virtual machine being stuck and the performance degradation of the host machine being stuck due to the sticky.

[0073] FIG2 is a flow chart of a method for hot migration of a virtual machine provided in an embodiment of the present application. The method can be applied to the host machine shown in FIG1 , and can be jointly executed by a first execution body and a second execution body run by a processor of the host machine. As shown in FIG2 , the method can include S201-S203. The steps shown in FIG2 are an iterative migration during the hot migration of a virtual machine. The first execution body and the second execution body can iterate the steps shown in FIG2 multiple times during the hot migration of the virtual machine until the migration task of the virtual machine is completed.

[0074] The following takes the first execution body being QEMU in the host machine and the second execution body being KVM in the host machine as an example to specifically introduce the steps shown in FIG2 .

[0075] In S201, when the virtual machine performs a write operation on a first data page, the processor modifies the write permission bit of the first data page to a second value, where the second value indicates that the data page is writable.

[0076] In this embodiment, when QEMU determines to perform hot migration on a virtual machine, it can enable the hardware setting function of the processor and notify KVM to start dirty page tracking. Specifically, QEMU can modify the flag indicating whether the hardware setting function is enabled or disabled in a register in the processor to a value indicating enabled.

[0077] In this embodiment, the host machine's memory stores page table entries for multiple data pages of the virtual machine, each of which records the write permission bit of the corresponding data page. As shown in Figure 3, after receiving a notification from QEMU that dirty page tracking has begun, KVM modifies the write permission bits of each data page of the virtual machine to a first value and creates a dirty page bitmap for the virtual machine, where the first value indicates that the data page is not writable. Specifically, based on the logical address of each data page, the page table entry for each data page is read from the memory, and then the write permission bit value in the page table entry for each data page is modified to the first value, and the modified page table entry is written to the memory.

[0078] In the execution of the above-mentioned situation, when the virtual machine performs a write operation on the first data page among multiple data pages, as shown in FIG3 , the processor can modify the write permission bit of the first data page to the second value, so that the virtual machine can write data to the first data page, which can avoid the virtual machine from being trapped in the host machine due to the inability to write data. Specifically, when the processor modifies the write permission bit of the first data page, it can read the hardware set flag of the first data page from the memory, and determine whether the write permission bit can be modified according to the value of the hardware set flag. The hardware set flag of the data page can be stored in the page table entry of the data page, and the processor can read the page table entry of the data page from the memory, and obtain the value of the hardware set flag of the data page from the page table entry. For example, the value of the hardware set flag can include a third value or a fourth value, wherein the third value indicates that it can be modified, and the fourth value indicates that it cannot be modified.

[0079] In this embodiment, the value of the hardware set flag of each data page can be set to the third value by default. In other embodiments, the value of the hardware set flag of each data page can be set to the fourth value by default. When starting hot migration, QEMU can notify KVM to modify the value of the hardware set flag of each data page to the third value, so that the processor can modify the write permission bit of the data page.

[0080] In S202 , the second execution body updates the dirty page bitmap of the virtual machine according to the write permission bit of the first data page.

[0081] In this step, the KVM can read the write permission bits of multiple data pages of the virtual machine from the memory at a preset time interval, and when the write permission bit of a first data page among the multiple data pages is a second value, mark the first data page as a dirty page in the dirty page bitmap. The dirty page bitmap can be stored in the memory, and the KVM can read and update the dirty page bitmap from the memory each time the dirty page bitmap is updated; and after updating the dirty page bitmap, the dirty page bitmap is stored in the memory.

[0082] Among them, KVM can read the page table entries of multiple data pages from the memory at one time through hardware vector acceleration instructions. For example, the NEON instruction is a 4-channel 128-bit hardware instruction (a total of 512 bits, i.e. 64 bytes). When each page table entry is 8 bytes, KVM can read 8 page table entries from the memory at one time through the NEON instruction. Among them, the hardware vector acceleration instruction may include the virtual address of the data page to be read, and KVM can send the hardware vector acceleration instruction to the memory controller to obtain the page table entry of the data page returned by the memory controller. It can be understood that when KVM modifies the hardware set flag of the data page, it can also increase the speed of reading the page table entries through hardware vector acceleration instructions.

[0083] In S203 , the first execution body migrates dirty pages of the virtual machine according to the dirty page bitmap.

[0084] In this step, QEMU can obtain a dirty page bitmap from the memory, determine the dirty page of the virtual machine according to the identifier of each data page in the dirty page bitmap, and then send a cleanup message to the KVM to instruct the KVM to clean the write permission bit of the dirty page. The cleanup message may include the logical address of the dirty page. The KVM reads the page table entry of the dirty page from the memory according to the logical address in the cleanup message, then modifies the value of the write permission bit in the page table entry of the dirty page to the first value, and writes the modified page table entry into the memory.

[0085] In this step, after notifying KVM to modify the write permission of the dirty page, QEMU can send the dirty page of the virtual machine to the migration device of the virtual machine to realize the migration of the dirty page.

[0086] In this embodiment, QEMU may iteratively execute S203 until the number of dirty pages of the virtual machine is less than or equal to a preset value, then stop running the virtual machine, send the remaining dirty pages of the virtual machine to the migration device, and end the migration task of the virtual machine.

[0087] In the method provided by the embodiment shown in FIG2 , during the live migration of a virtual machine, after clearing the write permissions of a data page, the processor's hardware set function is used to reset the write permission bit of the data page, allowing the virtual machine to write data to the data page without causing a crash. This solves the problem of service loss caused by a virtual machine crash and the problem of performance degradation caused by a host crash. Furthermore, since this method does not cause damage to the virtual machine's services, it can also solve the problem of being unable to perform live migration due to damage to the virtual machine's services.

[0088] In the method provided by the embodiment shown in FIG2 , because the processor resets the write permission bit of each data page, the KVM needs to read the page table entries for each data page from memory and determine the value of the write permission bit for each data page when updating the dirty page bitmap. This determines the data pages modified by the virtual machine, that is, the dirty pages of the virtual machine. During this process, when the number of data pages of the virtual machine is large, the KVM takes a long time to update the dirty page bitmap, which in turn increases the live migration time of the virtual machine and reduces the efficiency of the live migration of the virtual machine.

[0089] To this end, an embodiment of the present application also provides another virtual machine hot migration method, which can solve the problem that the KVM takes a long time to update the dirty page bitmap, resulting in reduced hot migration efficiency.

[0090] In another virtual machine hot migration method provided in an embodiment of the present application, during the hot migration process, KVM determines the hot data page and cold data page of the virtual machine, and modifies the hardware set flag of the cold data page to the fourth value, so that the processor cannot modify the write permission bit of the cold data page. In this case, when the virtual machine performs a write operation on the cold data page, a trap occurs, and the KVM resets the write permission bit of the cold data page to the second value. After resetting the write permission bit of the cold data page, KVM can directly update the flag corresponding to the cold data page in the dirty page bitmap, and mark the cold data page as a dirty page. Compared to KVM marking the cold data page dirty by reading the page table entry of the cold data page from the memory, the time KVM takes to mark the cold data page dirty is shortened, thereby shortening the time KVM takes to update the dirty page bitmap and improving the efficiency of hot migration.

[0091] FIG4 is a flow chart of another method for hot migration of a virtual machine provided in an embodiment of the present application. Similarly, the method can be applied to the host machine described in FIG1 , and the first execution body and the second execution body run by the processor of the host machine are jointly executed. As shown in FIG4 , the method may include S401-S408. The steps shown in FIG4 are an iterative migration during the hot migration of the virtual machine. The first execution body and the second execution body can execute the steps shown in FIG4 multiple times during the hot migration of the virtual machine, and iterate multiple times until the migration task of the virtual machine is completed.

[0092] The following takes the first execution body being QEMU in the host machine and the second execution body being KVM in the host machine as an example to specifically introduce the steps shown in FIG4 .

[0093] In S401, when the virtual machine performs a write operation on a first data page, the processor modifies the write permission bit of the first data page to a second value, where the second value indicates that the data page is writable.

[0094] In S402 , the second execution body updates the dirty page bitmap of the virtual machine according to the write permission bit of the first data page.

[0095] In this embodiment, the detailed description of S401 and S402 can be found in the description of S201 and S202 in the embodiment shown in FIG. 2 , and will not be repeated here.

[0096] In S403 , the second execution body determines the hot data pages and cold data pages of the virtual machine according to the dirty page bitmap.

[0097] In this step, after updating the dirty page bitmap, KVM can update the activity of multiple data pages according to the dirty page bitmap, and then update the hot page pool corresponding to the virtual machine according to the activity of the multiple data pages. The hot page pool is used to record the hot data pages of the virtual machine.

[0098] The process of KVM updating the activity of the data page will be described later in conjunction with FIG. 5 and will not be described in detail here.

[0099] Among them, KVM updates the hot page pool corresponding to the virtual machine, which will be introduced in conjunction with Figure 6 later and will not be described here in detail.

[0100] In S404, the second execution body modifies the hardware set flag of the hot data page of the virtual machine to a third value, and modifies the hardware set flag of the cold data page of the virtual machine to a fourth value. The third value indicates that the processor can modify the write permission bit, and the fourth value indicates that the processor cannot modify the write permission bit. It can be understood that the first data page mentioned in S401 is the hot data page of the virtual machine.

[0101] In S405 , the virtual machine performs a write operation on the cold data page and a trap occurs, and notifies the second execution body to reset the write permission bit of the cold data page.

[0102] In this step, taking the second data page as an example of a cold data page, since the processor cannot reset the write permission bit of the second data page to the second value, a trap will occur when the virtual machine writes data to the second data page, notifying the KVM to reset the write permission bit of the second data page to the second value.

[0103] In S406 , the second execution body modifies the write permission bit of the cold data page to a second value, and updates the dirty page bitmap.

[0104] In this step, when the KVM determines that the virtual machine has failed to write the second data page, it modifies the write permission bit of the cold data page to the second value. Then, the virtual machine writes data to the cold data page. After modifying the write permission bit of the cold data page to the second value, the KVM can update the dirty page bitmap, that is, mark the cold data page as a dirty page in the dirty page bitmap. It should be noted that the KVM can repeat steps S403 and S404 to mark the cold data page as a dirty page in the dirty page bitmap, redetermine the hot data page and the cold data page, and modify the hardware set flags of the hot data page and the cold data page.

[0105] In S407 , the first execution body determines the dirty page of the virtual machine according to the dirty page bitmap, and notifies the second execution body to modify the write permission bit of the dirty page of the virtual machine to the first value.

[0106] In S408 , the first execution body migrates dirty pages of the virtual machine.

[0107] In this embodiment, the detailed description of S407 and S408 can be found in the description of S203 in the embodiment shown in FIG. 2 , and will not be repeated here.

[0108] Figure 5 is a flowchart of a KVM updating the activity of a data page according to a dirty page bitmap provided by an embodiment of the present application. As shown in Figure 5, the process includes S501 to S503. Specifically, KVM can pre-divide the activity of the data page into N values, and each value has a different size. For example, the activity can be divided into 0 to 9, 0 represents the minimum activity, and 9 represents the maximum activity. KVM can update the activity of each data page according to the steps shown in Figure 5 after each update of the dirty page bitmap. The steps shown in Figure 5 are introduced below.

[0109] In S501 , the KVM determines whether the target data page is a dirty page according to the dirty page bitmap.

[0110] Wherein, the target data page is a data page of the virtual machine. When the target data page is marked as a dirty page in the dirty page bitmap, S502 is executed. When the target data page is not marked as a dirty page in the dirty page bitmap, S503 is executed.

[0111] In S502, if the KVM determines that the target data page's activity is not the maximum activity, the target data page's activity is modified to the maximum activity. Alternatively, if the KVM determines that the target data page's activity is the maximum activity, the target data page's activity is not modified. For example, if the target data page's activity is 2, the target data page's activity is modified to the maximum activity of 9. It should be noted that before starting the live migration, the activity of each data page is initially the minimum activity of 0.

[0112] In S503, if the KVM determines that the activity of the target data page is not the minimum activity, the KVM reduces the activity of the target data page. Alternatively, if the KVM determines that the activity of the target data page is the minimum activity, the KVM does not modify the activity of the target data page. Reducing the activity of the target data page includes, when the activity of the target data page is 9, modifying the activity of the target data page to 8, and so on.

[0113] Figure 6 is a flow chart of a KVM updating a hot page pool corresponding to a virtual machine according to the activity of a data page provided by an embodiment of the present application. As shown in Figure 6, the process includes S601 to S603.

[0114] In S601, the KVM determines whether the hot page pool includes the target data page. If the hot page pool does not include the target data page, S602 is executed; if the hot page pool includes the target data page, S603 is executed.

[0115] In S602, if the KVM determines that the number of hot data pages recorded in the hot page pool is less than the target threshold, the target data page is added to the hot page pool. Alternatively, if the KVM determines that the number of hot data pages recorded in the hot page pool is equal to or greater than the target threshold, the third data page is deleted from the hot page pool. The activity level of the third data page is less than the activity levels of other data pages in the hot page pool except the third data page. In other words, the third data page is the data page with the lowest activity level recorded in the hot page pool.

[0116] In S603 , the KVM adds the target data page to the hot page pool.

[0117] Based on the embodiment shown in FIG4 , the embodiment of the present application also provides another method for hot migration of a virtual machine.

[0118] FIG7 is a flowchart of another method for hot migration of a virtual machine provided in an embodiment of the present application. Similarly, the method can be applied to the host machine described in FIG1 , and the first execution body and the second execution body run by the processor of the host machine are jointly executed. As shown in FIG7 , the method may include S701-S709. The steps shown in FIG7 are an iterative migration during the hot migration of the virtual machine. The first execution body and the second execution body can execute the steps shown in FIG7 multiple times during the hot migration of the virtual machine, and iterate multiple times until the migration task of the virtual machine is completed.

[0119] The following takes the first execution body being QEMU in the host machine and the second execution body being KVM in the host machine as an example to specifically introduce the steps shown in FIG. 7 .

[0120] In S701, when the virtual machine performs a write operation on a first data page, the processor modifies the write permission bit of the first data page to a second value, where the second value indicates that the data page is writable.

[0121] In S702 , the second execution body updates the dirty page bitmap of the virtual machine according to the write permission bit of the first data page.

[0122] In S703 , the second execution body determines the hot data pages and cold data pages of the virtual machine according to the dirty page bitmap.

[0123] In this embodiment, the detailed description of S701-S703 can be found in the description of S401-S403 in the embodiment shown in FIG4 , and will not be repeated here.

[0124] In S704 , the second execution body determines whether to modify the hardware setting flags of the hot data pages and the cold data pages of the virtual machine according to the dirty page bitmap.

[0125] In this step, KVM can determine the number of dirty pages based on the dirty page bitmap, and obtain the current total capacity of dirty pages based on the number and the size of a single dirty page. Then, based on the current total capacity of dirty pages and the network bandwidth of the current host machine, it is determined whether to modify the hardware setting flags of the hot data pages and cold data pages of the virtual machine. For example, when the total capacity of dirty pages is less than or equal to the network bandwidth, the hardware setting flags of the hot data pages and cold data pages of the virtual machine are modified to speed up the virtual machine migration process and improve migration efficiency. When the total capacity of dirty pages is greater than the network bandwidth, the hardware setting flags of the hot data pages and cold data pages of the virtual machine are not modified.

[0126] In S705, the second execution body modifies the hardware set flag of the hot data page of the virtual machine to a third value, and modifies the hardware set flag of the cold data page of the virtual machine to a fourth value, wherein the third value indicates that the processor can modify the write permission bit, and the fourth value indicates that the processor cannot modify the write permission bit.

[0127] In S706 , the virtual machine performs a write operation on the cold data page and a trap occurs, and notifies the second execution body to reset the write permission bit of the cold data page.

[0128] In S707 , the second execution body modifies the write permission bit of the cold data page to a second value, and updates the dirty page bitmap.

[0129] In S708 , the first execution body determines the dirty page of the virtual machine according to the dirty page bitmap, and notifies the second execution body to modify the write permission bit of the dirty page of the virtual machine to the first value.

[0130] In S709 , the first execution body migrates dirty pages of the virtual machine.

[0131] In this embodiment, the detailed description of S705-S709 can be found in the description of S404-S408 in the embodiment shown in FIG4 , and will not be repeated here.

[0132] Based on the method embodiments shown in Figures 2, 4 and 7, an embodiment of the present application also provides a virtual machine migration device.

[0133] FIG8 is a schematic diagram of the structure of a virtual machine migration apparatus 800 provided in an embodiment of the present application. The virtual machine migration apparatus 800 is used to execute the specific steps of the method embodiment shown in FIG2, FIG4 or FIG7.

[0134] As shown in FIG8 , the virtual machine migration apparatus 800 includes: a first module 801 , a second module 802 and a third module 803 .

[0135] The first module is configured to modify the write permission bit of the first data page to a second value when the virtual machine performs a write operation on the first data page, where the second value indicates that the first data page is writable.

[0136] The second module is used to update the dirty page bitmap of the virtual machine according to the write permission bit of the first data page.

[0137] The third module is configured to migrate dirty pages of the virtual machine according to the dirty page bitmap. Specifically, the third module may determine dirty pages of the virtual machine marked in the dirty page bitmap, notify the second module to modify the write permission bit of the dirty page of the virtual machine to a first value, and migrate the dirty pages of the virtual machine, where the dirty pages of the virtual machine include the first data page.

[0138] It should be noted that the virtual machine migration device 800 provided in the embodiment shown in FIG8 only uses the division of the above-mentioned functional modules as an example to illustrate when executing the virtual machine hot migration method. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, when the virtual machine migration device 800 provided in the above embodiment executes the specific steps of the method embodiment shown in FIG2, FIG4 or FIG7, it belongs to the same concept as the method embodiment shown in FIG2, FIG4 or FIG7. The specific implementation process is detailed in the method embodiment and will not be repeated here.

[0139] FIG9 is a schematic diagram of the hardware structure of a computing device 900 provided in an embodiment of the present application.

[0140] The computing device 900 may be the host machine shown in FIG1 . Referring to FIG9 , the computing device 900 includes a processor 901, a memory 902, a communication interface 903, and a bus 904. The processor 901, the memory 902, and the communication interface 903 are interconnected via the bus 904. The processor 901, the memory 902, and the communication interface 903 may also be connected using other connection methods besides the bus 904.

[0141] The memory 902 may be various types of storage media, such as random access memory (RAM), read-only memory (ROM), non-volatile RAM (NVRAM), programmable ROM (PROM), erasable PROM (EPROM), electrically erasable PROM (EEPROM), flash memory, optical storage, hard disk, etc. When the memory 902 is a memory, the memory 902 is used to store the data pages of the virtual machine and the page table corresponding to the virtual machine. The page table corresponding to the virtual machine includes page table entries corresponding to each data page of the virtual machine.

[0142] Among them, the processor 901 has the above-mentioned hardware setting function, which is used to modify the write permission bit in the page table entry of the data page. In addition, a first execution body and a second execution body are running on the processor 901. The first execution body may include the above-mentioned QEMU, and the second execution body may include the above-mentioned KVM. Specifically, the processor 901 may be a general-purpose processor, and the general-purpose processor may be a processor that performs specific steps and / or operations by reading and executing the contents stored in a memory (such as memory 902). For example, the general-purpose processor may be a central processing unit (CPU). The processor 901 may include at least one circuit to execute all or part of the steps of the virtual machine hot migration method provided in the embodiment shown in Figure 2 or Figure 4 or Figure 7.

[0143] Communication interface 903 includes input / output (I / O) interfaces, physical interfaces, and logical interfaces, which are used to interconnect components within computing device 900, as well as interfaces for interconnecting computing device 900 with other devices (e.g., other computing devices or user equipment). Physical interfaces can include Ethernet interfaces, fiber optic interfaces, ATM interfaces, and the like.

[0144] The bus 904 may be any type of communication bus for interconnecting the processor 901 , the memory 902 , and the communication interface 903 , such as a system bus.

[0145] The above-mentioned devices can be provided on separate chips, or at least partially or entirely on the same chip. Whether to provide each device independently on different chips or to integrate them on one or more chips often depends on the product design requirements. The embodiments of this application do not limit the specific implementation of the above-mentioned devices.

[0146] The computing device 900 shown in FIG9 is merely exemplary. During implementation, the computing device 900 may further include other components, which are not listed here one by one.

[0147] In the above embodiments, all or part of the embodiments can be implemented by software, hardware, firmware, or any combination thereof. When implemented using software, all or part of the embodiments can be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid state drive (SSD)).

[0148] It is understood that the various numerical numbers involved in the embodiments of the present application are only for the convenience of description and are not intended to limit the scope of the embodiments of the present application. It should be understood that in the embodiments of the present application, the order of the sequence numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0149] The specific implementation methods described above further illustrate the purpose, technical solutions and beneficial effects of this application in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of this application. Any modifications, equivalent replacements, improvements, etc. made on the basis of the technical solutions of this application should be included in the scope of protection of this application.

Claims

1. A virtual machine hot migration method, characterized in that: Applied to a host machine, a processor of the host machine runs a virtual machine, a first execution body, and a second execution body, the host machine stores write permission bits of multiple data pages of the virtual machine, the processor is currently provided with a hardware setting function for the write permission bit, the multiple data pages include a first data page, the write permission bit of the first data page is currently a first value, the first value indicates that the first data page is not writable, the method comprises: When the virtual machine performs a write operation on the first data page, the processor modifies the write permission bit of the first data page to a second value, where the second value indicates that the first data page is writable; The second execution body updates the dirty page bitmap of the virtual machine according to the write permission bit of the first data page; The first executable body migrates dirty pages of the virtual machine according to the dirty page bitmap, where the dirty pages of the virtual machine include the first data page.

2. The method according to claim 1, characterized in that: Before the virtual machine performs a write operation on the first data page, the method further includes: The second execution body determines a hot data page and a cold data page among the plurality of data pages; The second execution body modifies the hardware set flag of the hot data page to a third value, and / or modifies the hardware set flag of the cold data page to a fourth value, the third value indicates that the processor can modify the write permission bit, and the fourth value indicates that the processor cannot modify the write permission bit, and the hot data page includes the first data page.

3. The method according to claim 2, characterized in that The method further comprises: In the case where a trap occurs when the virtual machine performs a write operation on the second data page, the second execution body modifies the write permission bit of the second data page to the second value and updates the dirty page bitmap, and the cold data page includes the second data page.

4. The method according to claim 2 or 3, characterized in that: The second execution body determining the hot data page and the cold data page among the plurality of data pages comprises: The second execution body updates the activity of the plurality of data pages according to the dirty page bitmap; The second execution body determines the hot data page and the cold data page according to the activity of the plurality of data pages.

5. The method according to claim 4, characterized in that The second execution body determines the hot data page and the cold data page according to the activity of the plurality of data pages, including: The second execution body updates the hot page pool corresponding to the virtual machine according to the activity of the multiple data pages, and the hot page pool is used to record the hot data pages; The second execution body determines that data pages other than the hot data pages recorded in the hot page pool among the plurality of data pages are the cold data pages.

6. The method according to claim 4 or 5, characterized in that: The second execution body updates the activity of the plurality of data pages according to the dirty page bitmap, including: determining whether a target data page is a dirty page according to the dirty page bitmap, wherein the plurality of data pages include the target data page; In the case where the target data page is a dirty page, if the activity of the target data page is not the maximum activity, modify the activity of the target data page to the maximum activity, or if the activity of the target data page is the maximum activity, do not modify the activity of the target data page; In the case where the target data page is not a dirty page, if the activity of the target data page is not the minimum activity, the activity of the target data page is reduced, or if the activity of the target data page is the minimum activity, the activity of the target data page is not modified.

7. The method according to claim 5 or 6, characterized in that: The second execution body updates the hot page pool corresponding to the virtual machine according to the activity of the multiple data pages, including: Determining whether the hot page pool includes a target data page; In the case where the target data page is not included in the hot page pool, if the number of hot data pages recorded in the hot page pool is less than the target threshold value, adding the target data page to the hot page pool, or, if the number of hot data pages recorded in the hot page pool is equal to or greater than the target threshold, deleting the third data page in the hot page pool, and adding the target data page to the hot page pool, wherein the activity of the third data page is less than the activity of other data pages in the hot page pool except the third data page.

8. The method according to any one of claims 1 to 7, characterized in that: Before the second executable body updates the dirty page bitmap of the virtual machine according to the write permission bit of the first data page, the method further includes: The second execution body reads the page table entry of the first data page from the memory through a hardware vector acceleration instruction, and the page table entry of the first data page includes a write permission bit of the first data page.

9. A virtual machine hot migration device, characterized in that: Applied to a host machine, the host machine includes a processor, the host machine stores write permission bits of multiple data pages of the virtual machine, the multiple data pages include a first data page, the write permission bit of the first data page is currently a first value, the first value is used to indicate that the first data page is not writable, the device includes: A first module is used to modify the write permission bit of the first data page to a second value when the virtual machine performs a write operation on the first data page, wherein the second value indicates that the first data page is writable; A second module is used to update the dirty page bitmap of the virtual machine according to the write permission bit of the first data page; The third module is used to migrate dirty pages of the virtual machine according to the dirty page bitmap, where the dirty pages of the virtual machine include the first data page.

10. The device according to claim 9, characterized in that Before the virtual machine performs a write operation on the first data page, the second module is further used to: Determining hot data pages and cold data pages among the plurality of data pages; The hardware set flag of the hot data page is modified to a third value, and / or the hardware set flag of the cold data page is modified to a fourth value, the third value indicates that the processor can modify the write permission bit, and the fourth value indicates that the processor cannot modify the write permission bit, and the hot data page includes the first data page.

11. The device according to claim 10, characterized in that In the case where a trap occurs when the virtual machine performs a write operation on the second data page, the second module is used to: The write permission bit of the second data page is modified to the second value, and the dirty page bitmap is updated, and the cold data page includes the second data page.

12. The device according to claim 10 or 11, characterized in that The second module is specifically used for: Updating the activity of the plurality of data pages according to the dirty page bitmap; The hot data page and the cold data page are determined according to the activity levels of the multiple data pages.

13. The device according to claim 12, characterized in that The second module is specifically used for: updating a hot page pool corresponding to the virtual machine according to the activity of the plurality of data pages, the hot page pool being used to record the hot data pages; Determine that data pages other than the hot data pages recorded in the hot page pool among the multiple data pages are the cold data pages 14. The device according to claim 12 or 13, characterized in that The second module is specifically used for: determining whether a target data page is a dirty page according to the dirty page bitmap, wherein the plurality of data pages include the target data page; In the case where the target data page is a dirty page, if the activity of the target data page is not the maximum activity, modify the activity of the target data page to the maximum activity, or if the activity of the target data page is the maximum activity, do not modify the activity of the target data page; In the case where the target data page is not a dirty page, if the activity of the target data page is not the minimum activity, the activity of the target data page is reduced, or if the activity of the target data page is the minimum activity, the activity of the target data page is not modified.

15. The device according to claim 13 or 14, characterized in that The second module is specifically used for: Determining whether the hot page pool includes a target data page; In the case that the target data page is not included in the hot page pool, if the number of hot data pages recorded in the hot page pool is less than a target threshold, the target data page is added to the hot page pool; or, if the number of hot data pages recorded in the hot page pool is equal to or greater than the target threshold, the third data page in the hot page pool is deleted, and the target data page is added to the hot page pool, wherein the activity of the third data page is less than the activity of other data pages in the hot page pool except the third data page.

16. The device according to any one of claims 9 to 15, characterized in that: Before updating the dirty page bitmap of the virtual machine according to the write permission bit of the first data page, the second module is further used to: The page table entry of the first data page is read from the memory through a hardware vector acceleration instruction, wherein the page table entry of the first data page includes a write permission bit of the first data page.

17. A server, characterized in that: The server comprises: a processor and a memory, wherein the processor is configured to execute a computer program stored in the memory to implement the method according to any one of claims 1 to 8.

18. A computing device, characterized in that The computing device comprises: a processor and a memory, wherein the processor is configured to execute a computer program stored in the memory to implement the method according to any one of claims 1 to 8.

19. A computer-readable storage medium, characterized in that: The method comprises instructions, which, when executed on a computer, enable the computer to execute the method according to any one of claims 1 to 8.

20. A computer program product, characterized in that The method comprises instructions, which, when executed on a computer, enable the computer to implement the method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Virtual machine live migration method and computing device

    CN119536898A

  • Dirty page recording method and device, electronic equipment and computer readable medium

    CN113032088A

  • Virtual machine migration method and device, equipment and medium

    CN116107696A

  • Monitoring and dynamic configuration of virtual-machine memory-management

    US20150378762A1