Virtual machine live migration method and computing device

By enabling the hardware assertion function in the host processor, dynamically modifying the write permission bits of the virtual machine data page, the problem of falling caused by changes in the write permission bits during the hot migration of the virtual machine is solved, and performance improvement and migration efficiency are achieved.

CN119536898APending Publication Date: 2025-02-28HUAWEI TECH CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202311104714.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-08-30
Publication Date
2025-02-28

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

By enabling the hardware assertion function in the host's processor, dynamically modifying the write permission bits of the data page, so that the virtual machine avoids being trapped during write operations. The specific steps include: when the virtual machine writes the data page, the processor modifys the write permission bit to be writable, the second execution body updates the dirty page bitmap, and the first execution body migrates the dirty page according to the bitmap.

Benefits of technology

It reduces the number of times a virtual machine is trapped during hot migration, avoids performance degradation caused by trapping, and improves the migration efficiency of the virtual machine.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119536898A_ABST
    Figure CN119536898A_ABST
Patent Text Reader

Abstract

The invention provides a virtual machine live migration method and computing equipment. The method is applied to a host machine, and a virtual machine, a first execution body and a second execution body run in a processor of the host machine. Write permission bits of a plurality of data pages of the virtual machine are stored in the host machine. The processor is provided with a hardware setting function for a write permission bit, and the write permission bit of a first data page in the plurality of data pages is a first value indicating that the first data page is not writable. The method comprises the following steps: when a virtual machine performs write operation on a first data page, a processor modifies a write permission bit of the first data page to represent a writable second value of the first data page; the second executor updates a dirty page bitmap of the virtual machine according to the write permission bit of the first data page; the first executor determines a dirty page of the virtual machine according to the dirty page bitmap, notifies the second executor to modify a write permission bit of the dirty page of the virtual machine to a first value, and migrates the dirty page of the virtual machine, and the dirty page of the virtual machine comprises the first data page.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] 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

[0002] In the related art, when hot migrating a virtual machine in a computing device, the dirty page of the virtual machine is usually determined according to the change of the write permission bit of the virtual machine, and the dirty page is migrated. Specifically, the write permission bit of the data page is cleared each time a data page is migrated. After the migration, when the virtual machine writes to the data page, since the virtual machine does not have the write permission for the data page, the virtual machine will be trapped, and the kernel of the computing device will reset the write permission bit of the data page.

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

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

[0005] In a first aspect, the present application provides a method for hot migration of a virtual machine. The method can be applied to a host machine, wherein the host machine includes a processor, and the processor runs a virtual machine, a first execution body, and a second execution body. The first execution body refers to an application program running in an operating system for managing a virtual machine. The second execution body refers to a program located in the kernel of the operating system, and is used to assist the first execution body in managing the virtual machine.

[0006] The host machine stores write permission bits of multiple data pages of the virtual machine, and the processor is currently provided 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, and the first value is used to indicate that the first data page is not writable.

[0007] The method includes: 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, the second value indicating 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 execution body migrates the dirty pages of the virtual machine according to the dirty page bitmap. The first execution body can specifically determine the dirty pages of the virtual machine according to the dirty page bitmap, and then notify the second execution 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, the dirty pages of the virtual machine include the first data page.

[0008] In the above scheme, during the hot migration of the virtual machine, when the virtual machine writes data to a 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.

[0009] 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 execution body enables the hardware set function. Specifically, the first execution body can modify the flag corresponding to the hardware set function in the register of the modification processor to a value indicating enablement, so that the processor can execute the hardware set function.

[0010] 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.

[0011] In a possible implementation manner 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 processor determining a hardware setting flag of the first data page; when the hardware setting flag is a third value, the processor determines to modify the write permission bit of the first data page. The third value indicates that the processor can modify the write permission bit.

[0012] 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.

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

[0014] 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 execution body determines the hot data page and the cold data page among the multiple data pages: the second execution body 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, the fourth value indicating 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.

[0015] In the above scheme, the processor only performs hardware write permission bit setting on the hot data page of the virtual machine. Because when the second execution body updates the dirty page bitmap, it needs to read the write permission bit of each data page from the memory. When the processor only performs hardware write permission bit setting on the hot data page, the second execution body can only read the write permission bit of the hot data page, thereby reducing the reading time of the second execution body and improving the migration efficiency.

[0016] 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 a 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.

[0017] In the above scheme, when the hardware write permission bit is set only for the hot data page of the virtual machine, when the virtual machine writes to the cold data page, the virtual machine can be trapped, and the second execution body modifies the write permission bit of the cold data page, so that the virtual machine can write to the cold data page. Since the cold data page is accessed less frequently, the number of traps caused by the cold data page is also less, and the performance of the host machine is less affected.

[0018] In a possible implementation of the first aspect, the second execution body determines the hot data page and the cold data page among the multiple data pages, including: the second execution body updates the activity of the multiple 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 multiple data pages.

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

[0020] In a possible implementation of the first aspect, the second executive body determines the hot data page and the cold data page according to the activity of the multiple data pages, including: the second executive 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 of the virtual machine; the second executive body determines that the data pages other than the hot data pages recorded in the hot page pool among the multiple data pages are the cold data pages.

[0021] 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 a target data page is a dirty page according to the dirty page bitmap, the multiple data pages including the target data page; in a case where 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; in a case where 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.

[0022] 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.

[0023] In a possible implementation of the first aspect, before the second executive 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 executive 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 the write permission bit of the first data page. The hardware acceleration instruction may include, for example, a NEON instruction, which can read the page table entries of 8 data pages at a time, and can speed up the speed at which the second executive body reads the page table entries.

[0024] In a second aspect, the present application provides a virtual machine hot migration device. The device is 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, and the first value is used to indicate that the first data page is not writable. The device includes: a first module, a second module and a third module.

[0025] The 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, and the second value indicates that the first data page is writable.

[0026] 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.

[0027] The third module is used to migrate the dirty pages of the virtual machine according to the dirty page bitmap. The third module can specifically determine the 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, wherein the dirty pages of the virtual machine include the first data page.

[0028] 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.

[0029] 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 also 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.

[0030] In a possible implementation of the second aspect, before the writing modifies the write permission bit of the first data page to the second value, the second module is further used to: modify the hardware set flags of the multiple data pages to the third value.

[0031] 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, the fourth value indicating that the processor cannot modify the write permission bit, and the hot data page includes the first data page.

[0032] In a possible implementation of the second aspect, in the event that a trap occurs when the virtual machine performs a write operation on a second data page, 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.

[0033] In a possible implementation of the second aspect, the second module is used 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.

[0034] 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, the hot page pool being used to record hot data pages of the virtual machine; and determine that data pages among the multiple data pages other than the hot data pages recorded in the hot page pool are the cold data pages.

[0035] In a possible implementation of the second aspect, the second module is specifically used to: determine whether a 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.

[0036] 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.

[0037] 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.

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

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

[0040] 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 first aspect or any possible implementation of the first aspect.

[0041] 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 by the first aspect or any possible implementation of the first aspect.

[0042] Any of the above-mentioned devices or computing equipment or computer storage media or computer program products are used to execute the methods 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

[0043] Figure 1 It is a schematic diagram of the software structure of a host machine provided in an embodiment of the present application;

[0044] Figure 2 is a flow chart of a virtual machine migration method provided in an embodiment of the present application;

[0045] Figure 3 This is a structural diagram of a processor and a KVM asynchronously modifying a write permission bit provided by an embodiment of the present application;

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

[0047] Figure 5 It is a flow chart of KVM determining the activity of a data page in another virtual machine migration method provided in an embodiment of the present application;

[0048] Figure 6 This is a flow chart of determining 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:

[0049] Figure 7 is a flow chart of another virtual machine migration method provided in an embodiment of the present application;

[0050] Figure 8It is a structural schematic diagram of a virtual machine migration device provided in an embodiment of the present application;

[0051] Fig. 9 It is a structural diagram of a computing device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0052] 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 in conjunction with the accompanying drawings.

[0053] 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 interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary", "for example" or "for example" is intended to present related concepts in a concrete way.

[0054] In the description of the embodiments of the present application, the term "and / or" is merely a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent: A exists alone, B exists alone, and A and B exist at the same time. In addition, unless otherwise specified, the term "multiple" 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.

[0055] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. The terms "include", "comprises", "has" and their variations all mean "including but not limited to", unless otherwise specifically emphasized.

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

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

[0058] 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.

[0059] A data page is a storage unit in the host's memory that stores the business data of a virtual machine. Data pages can be divided into hot data pages and cold data pages. A hot data page is a data page that is written more frequently among multiple data pages, and a cold data page is a data page that is written less frequently among multiple data pages.

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

[0061] Virtual machine hot migration refers to migrating a virtual machine while it is running. In other words, the virtual machine does not shut down during the hot migration process and continues to provide business services to users. Migration specifically refers to migrating the data pages corresponding to the virtual machine from the host machine where the virtual machine is located to another host machine.

[0062] Figure 1 Schematic diagram of the software structure of a host machine provided in an embodiment of the present application. Figure 1 As shown, the host machine includes a quick emulator (QEMU) running on a processor, a kernel-based virtual machine (KVM) and a virtual machine (VM). Among them, KVM is located in the kernel of the host machine. The host machine may include computing devices such as servers, desktop computers, and laptops, and the embodiments of the present application are not specifically limited.

[0063] When operating and maintaining the host machine, in order not to affect the services running on the virtual machine VM, it is necessary to perform hot migration of the virtual machine. During the migration of the virtual machine, the virtual machine does not stop running and the virtual machine still provides services to users. Specifically, virtual machine hot migration can be applied to scenarios such as host machine hardware upgrades, host machine software upgrades (for example, updating the host machine kernel and / or QEMU), and / or host machine maintenance and load balancing.

[0064] A virtual machine includes multiple data pages. When the virtual machine is running, multiple data pages are loaded into the memory of the host machine. Generally, virtual machine hot migration is usually performed in an iterative migration manner, and each iteration only migrates data pages that have been modified at the current time (i.e., dirty pages). Multiple data pages of the virtual machine are all dirty pages in the first iteration, that is, all data pages of the virtual machine are migrated in the first iteration.

[0065] In a virtual machine hot migration method, whether a data page is a dirty page is determined according to the change of the write permission bit of the data page. Specifically, the memory of the host machine stores the page table of the virtual machine, which includes page table entries corresponding to each data page, and each page table entry records the write permission bit of the corresponding data page. KVM maintains the dirty page bitmap corresponding to the virtual machine according to the write permission bit corresponding to each data page. In each iteration, QEMU obtains the dirty page bitmap from KVM, determines the current dirty page of the virtual machine according to the dirty page bitmap, notifies KVM to clean up the write permission bit of the current dirty page of the virtual machine and migrate the dirty page. After the write permission bit of the data page is cleaned, the virtual machine cannot write to the data page. When the virtual machine writes to the data page, a trap occurs because it does not have the write permission of the data page, and notifies KVM to reset the write permission bit of the data page. After KVM resets the write permission bit of the data page, the virtual machine can write to the data page. In this way, KVM can determine whether the data page is a dirty page according to the change of the write permission bit of the data page, thereby updating the dirty page bitmap.

[0066] In this method, since QEMU notifies KVM to clean up the write permission bit of the data page, the virtual machine will be trapped. The virtual machine trapping will cause business loss of the virtual machine and the performance degradation of the host machine during the hot migration process. When the virtual machine writes data pages more frequently, the business loss of the virtual machine and the performance degradation of the host machine are more serious. In some applications, the business of the virtual machine is more sensitive to the performance of the virtual machine and / or the performance of the host machine. When the business loss of the virtual machine occurs and / or the performance of the host machine is degraded, the hot migration of the virtual machine will be terminated, resulting in the inability to continue the hot migration.

[0067] In another virtual machine hot migration method, the modified data page is recorded by the hardware module of the host machine. Specifically, when the virtual machine writes to the data page, the hardware module of the host machine records the address of the data page in the buffer pool of the hardware module. When the buffer pool is full, the hardware module triggers a trap, and the KVM updates the dirty page bitmap according to the data page recorded in the buffer pool, that is, the data page recorded in the buffer pool is marked as a dirty page.

[0068] Compared with the previous method, this method does not clear the write permissions of the data page, so that the host machine will not be trapped when the virtual machine performs a write operation, reducing the number of host machine traps, and can avoid business losses of the virtual machine and a significant drop in the performance of the host machine. However, this method is only applicable to host machines with the capabilities of the above-mentioned hardware module, and cannot be applied to host machines that do not have the capabilities of the hardware module. In addition, although this method reduces the number of host machine traps, the host machine still has traps, resulting in the problem of performance degradation of the host machine.

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

[0070] In the virtual machine hot migration method provided in the embodiment of the present application, after clearing the write permission bit of the data page each time, the data page of the virtual machine is set by 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 the 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 trapped, and the problem of business loss of the virtual machine due to the trap and performance degradation of the host machine due to the trap can be solved.

[0071] Figure 2 is a flowchart of a virtual machine hot migration method provided in an embodiment of the present application. The method can be applied to Figure 1 The host shown in FIG. 1 is executed by the first execution body and the second execution body run by the processor of the host. Figure 2 As shown, the method may include S201-S203. Figure 2 The steps shown are an iterative migration in the process of hot migration of the virtual machine. The first execution body and the second execution body can be executed multiple times according to the hot migration of the virtual machine. Figure 2 The steps shown are iterated multiple times until the migration task of the virtual machine is completed.

[0072] The following example takes QEMU in the host as the first executable body and KVM in the host as the second executable body. Figure 2 The steps shown are described in detail.

[0073] 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.

[0074] In this embodiment, when QEMU determines to perform hot migration on the 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 the register of the processor to a value indicating enabled.

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

[0076] In the above case, when the virtual machine performs a write operation on the first data page among the multiple data pages, such as Figure 3 As shown, 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 prevent the virtual machine from being trapped in the host machine due to the inability to write data. Specifically, when modifying the write permission bit of the first data page, the processor 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. Among them, 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 may 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.

[0077] In this embodiment, the value of the hardware setting flag of each data page can be set to the third value by default. In other embodiments, the value of the hardware setting 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 setting flag of each data page to the third value, so that the processor can modify the write permission bit of the data page.

[0078] 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.

[0079] 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 the first data page among the multiple data pages is the 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 the dirty page bitmap from the memory and update it each time the dirty page bitmap is updated; and after updating the dirty page bitmap, the dirty page bitmap is stored in the memory.

[0080] 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 entry through the hardware vector acceleration instruction.

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

[0082] 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 KVM to instruct KVM to clean up the write permission bit of the dirty page. The cleanup message may include the logical address of the dirty page. KVM can read the page table entry of the dirty page from the memory according to the logical address in the cleanup message, and then modify the value of the write permission bit in the page table entry of the dirty page to the first value, and write the modified page table entry into the memory.

[0083] 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 dirty page migration.

[0084] 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.

[0085] Above Figure 2 In the method provided by the illustrated embodiment, during the hot migration of the virtual machine, after clearing the write permission of the data page, the write permission bit of the data page is reset using the hardware setting function of the processor, so that the virtual machine can write data to the data page without trapping, thereby solving the problem of business loss caused by the virtual machine trapping, and solving the problem of performance degradation caused by the host machine trapping. On the other hand, since the business of the virtual machine will not be damaged, the method can also solve the problem of being unable to perform hot migration due to damage to the business of the virtual machine.

[0086] In the above Figure 2In the method provided by the illustrated embodiment, since the processor resets the write permission bit of the data page, when the KVM updates the dirty page bitmap, it needs to read the page table entries of each data page from the memory and determine the value of the write permission bit of each data page, thereby determining the data page modified by the virtual machine, that is, determining the dirty page of the virtual machine. In this process, when the number of data pages of the virtual machine is large, it takes a long time for the KVM to update the dirty page bitmap, thereby increasing the hot migration time of the virtual machine and reducing the hot migration efficiency of the virtual machine.

[0087] 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 a decrease in hot migration efficiency.

[0088] 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 with KVM marking the cold data page dirty by reading the page table entry of the cold data page from the memory, the time for KVM to mark the cold data page dirty is shortened, thereby shortening the time for KVM to update the dirty page bitmap and improving the efficiency of hot migration.

[0089] Figure 4 is a flowchart of another virtual machine hot migration method provided in an embodiment of the present application. Similarly, this method can be applied to Figure 1 The host machine is executed by the first execution body and the second execution body run by the processor of the host machine. Figure 4 As shown, the method may include S401-S408. Figure 4 The steps shown are an iterative migration in the process of hot migration of the virtual machine. The first execution body and the second execution body can be executed multiple times according to the hot migration of the virtual machine. Figure 4 The steps shown are iterated multiple times until the migration task of the virtual machine is completed.

[0090] The following example takes QEMU in the host as the first executable body and KVM in the host as the second executable body. Figure 4 The steps shown are described in detail.

[0091] 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.

[0092] 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.

[0093] In this embodiment, the specific description of S401 and S402 can be referred to the aforementioned Figure 2 The introduction of S201 and S202 in the illustrated embodiment will not be repeated here.

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

[0095] 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.

[0096] The process of KVM updating the activity of data pages will be discussed later. Figure 5 I will not go into details here.

[0097] Among them, KVM updates the hot page pool corresponding to the virtual machine, which will be combined later in the text. Figure 6 I will not go into details here.

[0098] 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.

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

[0100] In this step, taking the second data page as the cold data page as an example, 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.

[0101] 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.

[0102] In this step, when the KVM determines that the virtual machine's write operation on the second data page is trapped, the KVM 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 the KVM modifies 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 the steps of 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.

[0103] 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.

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

[0105] In this embodiment, the specific description of S407 and S408 can be referred to the aforementioned Figure 2 The introduction of S203 in the illustrated embodiment will not be repeated here.

[0106] Figure 5 This is a flow chart of a KVM updating the activity of a data page according to a dirty page bitmap provided by an embodiment of the present application. Figure 5 As shown, the process includes S501 to S503. Specifically, KVM can pre-divide the activity of the data page into N values, 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 dirty page bitmap each time according to Figure 5 The steps shown in the figure update the activity of each data page. Figure 5 Each step is described below.

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

[0108] 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.

[0109] In S502, if KVM determines that the activity of the target data page is not the maximum activity, the activity of the target data page is modified to the maximum activity, or, if it determines that the activity of the target data page is the maximum activity, the activity of the target data page is not modified. For example, when the activity of the target data page is 2, the activity of the target data page is modified to the maximum activity of 9. It should be noted that before starting the hot migration, the activity of each data page is initially the minimum activity of 0.

[0110] In S503, if the KVM determines that 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 determined to be the minimum activity, the activity of the target data page is not modified. Wherein, 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.

[0111] Figure 6 This 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. Figure 6 As shown, the process includes S601 to S603.

[0112] 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;

[0113] 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, or 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 in the hot page pool is deleted. 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. In other words, the third data page is the data page with the smallest activity recorded in the hot page pool.

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

[0115] based on Figure 4 The embodiment shown, the embodiment of the present application also provides another method for hot migration of virtual machines.

[0116] Figure 7 is a flowchart of another virtual machine hot migration method provided in an embodiment of the present application. Similarly, this method can be applied to Figure 1 The host machine is executed by the first execution body and the second execution body run by the processor of the host machine. Figure 7 As shown, the method may include S701-S709. Figure 7 The steps shown are an iterative migration in the process of hot migration of the virtual machine. The first execution body and the second execution body can be executed multiple times according to the hot migration of the virtual machine. Figure 7 The steps shown are iterated multiple times until the migration task of the virtual machine is completed.

[0117] The following example takes QEMU in the host as the first executable body and KVM in the host as the second executable body. Figure 7The steps shown are described in detail.

[0118] 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.

[0119] 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.

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

[0121] In this embodiment, the specific description of S701-S703 can be referred to the aforementioned Figure 4 The introduction of S401-S403 in the illustrated embodiment will not be repeated here.

[0122] 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.

[0123] In this step, KVM can determine the number of dirty pages according to 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, determine whether to modify the hardware setting flags of the hot data pages and cold data pages of the virtual machine based on the current total capacity of dirty pages and the network bandwidth of the current host machine. For example, when the total capacity of dirty pages is less than or equal to the network bandwidth, modify the hardware setting flags of the hot data pages and cold data pages of the virtual machine to speed up the virtual machine migration process and improve the 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.

[0124] In S705, the second execution body modifies the hardware setting flag of the hot data page of the virtual machine to a third value and the hardware setting 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.

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

[0126] 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.

[0127] 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.

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

[0129] In this embodiment, the specific description of S705-S709 can be referred to the aforementioned Figure 4 The introduction of S404-S408 in the illustrated embodiment will not be repeated here.

[0130] based on Figure 2 , Figure 4 and Figure 7 The method embodiment shown, the embodiment of the present application also provides a virtual machine migration device.

[0131] Figure 8 800 is a schematic diagram of a virtual machine migration device 800 provided in an embodiment of the present application. The virtual machine migration device 800 is used to perform Figure 2 , Figure 4 or Figure 7 The specific steps of the method embodiment are shown.

[0132] like Figure 8 As shown, the virtual machine migration device 800 includes: a first module 801, a second module 802 and a third module 803.

[0133] The 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, and the second value indicates that the first data page is writable.

[0134] 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.

[0135] The third module is used to migrate the dirty pages of the virtual machine according to the dirty page bitmap. Specifically, the third module can determine the 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 the first value, and migrate the dirty pages of the virtual machine, wherein the dirty pages of the virtual machine include the first data page.

[0136] It should be noted that Figure 8 The virtual machine migration device 800 provided in the embodiment shown in the figure only takes the division of the above-mentioned functional modules as an example when executing the virtual machine hot migration method. In actual application, 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. Figure 2 , Figure 4 or Figure 7 The specific steps of the method embodiment shown are as follows Figure 2 , Figure 4 or Figure 7 The method embodiments shown belong to the same concept, and their specific implementation processes are detailed in the method embodiments, which will not be repeated here.

[0137] Fig. 9 It is a schematic diagram of the hardware structure of a computing device 900 provided in an embodiment of the present application.

[0138] The computing device 900 may be the above Figure 1 See the host machine shown. Fig. 9 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 connected to each other via the bus 904. The processor 901, the memory 902, and the communication interface 903 may also be connected in other connection modes besides the bus 904.

[0139] Among them, the memory 902 can 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.

[0140] 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, which may be a processor that performs specific steps and / or operations by reading and executing the contents stored in a memory (such as the 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 Figure 2 or Figure 4 or Figure 7 The illustrated embodiment provides all or part of the steps of the virtual machine hot migration method.

[0141] The communication interface 903 includes an input / output (I / O) interface, a physical interface, and a logical interface, etc., which are used to interconnect devices within the computing device 900, and an interface for interconnecting the computing device 900 with other devices (such as other computing devices or user devices). The physical interface can be an Ethernet interface, a fiber optic interface, an ATM interface, etc.

[0142] 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.

[0143] The above devices may be arranged on independent chips, or at least partially or completely on the same chip. Whether to arrange each device independently on different chips or to integrate them on one or more chips often depends on the needs of product design. The embodiments of the present application do not limit the specific implementation form of the above devices.

[0144] Fig. 9 The computing device 900 shown is merely exemplary. During implementation, the computing device 900 may further include other components, which are not listed one by one herein.

[0145] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part 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, the process or function described in the embodiment of the present invention is generated in whole or in part. 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 a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. 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 disk (SSD)), etc.

[0146] 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 used to limit the scope of the embodiments of the present application. It should be understood that in the embodiments of the present application, the size of the sequence number of the above-mentioned processes does not mean the order of execution, and 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.

[0147] The specific implementation methods described above further illustrate the purpose, technical solutions and beneficial effects of the present 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 the present application. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solutions of the present application should be included in the scope of protection of the present 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 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.

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.

Citation Information

Cited By

  • Virtual machine live migration method and computing device

    EP4752718A1

  • Virtual machine live migration method and computing device

    WO2025044430A1