Data processing method and device
By creating shared memory between virtual machines and determining storage policies based on access information, and dynamically migrating memory pages, the problem of high performance overhead of virtual machine fault tolerance technology under the CXL memory architecture is solved, and more efficient memory resource utilization and virtual machine reliability are achieved.
Patent Information
- Application Number
- CN202510100903.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-22
- Publication Date
- 2025-05-09
AI Technical Summary
When existing virtual machine fault tolerance technologies adapt to new cloud computing architectures (CXL memory), it is difficult to effectively reduce the runtime performance overhead of virtual machines.
By creating shared memory between the main virtual machine and the standby virtual machine and determining the target storage policy based on the access information of the memory page, dynamic migration of the memory page is achieved, thereby optimizing the allocation and utilization of memory resources.
It reduces the performance overhead of the virtual machine fault tolerance mechanism on the virtual machine, improves resource utilization efficiency, and reduces the network transmission of memory page data, and enhances the reliability of the virtual machine.
Smart Images

Figure CN119960913A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of virtual machines, and in particular to a data processing method and device. Background Art
[0002] Virtualization technology is the foundation of cloud computing development. Using cloud computing and virtualization technology can effectively improve resource utilization, reduce management costs, and increase flexibility. With the continuous development of cloud computing, higher requirements are placed on the reliability of virtual machines. Summary of the invention
[0003] In view of this, the present disclosure provides a data processing method and device.
[0004] According to a first aspect of the present disclosure, a data processing method is provided, including: being applied to a first computing node, the first computing node having a master virtual machine, the memory of the master virtual machine including a first local memory and a shared memory, the method including: obtaining a state synchronization event of the master virtual machine; migrating a target memory page in the master virtual machine from the first local memory to the shared memory, or from the shared memory to the first local memory, according to a target storage policy; the target storage policy including at least one of the following: a first target storage policy: storing the first memory page in the first local memory; a second target storage policy: storing the second memory page in the shared memory; the first memory page and the second memory page have different activity levels.
[0005] According to an embodiment of the present disclosure, the target storage policy is obtained by the following operations: determining the target storage policy of each memory page based on the access information of each memory page in the memory of the main virtual machine; the target memory page is obtained by the following operations: when the initial storage location of the memory page is different from the target storage location, determining that the memory page is the target memory page; wherein the storage location includes a first local memory and a shared memory.
[0006] According to an embodiment of the present disclosure, a target storage strategy for each memory page is determined based on access information of each memory page in the memory of the main virtual machine, including: determining attribute information of the memory page based on the access information of the memory page, the attribute information representing the activity level of the memory page; when the attribute information satisfies a first preset condition, determining a first target storage strategy, the first preset condition representing that the reading frequency of the memory page is greater than a first threshold; when the attribute information meets a second preset condition, determining a second target storage strategy, the first preset condition representing that the reading frequency of the memory page is less than the first threshold.
[0007] According to an embodiment of the present disclosure, when the target storage policy is the first target storage policy, according to the target storage policy, the target memory page in the primary virtual machine is migrated from the first local memory to the shared memory, or from the shared memory to the first local memory, including at least one of the following: when the initial storage location of the target memory page is the shared memory, the target memory page is synchronized from the shared memory to the first local memory; when the initial storage location of the target memory page is the shared memory and the target memory page is marked as a dirty page, the target memory page is synchronized from the shared memory to the first local memory; when the initial storage location of the target memory page is the first local memory and the target memory page is marked as a dirty page, the target memory page is synchronized from the first local memory to the shared memory.
[0008] According to an embodiment of the present disclosure, when the target storage policy is the second target storage policy, according to the target storage policy, the target memory page in the primary virtual machine is migrated from the first local memory to the shared memory, or from the shared memory to the first local memory, including: when the initial storage location of the target memory page is the first local memory, the target memory page is transferred from the first local memory to the shared memory.
[0009] According to an embodiment of the present disclosure, the method further includes: in response to the attribute information of the memory page in the first local memory changing from the first activity level to the second activity level, deleting the memory page from the first local memory, and sharing the backup memory page of the memory page in the memory page; and determining the second address mapping relationship of the primary virtual machine with respect to the backup memory page according to the first address mapping relationship of the backup virtual machine with respect to the backup memory page. The first address mapping relationship represents the correspondence between the virtual address and the physical address of the backup memory page of the backup virtual machine, and the second address mapping relationship represents the correspondence between the virtual address and the physical address of the backup memory page of the primary virtual machine, and the first activity level is greater than the second activity level.
[0010] According to an embodiment of the present disclosure, the method also includes: in response to the primary virtual machine starting a fault tolerance mechanism, creating a standby virtual machine on a second computing node; creating a shared memory based on the primary virtual machine and the standby virtual machine; migrating the target data in the first local memory of the primary virtual machine to the shared memory; in response to the first triggering of a state synchronization event of the primary virtual machine, notifying the standby virtual machine of a first address information set, the first address information set representing the address of the target data in the shared memory.
[0011] A second aspect of the present disclosure provides a data processing method, which is applied to a second computing node, wherein the second computing node has a standby virtual machine, and the memory of the standby virtual machine includes a second local memory and a shared memory. The method includes: in response to a target memory page being transferred from the first local memory of the primary virtual machine in the first computing node to the shared memory, obtaining the target memory page; determining association information based on the target memory page, the association information representing the physical address of the shared memory used by the primary virtual machine; determining mapping information based on the association information, the mapping information representing a mapping relationship between the virtual address, the physical address of the standby virtual machine, and the physical address of the second computing node.
[0012] The third aspect of the present disclosure provides a first data processing device, which is arranged in a first computing node. The first data processing device is communicatively connected with a main virtual machine in the first computing node, and the memory of the main virtual machine includes a first local memory and a shared memory; the first data processing device includes: a first acquisition module, used to obtain state synchronization events of the main virtual machine; a migration module, used to migrate the target memory page in the main virtual machine from the first local memory to the shared memory, or from the shared memory to the first local memory according to the target storage strategy; the target storage strategy includes at least one of the following: a first target storage strategy: storing the first memory page in the first local memory; a second target storage strategy: storing the second memory page in the shared memory; the activity levels of the first memory page and the second memory page are different.
[0013] The fourth aspect of the present disclosure provides a second data processing device, which is arranged in a second computing node. The second data processing device is communicatively connected with a standby virtual machine in the second computing node. The second computing node has a standby virtual machine, and the memory of the standby virtual machine includes a second local memory and a shared memory; the second data processing device includes: a second acquisition module, which is used to obtain a target memory page in response to the target memory page being transferred from the first local memory of the primary virtual machine in the first computing node to the shared memory; a first determination module, which is used to determine association information based on the target memory page, the association information representing the virtual address using the shared memory in the primary virtual machine; a second determination module, which is used to determine mapping information based on the association information, the mapping information representing the mapping relationship between the virtual address, the physical address of the standby virtual machine and the physical address of the second computing node.
[0014] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] The above and other objects, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:
[0016] Figure 1 A flow chart of a data processing method according to an embodiment of the present disclosure is schematically shown, wherein the method is applied to a first computing node;
[0017] Figure 2A One of the schematic diagrams for memory page migration using a first target storage strategy according to an embodiment of the present disclosure is schematically shown;
[0018] Figure 2B The second schematic diagram schematically shows a memory page migration using a first target storage strategy according to an embodiment of the present disclosure;
[0019] Figure 3 One of the schematic diagrams for memory page migration using a second target storage strategy according to an embodiment of the present disclosure is schematically shown;
[0020] Figure 4 The second schematic diagram schematically shows a memory page migration using a second target storage strategy according to an embodiment of the present disclosure;
[0021] Figure 5A A flowchart of a method for fault-tolerant startup of a virtual machine according to an embodiment of the present disclosure is schematically shown;
[0022] Figure 5B A schematic diagram of fault-tolerant startup of a virtual machine according to an embodiment of the present disclosure is schematically shown;
[0023] Figure 6 A flow chart of a data processing method according to an embodiment of the present disclosure is schematically shown, wherein the method is applied to a second computing node;
[0024] Fig. 7A One of the schematic diagrams schematically illustrates data processing of a second computing node according to an embodiment of the present disclosure;
[0025] Figure 7B A second schematic diagram schematically illustrates data processing of a second computing node according to an embodiment of the present disclosure;
[0026] Figure 8 The diagram schematically shows a data processing device according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0027] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present disclosure. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.
[0028] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise", "include", etc. used herein indicate the existence of features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.
[0029] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.
[0030] When using expressions such as "at least one of A, B, and C, etc.", they should generally be interpreted according to the meaning of the expression commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).
[0031] The embodiments of the present disclosure provide a data processing method and device. Before introducing the technical solutions provided by the embodiments of the present disclosure, the related technologies involved in the present disclosure are first described.
[0032] Virtualization technology is the foundation of cloud computing development. Using cloud computing and virtualization technology can effectively improve resource utilization, reduce management costs, and increase flexibility. With the continuous development of cloud computing, higher requirements are placed on the reliability of virtual machines.
[0033] In public clouds and data centers, optimizing memory usage is an important issue. This is because unreasonable memory allocation will lead to waste of memory resources and increase costs. The main memory problems are "stranded memory" and "unused memory", that is, the waste of resources caused by uneven memory allocation. With the emergence of CXL memory technology, different computing devices are allowed to share memory. This technology makes it possible to build a shared memory pool. Through memory pooling, memory resources can be managed more flexibly, resource waste can be reduced, and memory costs can be optimized.
[0034] Virtual machine fault tolerance technology can create a backup virtual machine that keeps in real-time synchronization with the primary virtual machine. When a hardware failure occurs, it can perform instant failover between the two virtual machine instances, thereby eliminating the risk of data loss or business interruption, and allowing applications to continue to be available even when a server fails. Among them, the virtual CPUs (vCPUs) of the primary virtual machine and the backup virtual machine will execute the same instructions at the same time, maintaining a high degree of consistency. In other words, every instruction of the primary virtual machine will be executed in the same order in the backup virtual machine, ensuring that when the primary virtual machine fails, the status of the backup virtual machine is completely consistent with the primary virtual machine, enabling seamless takeover.
[0035] Currently, there are two types of virtual machine fault tolerance technologies.
[0036] In one example, MicroCheckpointing technology can be used. In this method, the standby virtual machine is always in a suspended state, and the state changes of the primary virtual machine are synchronized at a high frequency. If the primary virtual machine fails, the standby virtual machine is activated to run. Checkpoints (a checkpoint mechanism, a state data synchronization method) are performed between the primary virtual machine and the standby virtual machine regularly and frequently, and the checkpoint requires the primary virtual machine to be suspended. Among them, MicroCheckpointing does not complete the migration after the hot migration is completed. Each time a checkpoint is generated, the modified memory page (dirty page) will be saved to the local storage of QEMU and transmitted to the standby virtual machine. This method copies a large amount of memory dirty page data in a short time, increasing bandwidth pressure; and periodically creating checkpoints is prone to additional performance overhead.
[0037] In another example, coarse-grained LOck-stepping (COLO) can be used. In this method, both the primary and standby virtual machines are in operation. When an external client sends a network request to the primary virtual machine, the primary virtual machine sends it to the standby virtual machine for processing. By comparing the network responses of the primary and standby virtual machines to the same network request, it is determined whether the status of the primary and standby virtual machines needs to be synchronized. If the response data packets generated by the primary and standby virtual machines to the client network request are the same, there is no need to perform a checkpoint; otherwise, the status of the primary and standby virtual machines is synchronized immediately. In this method, the primary and standby virtual machines are executed in parallel, which doubles the resource usage and leads to high resource consumption. Although the number of data transmissions is reduced, a large amount of memory dirty page data also needs to be transmitted from time to time.
[0038] Therefore, how to make the virtual machine fault tolerance mechanism better adapt to the new cloud computing architecture (CXL memory) and further reduce the runtime performance overhead brought to the virtual machine by the virtual machine fault tolerance mechanism is a technical problem that needs to be solved urgently.
[0039] Before further describing the embodiments of the present disclosure in detail, the nouns and terms involved in the embodiments of the present disclosure are described. The nouns and terms involved in the embodiments of the present disclosure are subject to the following interpretations.
[0040] CXL (Compute Express Link) is an emerging high-speed interconnect protocol designed to support more efficient memory sharing and resource pooling. It allows memory to be shared between different types of computing devices (such as CPUs, GPUs, and memory devices), thereby improving the memory utilization and scalability of the system.
[0041] Live Migration refers to the process of migrating a virtual machine from one physical host to another without shutting down the virtual machine or service. This process will not interrupt the operation of the virtual machine or cause service downtime during the migration process.
[0042] Memory Page is the basic unit in computer memory management, usually the unit used by the operating system to allocate memory to programs. Each page usually has a fixed size (such as 4KB, 8KB or 16KB).
[0043] Cold pages refer to data that is not frequently accessed. These data are accessed less frequently in memory, or are memory areas that are not currently needed.
[0044] Hot pages refer to data that is frequently accessed or requires a quick response.
[0045] A dirty page is a page that has been written to. In the memory management of the operating system, when a page is modified (written to), the page is marked as a dirty page.
[0046] A page table entry (PTE) is a component of the page table in the operating system's memory management. It is used to store the mapping relationship between virtual addresses and physical addresses, and carries a lot of memory management information, such as access rights, dirty bits, access bits, etc.
[0047] Extended Page Tables (EPT) is a mechanism in a virtualization environment that is specifically used to map virtual addresses to physical addresses in a virtual machine. In a virtualization environment, a virtual address of a virtual machine needs to go through two levels of mapping to access the actual physical memory: first, the virtual address of the virtual machine is mapped to the physical address of the virtual machine, and then the physical address of the virtual machine is mapped to the physical address of the host machine.
[0048] An embodiment of the present disclosure provides a data processing method, including: being applied to a first computing node, the first computing node having a main virtual machine, the memory of the main virtual machine including a first local memory and a shared memory, the method including: obtaining a state synchronization event of the main virtual machine; migrating a target memory page in the main virtual machine from the first local memory to the shared memory, or from the shared memory to the first local memory according to a target storage policy; the target storage policy including at least one of the following: a first target storage policy: storing the first memory page in the first local memory; a second target storage policy: storing the second memory page in the shared memory; the first memory page and the second memory page have different activity levels.
[0049] An embodiment of the present disclosure also provides a data processing method, which is applied to a second computing node, wherein the second computing node has a standby virtual machine, and the memory of the standby virtual machine includes a second local memory and a shared memory. The method includes: in response to a target memory page being transferred from the first local memory of the primary virtual machine in the first computing node to the shared memory, obtaining the target memory page; determining association information based on the target memory page, the association information representing the physical address of the shared memory used by the primary virtual machine; determining mapping information based on the association information, the mapping information representing the mapping relationship between the virtual address, the physical address of the standby virtual machine and the physical address of the second computing node.
[0050] The following will be passed Figure 1 to Figure 5B The data processing method applied to the first computing node in the disclosed embodiment is described in detail.
[0051] Figure 1 A flow chart of a data processing method according to an embodiment of the present disclosure is schematically shown, wherein the method is applied to a first computing node.
[0052] The first computing node has a main virtual machine, and the memory of the main virtual machine includes a first local memory and a shared memory.
[0053] Exemplarily, the computing node may be a virtualized instance in a cloud computing environment, such as a server where a virtual machine is located.
[0054] The primary virtual machine is the virtual machine that performs the main computing and operation tasks in the virtualization environment. It is usually the virtual machine that runs the core application or service in the virtualization platform and is also the main computing node of the entire system.
[0055] A computing node can run multiple virtual machines through virtualization technology. The "primary virtual machine" refers to a specific virtual machine instance, which may be a core virtual machine for resource management or operation.
[0056] The first computing node may be a physical computer or server node that carries the primary virtual machine. The first computing node provides the required hardware resources for the operation of the primary virtual machine, such as CPU, memory, storage, and network.
[0057] The first local memory may be a memory portion directly provided by hardware of a physical computing node (such as a server) where the primary virtual machine runs.
[0058] The shared memory may be a memory resource shared between multiple virtual machines. For example, a shared memory may be configured between a primary virtual machine and a standby virtual machine, and the shared memory allows the primary virtual machine and the standby virtual machine to exchange data, that is, both the primary virtual machine and the standby virtual machine can directly access the shared memory. For example, the shared memory may be a CXL memory, and the CXL memory is interconnected with the first local memory through the CXL protocol.
[0059] like Figure 1 As shown, the data processing method of this embodiment includes operations S210 to S220.
[0060] In operation S210 , a state synchronization event of a primary virtual machine is obtained.
[0061] Exemplarily, the state synchronization event may be an indication of state data synchronization between the primary virtual machine and the standby virtual machine. When implementing state data synchronization between the primary and standby virtual machines, an indication of state data synchronization between the primary virtual machine and the standby virtual machine may be sent to the primary virtual machine by initiating a Checkpoint state data synchronization method, so that the primary virtual machine synchronizes its state data to the standby virtual machine.
[0062] In operation S220, according to the target storage policy, the target memory page in the primary virtual machine is migrated from the first local memory to the shared memory, or from the shared memory to the first local memory.
[0063] Exemplarily, the target storage policy may be used to indicate the target storage location of the memory page in the primary virtual machine memory, wherein the target storage location includes the first local memory and the shared memory. The target storage policy may be to store the memory page in the first local memory or the shared memory.
[0064] Different target storage strategies can be used for different types of memory pages in the main virtual machine memory, that is, different types of memory pages are stored in different memory areas (first local memory or shared memory) to optimize the allocation and utilization of memory resources, reduce unnecessary memory migration, and improve the overall performance of the system.
[0065] For example, different storage strategies can be used for memory pages with different activity levels: for memory pages with higher activity levels, the memory pages can be stored in local memory to reduce unnecessary memory migration; for memory pages with lower activity levels, the memory pages can be stored in shared memory to release local memory resources.
[0066] Different storage strategies can also be used for memory pages of different sizes: for memory pages with smaller data volumes, the memory pages can be stored in local memory; for memory pages with larger data volumes, the memory pages can be stored in shared memory, providing efficient storage capacity.
[0067] The target memory page may be a memory page in the primary virtual machine memory that needs to be migrated to a storage location. For example, the target memory page may be a memory page whose initial storage location and target storage location are different. If the target storage policy indicates that the target storage location of a memory page is a shared memory, but the initial storage location of the memory page is the first local memory, then the memory page is the target memory page. If the target storage policy indicates that the target storage location of a memory page is a shared memory, but the initial storage location of the memory page is a shared memory, then the memory page is not a target memory page.
[0068] Migration of memory pages may include copying memory pages and transferring memory pages. Copying memory pages may be copying a target memory page from a first local memory to a shared memory, and both the first local memory and the shared memory have the target memory page. Transferring memory pages may be transferring a target memory page from a first local memory to a shared memory, and the first local memory no longer has the target memory page, and the shared memory has the target memory page.
[0069] In one example, the target storage strategy includes at least one of the following: a first target storage strategy: storing the first memory page in the first local memory; a second target storage strategy: storing the second memory page in the shared memory; the first memory page and the second memory page have different activity levels.
[0070] For example, different target storage strategies may be used for memory pages with different activity levels. A memory page with a higher activity level (a first memory page) may be stored in a first local memory, and a memory page with a lower activity level (a second memory page) may be stored in a shared memory.
[0071] In other embodiments, a target storage strategy may be implemented for a memory page of a certain activity level alone. Different target storage strategies may also be implemented for memory pages of multiple activities together. This disclosure embodiment does not specifically limit this.
[0072] For example, if it is determined that the first memory page in the memory of the primary virtual machine adopts the first target storage policy and the initial storage location of the first memory page is the shared memory, the first memory page is migrated from the shared memory to the first local memory. If it is determined that the second memory page in the memory of the primary virtual machine adopts the second target storage policy and the initial storage location of the second memory page is the first local memory, the second memory page is migrated from the first local memory to the shared memory.
[0073] It can be understood that this method is applicable to both the simultaneous operation of the primary and standby virtual machines, and the scenario where the primary virtual machine is running and the standby virtual machine is suspended, thus broadening the application scenarios. For a primary virtual machine with shared memory, the memory pages with different activity levels are stored in the local memory or shared memory of the primary virtual machine according to the target storage policy corresponding to the memory pages with different activity levels in the memory of the primary virtual machine. This not only takes into account the performance of the virtual machine, but also reduces the network transmission of data in the memory pages between the primary virtual machine and the standby virtual machine, thereby improving the resource utilization efficiency of the virtual machine.
[0074] As described above, the target memory page is obtained by the following operation: when the initial storage location of the memory page is different from the target storage location, the memory page is determined to be the target memory page; wherein the storage location includes the first local memory and the shared memory.
[0075] Exemplarily, after determining the target storage policy of the memory page, it is determined whether the memory page is the target memory page according to the initial storage position of the memory page and the target storage position indicated by the target storage policy. If the initial storage position of the memory page is different from the target storage position, the memory page is the target memory page. If the initial storage position of the memory page is the same as the target storage position, the memory page is not the target memory page, and there is no need to perform memory migration according to the target storage policy.
[0076] For example, the initial storage location of the first memory page in the master virtual machine is the first local memory. If the first memory page corresponds to the first target storage policy, the first memory page is not the target memory page. If the first memory page corresponds to the second target storage policy, the first memory page is the target memory page, and the first memory page is migrated from the first local memory to the shared memory.
[0077] As described above, the target storage policy can be obtained by the following operations: determining the target storage policy of each memory page according to the access information of each memory page in the memory of the primary virtual machine.
[0078] Exemplarily, the access information may include the access frequency and access type of the memory page. The access type may further include reading and writing. The access frequency of the memory page may characterize the activity of the memory page. The memory page with high access frequency has high activity; the memory page with low access frequency has low activity. Different access frequencies correspond to different activity levels of the memory page, and different activity levels correspond to different target storage strategies.
[0079] The accessed bit in the page table entry (PTE) of the memory page can be used to regularly track the number of accesses (access frequency) of the memory page per unit time, and the dirty bit in the page table entry (PTE) of the memory page can be used to track and monitor the memory read and write status. According to the memory page access type and access frequency, the corresponding target storage strategy is determined.
[0080] For example, if a page is frequently accessed and has many write operations, the page is stored in the first local memory. If a page is rarely accessed and has few write operations, the page is stored in the shared memory.
[0081] In one example, after receiving the state synchronization event, the primary virtual machine obtains access information of each memory page in the first local memory and the shared memory in the primary virtual machine, and determines a target storage policy for each memory page according to the access information of each memory page.
[0082] In another example, access information of each memory page in the first local memory and the shared memory of the master virtual machine is obtained in advance, and the target storage policy of each memory page is determined according to the access information of each memory page. After receiving the state synchronization event, the master virtual machine directly performs memory migration according to the target storage policy corresponding to each memory page.
[0083] As described above, in one achievable method, determining the target storage strategy for each memory page based on the access information of each memory page in the memory of the main virtual machine can further include: determining the attribute information of the memory page based on the access information of the memory page, the attribute information representing the activity level of the memory page; when the attribute information satisfies a first preset condition, determining a first target storage strategy, the first preset condition representing that the reading frequency of the memory page is greater than a first threshold; when the attribute information meets a second preset condition, determining a second target storage strategy, the first preset condition representing that the reading frequency of the memory page is less than the first threshold.
[0084] Exemplarily, different page types (attribute information) are distinguished according to the memory page access type and access frequency. The frequency at which the memory page is read or written can be used to determine the activity of the memory page. The higher the frequency at which the memory page is read or written, the higher the activity of the memory page.
[0085] The attribute information may include hot pages and cold pages. For example, if a page is frequently accessed (frequently read or written), the page may be a hot page. If a page is rarely accessed (fewer reads and writes), the page may be a cold page. For example, page types may include more reads and less writes (hot pages), more writes and less reads (hot pages), completely read-only (hot pages), more writes and more reads (hot pages), and less writes and less reads (cold pages).
[0086] Among them, the judgment of "reading more" or "reading less" can be determined according to the frequency of memory page reading. For example, if the frequency of memory page reading is greater than 9 times / s (preset reading frequency), it can be determined as "reading more"; if the frequency of memory page reading is less than 9 times / s, it can be determined as "reading less". The judgment of "writing more" or "writing less" can be determined according to the frequency of memory page writing. For example, if the frequency of memory page writing is greater than 9 times / s (preset writing frequency), it can be determined as "writing more"; if the frequency of memory page reading is less than 9 times / s, it can be determined as "writing less". The embodiment of the present disclosure does not make specific limitations on the preset reading frequency and the preset writing frequency, which can be set according to actual application requirements. The preset reading frequency may be the same as the setting of the first threshold, or it may be different.
[0087] For memory pages with different activity levels, different target storage strategies are matched according to preset conditions.
[0088] First preset condition: If the frequency of memory page reading is greater than or equal to the first threshold (for example, 10 times / s), indicating that the frequency of memory page reading is high, the memory page matches the first target storage strategy, and the memory page is stored in the first local memory. For example, memory pages with more reads and less writes (hot pages), completely read-only (hot pages), and more reads and more writes (hot pages) are adapted to the first target storage strategy.
[0089] The second preset condition: if the frequency of memory page reading is less than the first threshold (for example, 10 times / s), indicating that the frequency of memory page reading is low, the memory page matches the second target storage strategy and the memory page is stored in the shared memory. For example, memory pages with less reads and more writes (hot pages) and less reads and less writes (cold pages) are adapted to the second target storage strategy.
[0090] In one example, the read frequency of the first memory page in the shared memory of the primary virtual machine is 15 times / s (greater than the preset read frequency of 9 times / s), and the write frequency is 13 times / s (greater than the preset write frequency of 9 times / s), then the first memory page is a hot page with more reads and more writes. The read frequency of the second memory page in the shared memory of the primary virtual machine is 3 times / s (less than the preset read frequency of 9 times / s), and the write frequency is 15 times / s (greater than the preset write frequency of 9 times / s), then the second memory page is a hot page with less reads and more writes. The read frequency of the third memory page in the first local memory of the primary virtual machine is 5 times / s (less than the preset read frequency of 9 times / s), and the write frequency is 3 times / s (less than the preset write frequency of 9 times / s), then the third memory page is a cold page with less reads and less writes.
[0091] If the read frequency of the first memory page is greater than the first threshold value of 10 times / s, the first memory page matches the first target storage policy, and the target storage location of the first memory page is the first local memory. If the read frequency of the second memory page is less than the first threshold value of 10 times / s, the second memory page matches the second target storage policy, and the target storage location of the second memory page is the shared memory. If the read frequency of the third memory page is less than the first threshold value of 10 times / s, the third memory page matches the second target storage policy, and the target storage location of the third memory page is the shared memory.
[0092] The initial storage location (shared memory) of the first memory page is different from the target storage location (first local memory), and the first memory page is the target memory page. Migrate the first memory page from the shared memory to the first local memory. The initial storage location (shared memory) of the second memory page is the same as the target storage location (shared memory), and the second memory page is not the target memory page. There is no need to migrate the second memory page. The initial storage location (first local memory) of the third memory page is different from the target storage location (shared memory), and the third memory page is the target memory page. Migrate the third memory page from the first local memory to the shared memory.
[0093] It is understandable that for memory pages with a high read frequency, the strategy of storing them in the local memory of the main virtual machine can speed up access and ensure the performance of the virtual machine. For memory pages with a low read frequency, the strategy of storing them in shared memory can reduce the occupation of memory resources while ensuring the performance of the virtual machine.
[0094] When the target storage policy of the target memory page is the first target storage policy, the migration of the target memory page will be combined with Figure 2A and Figure 2B Provide detailed explanation.
[0095] Figure 2A One of the schematic diagrams of memory page migration using the first target storage strategy according to an embodiment of the present disclosure is schematically shown.
[0096] As described above, in operation S220, according to the target storage policy, the target memory page in the primary virtual machine is migrated from the first local memory to the shared memory, or from the shared memory to the first local memory. In an achievable manner, the operation may further include the operation of: when the initial storage location of the target memory page is the shared memory, synchronizing the target memory page from the shared memory to the first local memory.
[0097] like Figure 2A As shown, the initial storage location of the memory page (S1, S2) is the shared memory. When the memory page (S1, S2) matches the first target storage policy, the target storage location corresponding to the memory page (S1, S2) is the first local memory. If the initial storage location and the target storage location of the memory page (S1, S2) are different, the memory page (S1, S2) is the target memory page. The memory page (S1, S2) is copied to the first local memory to form the memory page (M1, M2). The data in the memory page (M1, M2) and the memory page (S1, S2) are the same but the storage locations are different.
[0098] In one example, the initial storage location of the fourth memory page is the shared memory. The fourth memory page is a completely read-only memory page, and the read frequency is 15, which is greater than the preset read frequency of 9 times / s, so the fourth memory page is a completely read-only hot page. If the read frequency of the fourth memory page is greater than the first threshold, the fourth memory page matches the first target storage, and the target storage location of the fourth memory page is the first local memory. If the initial storage location and the target storage location of the fourth memory page are not the same, the fourth memory page in the shared memory is copied to the first local memory, and both the first local memory and the shared memory have the fourth memory page.
[0099] Figure 2B A second schematic diagram of memory page migration using a first target storage strategy according to an embodiment of the present disclosure is schematically shown.
[0100] As described above, in operation S220, according to the target storage policy, the target memory page in the primary virtual machine is migrated from the first local memory to the shared memory, or from the shared memory to the first local memory. In another achievable manner, the operation may further include an operation of: when the initial storage location of the target memory page is the shared memory and the target memory page is marked as a dirty page, synchronizing the target memory page from the shared memory to the first local memory.
[0101] like Figure 2BAs shown, for the memory pages (S1, S2) in the shared memory that match the first target storage policy, the memory pages (S1, S2) in the shared memory are copied to the first local memory to form memory pages (M1, M2). If the memory pages (M1, M2) are written to generate dirty pages, the double write mode on the primary virtual machine side is adopted to synchronize the dirty page data generated by the memory pages (M1, M2) to the memory pages (S1, S2). The primary virtual machine can directly access the memory pages (M1, M2) in the first local memory. The standby virtual machine can directly access the memory pages (S1, S2) in the shared memory. For example, for memory pages with more reads and less writes and more reads and more writes, dirty pages are generated, and this type of memory pages can be synchronized in the first local memory and the shared memory.
[0102] In one example, the initial storage location of the fifth memory page is the shared memory, the fifth memory page is a hot page with more reads and less writes, and the read frequency of the fifth memory page is greater than the first threshold, then the fifth memory page matches the first target storage, and the target storage location of the fifth memory page is the first local memory. If the initial storage location and the target storage location of the fifth memory page are not the same, the fifth memory page in the shared memory is copied to the first local memory. In the case where the fifth memory page in the first local memory is written to generate dirty page data, the dirty page data is synchronized to the fifth memory page in the shared memory.
[0103] Memory pages that are read more and written less rarely generate dirty pages, which can be placed in the first local memory to speed up access. At the same time, the generated dirty page data is synchronized to the shared memory in a double write mode, so that the backup virtual machine can directly access it, reducing the network transmission of dirty page data and reducing the performance load pressure caused by fault tolerance, thereby improving the reliability of virtual machine fault tolerance.
[0104] As described above, in operation S220, according to the target storage policy, the target memory page in the primary virtual machine is migrated from the first local memory to the shared memory, or from the shared memory to the first local memory. In another achievable manner, the operation may further include an operation of: when the initial storage location of the target memory page is the first local memory and the target memory page is marked as a dirty page, synchronizing the target memory page from the first local memory to the shared memory.
[0105] In one example, the initial storage location of the sixth memory page is the first local memory, the sixth memory page is a hot page with multiple reads and multiple writes, and the read frequency of the sixth memory page is greater than the first threshold, then the sixth memory page matches the first target storage, and the target storage location of the sixth memory page is the first local memory. Although the initial storage location and the target storage location of the sixth memory page are the same, in order to reduce the network transmission of data, the sixth memory page in the first local memory is copied to the shared memory. In the case where the sixth memory page in the first local memory is written to generate dirty page data, the dirty page data is synchronized to the sixth memory page in the shared memory.
[0106] Memory pages that are read and written frequently can be placed in the first local memory to speed up access. However, a large number of dirty pages are generated. In order to ensure checkpoint performance, the generated dirty page data is synchronized to the shared memory in double write mode to complete the memory synchronization of the active and standby virtual machines. The cost is much lower than the network checkpoint transmission, thereby improving the reliability of virtual machine fault tolerance.
[0107] When the target storage policy of the target memory page is the second target storage policy, the migration of the target memory page will be combined with Figure 3 and Figure 4 Provide detailed explanation.
[0108] Figure 3 One of the schematic diagrams of memory page migration using the second target storage strategy according to an embodiment of the present disclosure is schematically shown.
[0109] As described above, in operation S220, according to the target storage policy, the target memory page in the primary virtual machine is migrated from the first local memory to the shared memory, or from the shared memory to the first local memory. In an achievable manner, the operation may further include an operation of: when the initial storage location of the target memory page is the first local memory, transferring the target memory page from the first local memory to the shared memory.
[0110] like Figure 3 As shown, the initial storage location of the memory page (N1, N2) is the first local memory. When the memory page (N1, N2) matches the second target storage policy, the target storage location corresponding to the memory page (N1, N2) is the shared memory. If the initial storage location and the target storage location of the memory page (N1, N2) are different, the memory page (N1, N2) is the target memory page. The memory page (N1, N2) is transferred to the first local memory.
[0111] In one example, the initial storage location of the seventh memory page is the first local memory, the seventh memory page is a hot page with more writes and less reads, and the read frequency of the seventh memory page is less than the first threshold, then the seventh memory page matches the second target storage, and the target storage location of the seventh memory page is the shared memory. The initial storage location and the target storage location of the seventh memory page are different, and the seventh memory page in the first local memory is transferred to the shared memory.
[0112] Memory pages that are written more often and read less often, but generate a large number of dirty pages, can be placed in shared memory. Both the primary and standby virtual machines can directly access the shared memory, reducing network transmission of dirty page data and improving checkpoint performance. At the same time, the reading frequency is low, and placing it in shared memory can reduce the occupation of local memory resources of the primary virtual machine.
[0113] Figure 4 The second schematic diagram of memory page migration using the second target storage strategy according to an embodiment of the present disclosure is schematically shown.
[0114] As described above, the data processing method of the embodiment of the present disclosure also includes the following operations: in response to the attribute information of the memory page in the first local memory changing from the first activity level to the second activity level, deleting the memory page from the first local memory, and having a backup memory page of the memory page in the shared memory; and determining the second address mapping relationship of the primary virtual machine with respect to the backup memory page according to the first address mapping relationship of the backup virtual machine with respect to the backup memory page. The first address mapping relationship represents the correspondence between the virtual address and the physical address of the backup memory page of the backup virtual machine, and the second address mapping relationship represents the correspondence between the virtual address and the physical address of the backup memory page of the primary virtual machine, and the first activity level is greater than the second activity level.
[0115] Reference Figure 4 , during the operation of the primary virtual machine, the memory pages (S1, S2) in the shared memory in the first period have a first activity level, and the memory pages (S1, S2) meet the first target storage policy. The memory pages (S1, S2) in the shared memory are synchronized to the first local memory to form memory pages (M1, M2). Here, the memory pages (S1, S2) in the shared memory can be understood as backup memory pages of the memory pages (M1, M2) in the first local memory. For example, the memory pages (S1, S2) can be read-more-write, completely read-only, or read-more-less-write memory pages.
[0116] In the second period, the first local memory (M1, M2) changes from the first activity level to the second activity level, and the activity levels of M1 and M2 decrease. The second period is later than the first period. For example, the first local memory (M1, M2) changes from more reads and more writes to less writes and less reads, that is, hot pages become cold pages. The memory pages M1 and M2 in the first local memory can be deleted, and the memory pages S1 and S2 in the shared memory can be retained.
[0117] The first address mapping relationship of the standby virtual machine regarding the memory pages S1 and S2 in the shared memory is sent to the primary virtual machine, and the primary virtual machine determines the second address mapping relationship of the primary virtual machine regarding the memory pages S1 and S2 in the shared memory according to the first address mapping relationship.
[0118] Since the physical addresses of the shared memory are different on the primary virtual machine and the standby virtual machine, after deleting M1 and M2 in the first local memory, the standby virtual machine sends the first address mapping information used by S1 and S2 in the shared memory (i.e., the mapping relationship between the virtual addresses and physical addresses of S1 and S2 of the standby virtual machine) to the primary virtual machine, and the primary virtual machine establishes the second mapping information between the virtual address of the primary virtual machine and the physical addresses of S1 and S2 according to the physical addresses of S1 and S2.
[0119] Figure 5A The flowchart of the method for fault-tolerant startup of a virtual machine according to an embodiment of the present disclosure is schematically shown. Figure 5B A schematic diagram of fault-tolerant startup of a virtual machine according to an embodiment of the present disclosure is schematically shown.
[0120] As mentioned above, refer to Figure 5A The data processing method of the embodiment of the present disclosure further includes operations S310 to S340.
[0121] In operation S310 , in response to the primary virtual machine initiating a fault tolerance mechanism, a standby virtual machine is created on a second computing node.
[0122] In operation S320, a shared memory is created according to the primary virtual machine and the standby virtual machine.
[0123] In operation S330 , target data in the first local memory of the primary virtual machine is migrated to the shared memory.
[0124] In operation S340, in response to triggering a state synchronization event of the primary virtual machine for the first time, the standby virtual machine is notified of a first address information set, where the first address information set represents an address of target data in the shared memory.
[0125] Exemplarily, the second computing node may be a physical computer or server node that carries the standby virtual machine. The second computing node provides the hardware resources required for the operation of the standby virtual machine. When the virtual machine fault tolerance mechanism is started, a standby virtual machine is created on the second computing node according to the configuration of the primary virtual machine. The hardware configuration of the standby virtual machine is similar to that of the primary virtual machine, and the standby virtual machine can serve as a redundant backup of the primary virtual machine. When the primary virtual machine fails, the standby virtual machine can take over the tasks of the primary virtual machine to ensure that the business is not interrupted.
[0126] A shared memory is created between the primary virtual machine and the standby virtual machine. The shared memory is used to store part of the data of the primary virtual machine, so that the standby virtual machine can access the data in the shared memory at any time to maintain synchronization. For example, a shared memory area is established between the first computing node and the second computing node via a high-speed network (e.g., CXL protocol), and the area is configured as a data area commonly accessed by the primary virtual machine and the standby virtual machine.
[0127] The target data is key data required for the current operation of the primary virtual machine, such as primary virtual machine status information, memory mapping data, etc.
[0128] The first address information set may be a specific location or address of the target data in the shared memory of the primary virtual machine.
[0129] When the state of the master virtual machine changes or synchronization is required, a state synchronization event is triggered. The state synchronization event can be automatically triggered by the monitoring mechanism inside the master virtual machine, or by an external management system through an interface request.
[0130] In one example, referring to Figure 5B When virtual machine fault tolerance is established, a backup virtual machine corresponding to the primary virtual machine is created on the second computing node. Shared memory is created between the primary virtual machine and the backup virtual machine. All memory pages in the first local memory of the primary virtual machine are determined to be cold pages, and the memory pages in the first local memory are transferred to the shared memory. After the state synchronization event is triggered for the first time (the first Checkpoint), the primary virtual machine generates the address information of the target data in the current shared memory as the first address information set. The primary virtual machine notifies the backup virtual machine of the generated first address information set. After receiving the first address information set, the backup virtual machine can access the target data in the shared memory, ensuring that the backup virtual machine can take over and continue to process tasks when the primary virtual machine fails.
[0131] It is understandable that during the first state synchronization, only the address information set of the target data in the shared memory of the primary virtual machine is transmitted, and the memory data is not transmitted, which can improve the data transmission efficiency. The local migration cost is much smaller than the network transmission, which improves the efficiency of fault tolerance establishment.
[0132] The following will be passed Figure 6~Figure 7B The data processing method applied to the second computing node of the disclosed embodiment is described in detail.
[0133] Figure 6 A flowchart of a data processing method according to an embodiment of the present disclosure is schematically shown, wherein the method is applied to a second computing node.
[0134] The second computing node has a standby virtual machine, and the memory of the standby virtual machine includes a second local memory and a shared memory.
[0135] For example, the standby virtual machine is a virtual machine set up in a virtualized environment to improve system availability and fault tolerance. Its main function is to serve as a backup for the primary virtual machine, and to take over the work in time to keep the system running continuously when the primary virtual machine fails or is unavailable.
[0136] The second computing node can be a physical computer or server node that can host the standby virtual machine. The second computing node provides the required hardware resources for the operation of the standby virtual machine. When the virtual machine fault tolerance mechanism is started, a standby virtual machine is created on the second computing node according to the configuration of the primary virtual machine. The hardware configuration of the standby virtual machine is similar to that of the primary virtual machine, and the standby virtual machine can serve as a redundant backup of the primary virtual machine. When the primary virtual machine fails, the standby virtual machine can take over the tasks of the primary virtual machine to ensure that the business is not interrupted.
[0137] The second local memory may be a memory portion directly provided by hardware of a physical computing node (such as a server) where the standby virtual machine runs.
[0138] A shared memory is created between the primary virtual machine and the standby virtual machine. The shared memory is used to store part of the data of the primary virtual machine, so that the standby virtual machine can access the data in the shared memory at any time to maintain synchronization. For example, a shared memory area is established between the first computing node and the second computing node via a high-speed network (e.g., CXL protocol), and the area is configured as a data area commonly accessed by the primary virtual machine and the standby virtual machine.
[0139] like Figure 6 As shown, the data processing method of this embodiment includes operations S410 to S430.
[0140] In operation S410, in response to a target memory page being transferred from a first local memory of a primary virtual machine in a first computing node to a shared memory, a target memory page is acquired.
[0141] In operation S420, association information is determined according to the target memory page, where the association information represents a physical address of a shared memory used by the primary virtual machine.
[0142] In operation S430, mapping information is determined according to the association information, where the mapping information represents a mapping relationship between the virtual address, the physical address of the standby virtual machine, and the physical address of the second computing node.
[0143] Exemplarily, the target memory page may be a memory page in the primary virtual machine whose storage location is migrated from the first local memory to the shared memory. For example, the target memory page may be a memory page with more writes and less reads or less writes and less reads. For details, please refer to the above description, which will not be repeated here.
[0144] For the eighth memory page using the second target storage strategy, after the eighth memory page is transferred from the first local memory to the shared memory. Determine the address information (association information) of the primary virtual machine regarding the eighth memory page using the shared memory. Here, the association information can be understood as the physical address used by the primary virtual machine regarding the eighth memory page in the shared memory. The standby virtual machine establishes a page table and an extended page table for the standby virtual machine regarding the eighth memory page according to the physical address used by the primary virtual machine regarding the eighth memory page in the shared memory.
[0145] It should be noted here that for memory pages that use the second target storage strategy and perform location migration, the standby virtual machine needs to establish page tables and page table entries based on the address information of the newly added memory pages in the shared memory. For memory pages that use the first target storage strategy and perform location migration, the standby virtual machine does not need to establish page tables and page table entries, because the memory pages that use the first target storage strategy and perform location migration are synchronized from the shared memory to the first local memory. The standby virtual machine has established a page table index for the memory pages initially stored in the shared memory. Whenever a memory page in the first local memory changes, the change will be synchronized to the corresponding memory page in the shared memory, and the page table index will be updated.
[0146] It can be understood that during the fault tolerance process of the virtual machine, the standby virtual machine can ensure the availability of memory in real time and reduce the fault switching time by establishing the page table index relationship of the memory pages in the shared memory; it also reduces the network transmission of the primary virtual machine's memory data.
[0147] Fig. 7A One of the schematic diagrams schematically illustrates data processing of a second computing node according to an embodiment of the present disclosure; Figure 7B A second schematic diagram of data processing of a second computing node according to an embodiment of the present disclosure is schematically shown.
[0148] In one example, referring to Fig. 7A , the same memory can be hot-plugged (asynchronously triggered) to the first computing node and the second computing node at different times to form a CXL shared memory. The primary virtual machine of the first computing node and the backup virtual machine of the second computing node can both access the CXL shared memory, but the two base addresses of the CXL shared memory of the first computing node and the second computing node are different. For example, the base address of the CXL shared memory of the first computing node is: 0xb00, and the base address of the CXL shared memory of the second computing node is: 0xd00.
[0149] Reference Figure 7BAfter the standby virtual machine obtains the memory page address information of the primary virtual machine in the CXL shared memory, the standby virtual machine parses the CXL base address and the newly added CXL address information in the CXL shared memory on the primary virtual machine side, completes the address translation on the standby virtual machine side, and establishes the EPT and memory page table index relationship on the standby virtual machine side. This allows the standby virtual machine to access the shared CXL memory shared by the primary virtual machine just like accessing local memory.
[0150] The address conversion of the standby virtual machine can refer to the formula: the newly allocated address of the second computing node = the allocated address of the first computing node - the shared memory base address of the first computing node + the shared memory base address of the second computing node.
[0151] The first computing node allocation address-first computing node shared memory base address may be understood as an offset of a memory page in the shared memory.
[0152] Based on the above data processing method applied to the first computing node, the present disclosure also provides a first data processing device. The first data processing device is arranged in the first computing node, and the first data processing device is communicatively connected with a primary virtual machine in the first computing node, and the memory of the primary virtual machine includes a first local memory and a shared memory.
[0153] The first data processing device of this embodiment includes a first acquisition module and a migration module.
[0154] The first acquisition module is used to acquire the state synchronization event of the primary virtual machine. In one embodiment, the first acquisition module can be used to perform the operation S210 described above, which will not be described in detail here.
[0155] The migration module is used to migrate the target memory page in the primary virtual machine from the first local memory to the shared memory, or from the shared memory to the first local memory according to the target storage policy. In one embodiment, the migration module can be used to perform the operation S220 described above, which will not be repeated here.
[0156] The target storage strategy includes at least one of the following: a first target storage strategy: storing the first memory page in the first local memory; a second target storage strategy: storing the second memory page in the shared memory; and the first memory page and the second memory page have different activity levels.
[0157] Based on the above data processing method applied to the second computing node, the present disclosure also provides a second data processing device. The second data processing device is arranged in the second computing node, the second data processing device is communicatively connected with a standby virtual machine in the second computing node, the second computing node has a standby virtual machine, and the memory of the standby virtual machine includes a second local memory and a shared memory.
[0158] The second data processing device of this embodiment includes a second acquisition module, a first determination module, and a second determination module.
[0159] The second acquisition module is used to acquire the target memory page in response to the target memory page being transferred from the first local memory of the primary virtual machine in the first computing node to the shared memory. In one embodiment, the second acquisition module can be used to perform the operation S410 described above, which will not be repeated here.
[0160] The first determination module is used to determine the association information according to the target memory page, where the association information represents the physical address of the shared memory used in the primary virtual machine. In one embodiment, the first determination module can be used to perform the operation S420 described above, which will not be described in detail here.
[0161] The second determination module is used to determine mapping information according to the association information, wherein the mapping information represents a mapping relationship between the virtual address, the physical address of the standby virtual machine, and the physical address of the second computing node. In one embodiment, the second determination module can be used to perform the operation S430 described above, which will not be described in detail here.
[0162] In order to facilitate understanding of the data processing method of the first data processing device and the second data processing device in the virtual machine fault tolerance process, Figure 8 Provide further explanation.
[0163] Figure 8 The diagram schematically shows a data processing device according to an embodiment of the present disclosure.
[0164] like Figure 8 As shown, a primary virtual machine is configured on the first computing node, and in response to the primary virtual machine starting the fault tolerance mechanism, a standby virtual machine is created on the second computing node. The same memory is hot-plugged into the first computing node and the second computing node at different times to form a CXL memory (shared memory). Both the primary virtual machine of the first computing node and the standby virtual machine of the second computing node can access the CXL memory.
[0165] All memory pages in the first local memory of the primary virtual machine are determined to be cold pages, and the migration module transfers the memory pages in the first local memory to the shared memory. After the state synchronization event is triggered for the first time (the first checkpoint), the primary virtual machine generates the address information of the target data in the current shared memory as the first address information set. The primary virtual machine notifies the standby virtual machine of the generated first address information set. After receiving the first address information set, the standby virtual machine can access the target data in the shared memory.
[0166] After acquiring the master virtual machine state synchronization event, the first acquisition module in the first data processing device at the master virtual machine end notifies the migration module, and the migration module migrates the target memory page from the first local memory to the shared memory, or from the shared memory to the first local memory according to the target storage policy. The second acquisition module in the second processing device at the standby virtual machine end acquires the target memory page transferred from the first local memory to the shared memory. After the first determination module determines the address information (associated information) of the master virtual machine using the shared memory for the target memory page, it notifies the second determination module. The second determination module establishes the page table and extended page table of the standby virtual machine for the eighth memory page according to the physical address used by the master virtual machine for the target memory page in the shared memory.
[0167] It will be appreciated by those skilled in the art that the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways, even if such combinations and / or combinations are not explicitly described in the present disclosure. In particular, the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways without departing from the spirit and teachings of the present disclosure. All of these combinations and / or combinations fall within the scope of the present disclosure.
[0168] The embodiments of the present disclosure are described above. However, these embodiments are only for illustrative purposes and are not intended to limit the scope of the present disclosure. Although the embodiments are described above separately, this does not mean that the measures in the various embodiments cannot be used in combination to advantage. The scope of the present disclosure is defined by the attached claims and their equivalents. Without departing from the scope of the present disclosure, those skilled in the art may make a variety of substitutions and modifications, which should all fall within the scope of the present disclosure.
Claims
1. A data processing method, applied to a first computing node, wherein the first computing node has a master virtual machine, the memory of the master virtual machine includes a first local memory and a shared memory, the method comprising: Obtaining a state synchronization event of the primary virtual machine; Migrating the target memory page in the primary virtual machine from the first local memory to the shared memory, or from the shared memory to the first local memory, according to the target storage policy; The target storage strategy includes at least one of the following: First target storage strategy: storing the first memory page in the first local memory; Second target storage strategy: storing the second memory page in the shared memory; The first memory page and the second memory page have different activity levels.
2. The method according to claim 1, The target storage policy is obtained by the following operations: Determining a target storage strategy for each memory page according to access information of each memory page in the memory of the primary virtual machine; The target memory page is obtained by the following operations: In a case where the initial storage location of the memory page is different from the target storage location, determining the memory page to be the target memory page; in, The storage location includes the first local memory and the shared memory.
3. The method according to claim 2, determining the target storage strategy of each memory page according to the access information of each memory page in the memory of the primary virtual machine, comprising: Determining attribute information of the memory page according to the access information of the memory page, wherein the attribute information represents the activity level of the memory page; In a case where the attribute information satisfies a first preset condition, determining the first target storage strategy, wherein the first preset condition indicates that a reading frequency of the memory page is greater than a first threshold; The second target storage strategy is determined when the attribute information satisfies a second preset condition, wherein the first preset condition indicates that the reading frequency of the memory page is less than a first threshold.
4. The method according to claim 1 or 3, when the target storage policy is the first target storage policy, migrating the target memory page in the primary virtual machine from the first local memory to the shared memory, or from the shared memory to the first local memory, according to the target storage policy, comprises at least one of the following: When the initial storage location of the target memory page is the shared memory, synchronizing the target memory page from the shared memory to the first local memory; When the initial storage location of the target memory page is the shared memory and the target memory page is marked as a dirty page, synchronizing the target memory page from the shared memory to the first local memory; When the initial storage location of the target memory page is the first local memory and the target memory page is marked as a dirty page, the target memory page is synchronized from the first local memory to the shared memory.
5. The method according to claim 1 or 3, when the target storage policy is the second target storage policy, migrating the target memory page in the primary virtual machine from the first local memory to the shared memory, or from the shared memory to the first local memory according to the target storage policy, comprising: When the initial storage location of the target memory page is the first local memory, the target memory page is transferred from the first local memory to the shared memory.
6. The method according to claim 3, further comprising: In response to the attribute information of the memory page in the first local memory changing from a first activity level to a second activity level, deleting the memory page from the first local memory, and having a backup memory page of the memory page in the shared memory; Determine, according to the first address mapping relationship of the standby virtual machine with respect to the backup memory page, a second address mapping relationship of the primary virtual machine with respect to the backup memory page; Among them, the first address mapping relationship represents the correspondence between the virtual address and the physical address of the backup virtual machine with respect to the backup memory page, the second address mapping relationship represents the correspondence between the virtual address and the physical address of the primary virtual machine with respect to the backup memory page, and the first activity level is greater than the second activity level.
7. The method according to claim 1, further comprising: In response to the primary virtual machine initiating a fault tolerance mechanism, creating a standby virtual machine on the second computing node; Creating the shared memory according to the primary virtual machine and the standby virtual machine; Migrating target data in the first local memory of the primary virtual machine to the shared memory; In response to a state synchronization event that triggers the primary virtual machine for the first time, the standby virtual machine is notified of a first address information set, where the first address information set represents an address of the target data in the shared memory.
8. A data processing method, applied to a second computing node, wherein the second computing node has a standby virtual machine, the memory of the standby virtual machine includes a second local memory and a shared memory, the method comprising: In response to the target memory page being transferred from the first local memory of the primary virtual machine in the first computing node to the shared memory, acquiring the target memory page; Determine association information according to the target memory page, where the association information represents a physical address of the shared memory used by the primary virtual machine; Mapping information is determined according to the association information, where the mapping information represents a mapping relationship between the virtual address, the physical address of the standby virtual machine, and the physical address of the second computing node.
9. A first data processing device, arranged in a first computing node, wherein the first data processing device is communicatively connected to a primary virtual machine in the first computing node, wherein the memory of the primary virtual machine includes a first local memory and a shared memory; The first data processing device comprises: A first acquisition module, used to acquire a state synchronization event of the master virtual machine; A migration module, configured to migrate a target memory page in the primary virtual machine from the first local memory to the shared memory, or from the shared memory to the first local memory, according to a target storage policy; The target storage strategy includes at least one of the following: First target storage strategy: storing the first memory page in the first local memory; Second target storage strategy: storing the second memory page in the shared memory; The first memory page and the second memory page have different activity levels.
10. A second data processing device, arranged in a second computing node, the second data processing device being communicatively connected to a standby virtual machine in the second computing node, the second computing node having a standby virtual machine, the memory of the standby virtual machine comprising a second local memory and a shared memory; The second data processing device comprises: A second acquisition module is used to acquire the target memory page in response to the target memory page being transferred from the first local memory of the primary virtual machine in the first computing node to the shared memory; A first determining module, configured to determine association information according to the target memory page, wherein the association information represents a virtual address of the primary virtual machine using the shared memory; The second determination module is used to determine mapping information according to the association information, where the mapping information represents a mapping relationship between the virtual address, the physical address of the standby virtual machine and the physical address of the second computing node.