CN117193931A - Dirty page sending method, external device and computing device - Google Patents

Dirty page sending method, external device and computing device Download PDF

Info

Publication number
CN117193931A
CN117193931A CN202310936593.1A CN202310936593A CN117193931A CN 117193931 A CN117193931 A CN 117193931A CN 202310936593 A CN202310936593 A CN 202310936593A CN 117193931 A CN117193931 A CN 117193931A
Authority
CN
China
Prior art keywords
page
memory
information
dirty
table entry
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310936593.1A
Other languages
Chinese (zh)
Inventor
刘晓建
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
XFusion Digital Technologies Co Ltd
Original Assignee
XFusion Digital Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by XFusion Digital Technologies Co Ltd filed Critical XFusion Digital Technologies Co Ltd
Priority to CN202310936593.1A priority Critical patent/CN117193931A/en
Publication of CN117193931A publication Critical patent/CN117193931A/en
Pending legal-status Critical Current

Links

Abstract

The application provides a dirty page sending method, external equipment and computing equipment. In an embodiment, an external device for use in a first computing device, the first computing device including an address translation page table, the address translation page table indicating a page table entry corresponding to a memory page of a virtual machine, the page table entry indicating a physical address in the memory page of the first computing device; the address conversion page comprises a first page table entry corresponding to the first memory page; the method comprises the following steps: receiving first information, wherein the first information indicates data to be modified corresponding to the virtual machine; determining to process data to be modified in a first memory page based on the first information; determining whether to register the first memory page as a dirty page in the first page table entry; if not, registering the first memory page as a dirty page in the first page table entry; information of the first memory page is sent to the first computing device. The CPU does not need to poll the register, so that the possibility of fully utilizing CPU resources is improved.

Description

Dirty page sending method, external device and computing device
Technical Field
The present application relates to the field of computer technologies, and in particular, to a dirty page sending method, an external device, and a computing device.
Background
A Virtual Machine (VM) is a Virtual environment created in a physical hardware system (external or internal) and acting as a Virtual computer system, which emulates its own set of hardware, including a CPU, memory, network interfaces, and storage. Through software called a virtual machine monitor, a user can separate the resources of the machine from the hardware and make appropriate provisions for use by the virtual machine.
Typically a Virtual Machine (VM) may migrate from one host computing system (i.e., a source host) to another host computing system (i.e., a destination host). In order to reduce the downtime of VM caused by the migration process, the virtual machine in the source host does not stop running in the migration process, and the memory state of the virtual machine is generally synchronized between the source host and the destination host in an iterative copy manner, that is: only content that has been newly modified from the previous copy is transferred to the destination physical machine at a time. The VM may control an external device such as a network card, for example, a disk, for example. The external device may also cause the content of the memory of the virtual machine to change, so that a dirty page condition caused by the external device needs to be obtained. Since the external device does not pass through the central processing unit (Central Processing Unit, CPU) when modifying the memory, the CPU cannot sense the dirty page condition caused by the external device, and therefore the external device is required to have dirty page reporting capability, so that the CPU can sense the dirty page condition of the external device.
In the related art, when an external device modifies a memory, a modified memory page (dirty page) is input to a CPU through a register; the CPU acquires a dirty page by polling a register and can currently output the next dirty page with the external device.
However, the polling method adopted in the scheme may reduce available resources of the CPU, and reduce the possibility of fully utilizing the resources of the CPU.
The information disclosed in this background section is only for enhancement of understanding of the general background of the application and should not be taken as an acknowledgement or any form of suggestion that this information forms the prior art already known to a person of ordinary skill in the art.
Disclosure of Invention
The embodiment of the application provides a dirty page sending method, external equipment and computing equipment, which are characterized in that on one hand, a CPU is not required to poll a register, so that the possibility of fully utilizing CPU resources is improved; on the other hand, in the way that the page table entry in the address translation page table is used to register whether the memory page is a dirty page, the current and last modified memory pages are not required to be the same.
In a first aspect, an embodiment of the present application provides a dirty page sending method, which is applied to an external device in a first computing device, where the first computing device includes an address translation page table, where the address translation page table indicates a page table entry corresponding to a memory page of a virtual machine, and the page table entry indicates a physical address of the memory page in the first computing device; the address conversion page comprises a first page table entry corresponding to the first memory page; the method comprises the following steps:
Receiving first information, wherein the first information indicates data to be modified corresponding to the virtual machine; determining to process data to be modified in a first memory page based on the first information; determining whether to register the first memory page as a dirty page in the first page table entry; if not, registering the first memory page as a dirty page in the first page table entry; information of the first memory page (such as a virtual page frame number) is sent to the first computing device.
In the scheme, on one hand, a CPU is not required to poll a register, so that the possibility of fully utilizing CPU resources is improved; on the other hand, in the way that the page table entry in the address translation page table is used to register whether the memory page is a dirty page, the current and last modified memory pages are not required to be the same.
In one possible implementation, the external device is a nonvolatile memory, the first information is a data operation request, and the data operation request indicates data to be modified and a first memory page, and is used for requesting to process the data to be modified in the first memory page.
In one possible implementation manner, the external device is a network card, the first information is a message sent to the virtual machine, and the first memory page is a memory page of the virtual machine, to which the message is written, determined by the external device.
In one possible implementation, the first memory page is divided into a plurality of sub-pages, and the information of the first memory page includes an address of a target sub-page, where the target sub-page is a sub-page of the first memory page that processes data to be modified.
In one possible implementation, sending information of the first memory page to the first computing device includes: recording the information of the first memory page into a locally stored dirty page information set; information in the set of dirty page information is sent to the first computing device. Illustratively, the memory address is a virtual machine physical address.
In the scheme, the information of the memory page is cached through the dirty page information set and then reported, before reporting, the memory page registered as the dirty page can be repeatedly modified without being registered as the dirty page again, after reporting to the computing equipment, the computing equipment can clear the information of registering the memory page as the dirty page, and then the memory page can be possibly modified, and at the moment, the memory page is also required to be registered as the dirty page; therefore, the dirty page information set is adopted for caching and deferred reporting, so that the possibility that the memory page is repeatedly registered can be reduced to a certain extent.
In one example of this implementation, transmitting information in the set of dirty page information to the first computing device includes: and when the information quantity in the dirty page information set reaches a preset threshold value or a query command of the first computing device is received, sending the information in the dirty page information set to the first computing device.
In one possible implementation, registering the first memory page as a dirty page in the first page table entry includes: the default bit in the first page table entry is set to a default value for indicating a dirty page, and the default bit is an ignore bit in the page table entry.
In the scheme, whether the memory page is a dirty page is registered through the neglected bit in the page table entry, so that the external equipment can acquire whether the memory page is the dirty page or not in a direct memory access mode.
In one possible implementation, the method further includes: in the case where the first memory page is registered as a dirty page in the first page table entry, a case where the first memory page is registered as a dirty page in the first page table entry is maintained.
In the scheme, before the external equipment reports the dirty page, multiple modifications to one memory page are only registered once, and the dirty page reporting efficiency can be improved on a certain program without the need of reporting the modified memory page each time.
In one possible implementation, the first information is information received by an external device during normal operation of the virtual machine during migration of the virtual machine to the second computing device.
In one possible implementation, the method further includes: determining a first page table entry based on matching of a first identification of the first memory page with cached page table entry information; the page table entry information comprises a first page table entry and a first identification corresponding to the first page table entry.
In the scheme, the page table item can be rapidly determined in a cache mode of the external equipment, so that the efficiency of judging whether the memory page is registered as a dirty page is improved.
In one example of this implementation, the first memory page is a modified memory page for a first number of memory copies; wherein the first memory copy number indicates a copy number of the memory in the first computing device; the page table entry information is cached information under the first memory copy number.
In the scheme, the accuracy of judging whether the memory page is registered as a dirty page is improved through page table item information under the memory copy times.
In one possible implementation, the first page table entry corresponds to a second memory page, the second memory page including a plurality of memory pages, the plurality of memory pages including the first memory page.
In one possible scenario, the first page table entry is used to record whether a plurality of memory pages are respectively registered as dirty pages.
In the scheme, whether a plurality of memory pages are respectively registered as dirty pages is recorded through the page table entry, so that the utilization rate of the page table entry is improved.
In another possible scenario, the first page table entry registers the second memory page as a dirty page; the method further comprises the steps of: updating the first page table item, and determining the updated first page table item; the updated first page table entry does not register the first memory page as a dirty page; based on the updated first page table entry, it is determined that the first memory page is not registered as a dirty page in the first page table entry.
In the scheme, when whether a memory page with larger space is registered as a dirty page or not is recorded through the page table entry, the memory page with larger space is split, and whether the memory page with smaller space is registered as the dirty page or not is determined, so that the method and the device flexibly adapt to various scene requirements.
In a second aspect, an embodiment of the present application provides a dirty page sending method, which is applied to a first computing device, where the first computing device includes an external device; the first computing device includes an address translation page table indicating a page table entry corresponding to a memory page of the virtual machine, the page table entry indicating a physical address of the memory page in the first computing device; the address conversion page comprises a first page table entry corresponding to the first memory page; the method comprises the following steps:
Receiving information of a first memory page sent by external equipment; the external device is used for receiving first information, and the first information indicates data to be modified corresponding to the virtual machine; determining to process data to be modified in a first memory page based on the first information; determining whether to register the first memory page as a dirty page in the first page table entry; if not, registering the first memory page as a dirty page in the first page table entry; transmitting information of the first memory page to the first computing device; clearing information registered in the first page table entry that the first memory page is a dirty page; and processing the page data of the first memory page.
In the scheme, on one hand, a CPU is not required to poll a register, so that the possibility of fully utilizing CPU resources is improved; on the other hand, in the mode that whether the memory page is a dirty page or not is registered by adopting a page table item in the address translation page table, the same modified memory page at present and last time is not required; in a further aspect, the information that the memory page registered in the page table entry is a dirty page is firstly cleared, and the page data of the memory page is processed, so that the possibility of missing the modified content of the memory page in the process of processing the page data of the memory page is reduced.
In one possible implementation manner, the first information is information received by an external device in a normal operation process of the virtual machine in a process of migrating the virtual machine to the second computing device; processing page data in a first memory page, including: page data in the first memory page is sent to the second computing device.
In a third aspect, an embodiment of the present application provides a dirty page sending apparatus, where the dirty page sending apparatus includes a plurality of modules, each module is configured to perform each step in the dirty page sending method provided in the first aspect of the present application, and the division of the modules is not limited herein. The specific functions and the achieved beneficial effects executed by each module of the dirty page sending apparatus refer to the functions of each step of the dirty page sending method provided in the first aspect of the embodiment of the present application, which are not described herein again.
Illustratively, the dirty page sending apparatus is disposed in an external device of the first computing device, the first computing device including an address translation page table, the address translation page table indicating a page table entry corresponding to a memory page of the virtual machine, the page table entry indicating a physical address of the memory page in the first computing device; the address conversion page comprises a first page table entry corresponding to the first memory page; comprising the following steps:
The information receiving module is used for receiving first information, and the first information indicates data to be modified corresponding to the virtual machine;
the page determining module is used for determining to-be-modified data processed in the first memory page based on the first information;
the judging module is used for determining whether the first memory page is registered as a dirty page in the first page table entry;
the register module is used for registering the first memory page as a dirty page in the first page table entry if the first memory page is not registered as the dirty page in the first page table entry;
and the sending module is used for sending the information of the first memory page to the first computing equipment.
In one possible implementation, the external device is a nonvolatile memory, the first information is a data operation request, and the data operation request is used for requesting modification of the first memory page.
In one possible implementation manner, the external device is a network card, the first information is a message sent to the virtual machine, and the first memory page is a memory page of the virtual machine, to which the message is written, determined by the external device.
In one possible implementation manner, the sending module comprises a buffer unit and a sending unit; wherein,
the cache unit is used for recording the information of the first memory page into a locally stored dirty page information set;
And a transmitting unit for transmitting information in the dirty page information set to the first computing device.
In one example of this implementation, the sending unit is configured to send the information in the dirty page information set to the first computing device when the amount of information in the dirty page information set reaches a preset threshold, or when a query command of the first computing device is received.
In one possible implementation, the registration module is configured to set a preset bit in the first page table entry to a preset value for indicating a dirty page, where the preset bit is an ignore bit in the page table entry.
In one possible implementation, the determining module is configured to, in a case where the first memory page is registered as a dirty page in the first page table entry, keep the case where the first memory page is registered as a dirty page in the first page table entry.
In one possible implementation, the first information is information received by an external device during normal operation of the virtual machine during migration of the virtual machine to the second computing device.
In one possible implementation, the judging module is configured to determine a first page table entry based on matching a first identifier of a first memory page with cached page table entry information; the page table entry information comprises a first page table entry and a first identification corresponding to the first page table entry.
In one example of this implementation, the first memory page is a modified memory page for a first number of memory copies; wherein the first memory copy number indicates a copy number of the memory in the first computing device; the page table entry information is cached information under the first memory copy number.
In one possible implementation, the first page table entry corresponds to a second memory page, the second memory page including a plurality of memory pages, the plurality of memory pages including the first memory page.
In one possible case, the first page table entry is used for recording whether the plurality of memory pages are respectively logged into dirty pages;
in another possible scenario, the first page table entry registers the second memory page as a dirty page; the judging module is used for updating the first page table item and determining the updated first page table item; the updated first page table entry does not register the first memory page as a dirty page; based on the updated first page table entry, it is determined that the first memory page is not registered as a dirty page in the first page table entry.
In a fourth aspect, an embodiment of the present application provides a dirty page sending apparatus, where the dirty page sending apparatus includes a plurality of modules, each module is configured to perform each step in the dirty page sending method provided in the second aspect of the embodiment of the present application, and the division of the modules is not limited herein. The specific functions and the achieved beneficial effects executed by each module of the dirty page sending apparatus refer to the functions of each step of the dirty page sending method provided in the second aspect of the embodiment of the present application, which are not described herein again.
Illustratively, the dirty page sending apparatus is disposed in a first computing device, the first computing device including an address translation page table, the address translation page table indicating a page table entry corresponding to a memory page of the virtual machine, the page table entry indicating a physical address of the memory page in the first computing device; the address conversion page comprises a first page table entry corresponding to the first memory page; the device comprises:
the receiving module is used for receiving the information of the first memory page sent by the external equipment; registering a first memory page as a dirty page in a first page table entry;
the clearing module is used for clearing the information registered in the first page table entry that the first memory page is a dirty page;
and the processing module is used for processing the page data of the first memory page.
In one possible implementation manner, the first information is information received by an external device in a normal operation process of the virtual machine in a process of migrating the virtual machine to the second computing device; and the processing module is used for sending the page data in the first memory page to the second computing device.
In a fifth aspect, an embodiment of the present application provides a dirty page transmitting apparatus, including: at least one memory for storing a program; at least one processor for executing the program stored in the memory, the processor being for performing the method provided in the second aspect when the program stored in the memory is executed.
In a sixth aspect, an embodiment of the present application provides a dirty page transmitting apparatus, the apparatus executing computer program instructions to perform the method provided in the second aspect. The apparatus may be, for example, a chip, or a processor.
In one example, the apparatus may include a processor, which may be coupled to the memory, read the instructions in the memory and perform the method provided in the second aspect in accordance with the instructions. The memory may be integrated into the chip or the processor, or may be separate from the chip or the processor.
In a seventh aspect, an embodiment of the present application provides an external device for performing the method provided in the first aspect. The external device may be a network card or a hard disk, for example.
In an eighth aspect, an embodiment of the present application provides a first computing device for performing the method provided in the second aspect.
The first computing device, for example, comprises: a processor and an external device;
the external device is used for receiving first information, and the first information indicates data to be modified corresponding to the virtual machine; determining to process data to be modified in a first memory page based on the first information; determining whether to register the first memory page as a dirty page in the first page table entry; if not, registering the first memory page as a dirty page in the first page table entry; transmitting information of the first memory page to a processor;
The processor is used for receiving information of a first memory page sent by the external equipment; clearing information registered in the first page table entry that the first memory page is a dirty page; and processing the page data of the first memory page.
In one possible implementation, the first information is information received by an external device during normal operation of the virtual machine in a process of migrating the virtual machine to the second computing device; the processor is to send page data in the first memory page to the second computing device.
In a ninth aspect, embodiments of the present application provide a computer storage medium having instructions stored therein which, when run on a computer, cause the computer to perform the method provided in the first aspect or to perform the method provided in the second aspect.
In a tenth aspect, embodiments of the present application provide a computer program product comprising instructions which, when run on a computer, cause the computer to perform the method provided in the first aspect, or to perform the method provided in the second aspect.
Drawings
FIG. 1 is a schematic diagram of a computing device provided by an embodiment of the present application;
FIG. 2 is a diagram illustrating memory address translation according to an embodiment of the present application;
FIG. 3a is a schematic diagram of an EPT page table provided by an embodiment of the present application;
FIG. 3b is a schematic diagram of a host physical address walked through an EPT page table according to an embodiment of the present application;
FIG. 4a is a flowchart illustrating a method for sending dirty pages according to an embodiment of the present application;
FIG. 4b is a second flowchart of a method for sending dirty pages according to an embodiment of the present application;
FIG. 4c is an exemplary diagram of a scenario of the dirty page transmission method provided in FIGS. 4a and 4 b;
FIG. 5a is a schematic diagram of a scenario in FIG. 4c in which a first page table entry is determined;
FIG. 5b is a second schematic view of the scenario in FIG. 4c, in which a first page entry is determined;
FIG. 5c is a third scenario diagram illustrating the determination of the first page table entry in FIG. 4 c;
FIG. 5d is an exemplary diagram of a scenario of the dirty page transmission method provided in FIG. 4 c;
FIG. 6a is a schematic diagram showing a scenario in FIG. 4c of reporting a VPN of a first memory page to a host;
FIG. 6b is a second schematic diagram of a scenario in which the VPN of the first memory page is reported to the host in FIG. 4 c;
FIG. 6c is a third schematic diagram of a scenario in which the VPN of the first memory page in FIG. 4c is reported to the host;
FIG. 6d is a schematic diagram of a scenario in which the VPN of the first memory page is reported to the host in FIG. 4 c;
FIG. 7 is a schematic diagram of a dirty page reporting system according to an embodiment of the present application;
FIG. 8a is a flowchart illustrating a method for sending dirty pages according to an embodiment of the present application;
FIG. 8b is a flowchart illustrating a method for sending dirty pages according to an embodiment of the present application;
FIG. 9 is a schematic view of a scenario of the dirty page transmission method provided in FIGS. 8a and 8 b;
fig. 10 is a schematic structural diagram of a dirty page sending apparatus according to an embodiment of the present application;
fig. 11 is a schematic diagram of a dirty page sending apparatus according to a second embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application more apparent, the technical solutions of the embodiments of the present application will be described below with reference to the accompanying drawings.
In describing embodiments of the present application, words such as "exemplary," "such as" or "for example" are used to mean serving as examples, illustrations or explanations. Any embodiment or design described herein as "exemplary," "such as" or "for example" is not necessarily to be construed as preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary," "such as" or "for example," etc., is intended to present related concepts in a concrete fashion.
In the description of the embodiments of the present application, the term "and/or" is merely an association relationship describing an association object, and indicates that three relationships may exist, for example, a and/or B may indicate: a alone, B alone, and both A and B. In addition, unless otherwise indicated, the term "plurality" means two or more. For example, a plurality of systems means two or more systems, and a plurality of terminals means two or more terminals.
Furthermore, the terms "first," "second," and the like, are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating an indicated technical feature. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include one or more such feature. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless expressly specified otherwise.
Hereinafter, some terms in this embodiment will be explained. It should be noted that these explanations are for the convenience of those skilled in the art, and do not limit the scope of the present application.
Central processing unit (Central Processing Unit, CPU for short): the operation and control core of the computer system is the final execution unit for information processing and program running.
Thermo Migration (Live Migration): the dynamic migration and the real-time migration, namely the preservation/recovery of the virtual machine, generally preserve the running state of the whole virtual machine completely, and can quickly recover to the original hardware platform or even different hardware platforms. After recovery, the virtual machine is still running smoothly, and the user does not perceive any differences.
Direct memory access (Direct Memory Access, DMA): is a function provided by some computer bus architecture that enables data to be transferred directly from an attached device (e.g., disk drive) to the memory of a computer motherboard.
External device: input, output devices, external memory in a computer system are collectively referred to as. And plays a role in transmitting, transferring and storing data and information. Is an important component in computer systems. The peripheral device relates to any equipment except the computer core (CPU and memory), and is used for interacting data and information with the computer core to realize the functions of transmission, transfer and storage.
Virtual Address (VA): for a running process, the address pointed to by the pointer in the code instruction, the function entry address, the return address, etc., the address that the process can directly see belongs to the virtual address.
Physical Address (PA): for a physical CPU, when the CPU executes a specific instruction, it needs to acquire specific data information in some addresses, where the addresses that he accesses belong to the physical addresses.
Virtual Machine (VM): is a special software. The virtual machine may create an environment between the computer platform and the end user to facilitate the end user to operate other software based on the environment created by the virtual machine. From the application's perspective, the program runs on a virtual machine as it does on its corresponding physical computer.
Virtual machine monitor (Virtual Machine Monitor, VMM): is a special software. The VMM may manage and externally monitor the VM. In addition, the VMM is also called a hypervisor.
Host physical page: the Physical storage space is divided into Physical Pages (PP), also called Page frames (Page frames), abbreviated as real pages, and also p=2ζ bytes in size. Memory addresses for storing instruction streams and data. In the embodiment of the application, the host physical page is simply referred to as a physical page.
Page frame number (page frame number, PFN): the page frame is a physical memory, which is divided into individual page size areas, and each page is numbered, and this number is referred to as PFN. Assuming physical memory starts at a 0 address, then the page frame with PFN equal to 0 is the page at which the 0 address (physical address) starts. Assuming that the physical memory starts at x address, then the first PAGE frame number is (x > > page_shift).
Virtual Page (VP): by dividing the virtual memory space into Virtual Pages (VP) of a fixed size, referred to as virtual pages, each virtual Page has a size of p=2ζ bytes. In the embodiment of the application, the virtual page of the virtual machine is called as a memory page.
Virtual page number (virtually page number, VPN for short): the page number of the Virtual Page (VP) may also be referred to as a virtual page frame number (virtually page number).
Client physical address (Guest Physical Address, GPA): embodiments of the present application refer to virtual machine physical addresses, such as Virtual Page Numbers (VPNs), which may be virtual pages.
Linear address of client process (Guest Virtual Address, GVA): the embodiment of the application is called virtual machine virtual address.
Host physical address (Host Physical Address, HPA): the actual physical address of the memory may be, for example, a Page Frame Number (PFN) of a physical page.
Extended page-table (EPT): implementing a translation mechanism from a client physical address (GPA) to a Host Physical Address (HPA); on Intel CPUs, this mechanism is called EPT, on AMD CPUs, this mechanism is called nested page tables (Nested Page Tables, NPT). The term EPT is used in its entirety in the embodiments of the present application. In EPT enabled systems, translation of Guest Physical Addresses (GPAs) to Host Physical Addresses (HPAs) is accomplished through a series of EPT page table structures.
Dirty pages: the method is a concept in a linux kernel, because the read-write speed of a hard disk is far from the speed of a memory, the system puts data with more frequent read-write into the memory in advance to improve the read-write speed, the cache is called as a cache, and when a process modifies the data in the cache, the page is marked as a dirty page by the kernel.
The message comprises the following steps: is the data unit exchanged and transmitted in the network, i.e. the data block to be transmitted by the station at one time. The message contains the complete data information to be sent, and the length of the message is not consistent, and the length of the message is unlimited and variable.
Embodiments of the present application provide a computing device. As shown in fig. 1, the computing device 100 includes a host 101 and an external device 102, the host 101 including hardware (CPU and memory), a Virtual Machine Manager (VMM) disposed on the hardware, and a number of Virtual Machines (VMs). Wherein, the Virtual Machine (VM) is equivalent to a host computer and comprises an operating system and a plurality of applications; illustratively, the host may include 2 Virtual Machines (VMs), one of which includes an operating system Windows and N applications, and the other of which includes an operating system Linux and M applications. The external device 102 is a device that performs data interaction with the host 101, such as a network card and a nonvolatile memory. By way of example, the non-volatile storage may be a Hard Disk, which may include a Solid State Disk (SSD) and/or a mechanical Hard Disk (HDD). It should be noted that, a plurality of virtual machines may be created on one host 100, and the number of virtual machines to be created depends on the hardware configuration of the host 100 itself and the size of the virtual machines to be created. In one possible application scenario, host 101 may be a server that provides various cloud services.
The virtualization technology introduces a new software layer, namely a Virtual Machine Manager (VMM), into the host 101, where the Virtual Machine Manager (VMM) provides a required running environment abstraction for the virtual machine, and can control and manage access and use of the virtual machine to real physical resources, such as a CPU, a memory, an external device, and the like, and virtualize the underlying hardware resources, such as memory virtualization and CPU virtualization, so as to abstract the virtual machine to a corresponding virtual device interface for use by the virtual machine. Correspondingly, each virtual machine has own virtual hardware (such as a CPU, a memory, an external device, etc.) to provide an independent virtual machine execution environment.
In the memory virtualization technology, memory address translation is one of the bases of memory virtualization. The purpose of memory address translation is to provide virtual machines with a zero-start and contiguous memory space, and to effectively isolate, schedule, and share memory resources between virtual machines. To achieve this, the VMM introduces a new layer of address space, namely virtual machine physical addresses (GPA), which is not the real physical address space, but is simply a mapping of host memory address translation space in the virtual machine address space. For each virtual machine running on the host, an independent, continuous virtual machine physical address from scratch can be seen; however, for a host, the virtual machine physical addresses are not necessarily contiguous, and it is possible for the virtual machine physical addresses to map to several non-contiguous host physical addresses. The main task of memory virtualization is to realize the virtualization of the address space of a virtual machine, and after the virtual machine physical address space is introduced, the memory virtualization supports the virtualization of the address space through twice address conversion; as shown in fig. 2, in address translation, it is necessary to translate from a virtual machine virtual address (GVA) to a virtual machine physical address (GPA) and then from the virtual machine physical address (GPA) to a Host Physical Address (HPA). Translation of virtual machine physical addresses (GPAs) to Host Physical Addresses (HPAs) is typically accomplished by a page table, which in the present embodiment is referred to as an address translation page table, located in a Virtual Machine Manager (VMM).
For ease of description and distinction, the address translation page table will be described first.
The address translation page table is used for storing the correspondence between virtual machine physical addresses (GPAs) and host machine physical addresses (HPAs). In the virtual machine technology, the address translation Page table is a two-dimensional Page table (2-dimension Page table) used for mapping a virtual machine physical address (GPA) to a host machine physical address (HPA), and may be, for example, an Extended Page Table (EPT), a two-Stage Page table (spt), or the like.
The address translation page table may be an EPT page table, for example. The EPT page table comprises a multi-level page table, and the number of page tables can be determined according to the size of the memory page. For example, EPT page tables include 4-level page tables when the physical page size is 4k, and EPT page tables include 3-level page tables when the physical page size is 2M. For example, as shown in FIG. 3a, EPT page tables may include a 4-level page table, a 3-level page table, a 2-level page table, and a 1-level page table. Wherein the 4-stage page table has one page; the 3-level page table may have 512 pages (only two pages are shown in the figure); the level 2 page table may have 512 x 512 = 26144 pages (illustrated with only 4 pages); the level 1 page table may have 26262620×512= 134217728 pages (only 8 pages are shown). Wherein each page may comprise 512 entries (only 2 entries are shown in fig. 3), each entry being 8 bytes, that is, each page having 512 x 8 = 4096 bytes, that is, each page being 4k. Wherein each entry of the 4-level page table corresponds to each page of the 3-level page table, similarly, each entry of the 3-level page table corresponds to each page of the 2-level page table, each entry of the 2-level page table corresponds to each page of the 1-level page table, each entry of the 1-level page table corresponds to each page of the physical page, and the embodiment of the application refers to the entry of the 1 st level as a page table entry.
Next, the contents of the page table entry are introduced. Specifically, as shown in FIG. 3b, the page table entry includes a physical page base address (which may be considered a Host Physical Address (HPA) in embodiments of the application), ignore bits (bits not of interest to the CPU) and attention bits (bits of interest to the CPU). The ignore bits may be user configurable, are some flexibly configurable bits.
Next, it is introduced how the EPT page table indicates the correspondence between the virtual machine physical address (GPA) and the Host Physical Address (HPA), and how the CPU determines the Host Physical Address (HPA) to which the virtual machine physical address (GPA) corresponds according to the EPT.
In a virtual machine, all addresses are virtual addresses that are translated by the CPU into virtual machine physical addresses (GPA) based on information held in a set of tables maintained by the VMM. To do this, the virtual memory space is typically divided into blocks that may be referred to as "Virtual Pages (VP)". The embodiments of the present application refer to these Virtual Pages (VPs) as memory pages, which may be the same size, and each memory page is assigned a unique Virtual Page Number (VPN), one physical page for each memory page. Employing a Virtual Page Number (VPN) in the virtual address; correspondingly, the virtual machine physical address (GPA) may comprise a Virtual Page Number (VPN). The CPU may translate Virtual Page Numbers (VPNs) into Page Frame Numbers (PFNs) of physical pages through 1 or more EPT page tables. Correspondingly, the EPT page table indicates the correspondence of the Virtual Page Number (VPN) of the memory page and the Page Frame Number (PFN) of the physical page. The Virtual Page Number (VPN) may be understood as an address of a memory page, and the Page Frame Number (PFN) may be understood as an address of a physical page.
In specific implementation, as shown in fig. 3b, the CPU determines, at one level, the Page Frame Number (PFN) of the physical page corresponding to the virtual machine physical address (GPA) according to the Virtual Page Number (VPN) in the GPA and each level of page tables in the EPT page table. For each stage of page table, both the page number and the entry of the stage of page table are determined, and the page number of the stage of page table can be determined according to the entry of the previous stage of page table, for example, the entry of the page can be determined according to a 10-system numerical value converted by a virtual machine physical address (GPA) under binary system. Note that the physical address of the page at the top layer of the EPT page table is provided by an extended page table pointer (Extended Page Tab le Pointer, EPTP) field.
It should be noted that, the above-mentioned EPT page table is merely taken as an example of an address translation page and is not limited in particular, and for convenience of description, the embodiment of the present application is described by taking the EPT page table as an example, and any page table similar to the EPT page table in structure may be applied to the scheme provided by the embodiment of the present application.
It should be noted that, the Virtual Machine Manager (VMM) may also be provided with various software for providing services. As shown in FIG. 1, page table management software may be included, which may assist in implementing the dirty page sending method provided by the embodiments of the present application. In addition, the host 101 may set a dirty page processing service, which may also assist in implementing the dirty page sending method provided in the embodiment of the present application. In some possible cases, as shown in FIG. 1, the dirty page processing service may be located outside of a Virtual Machine Manager (VMM). In other possible cases, the dirty page processing service may be provided within a Virtual Machine Manager (VMM). Embodiments of the present application are not intended to limit the relationship between dirty page processing services and Virtual Machine Managers (VMMs), and may be specifically designed in connection with actual needs.
Based on the above, the embodiment of the application provides a technical scheme of dirty page report.
The method records whether a corresponding memory page is a dirty page or not by utilizing a page table entry in an address translation page table; the corresponding memory page is a memory page of the virtual machine indicated by the page table entry. Subsequently, for the external device 102 controlled by the virtual machine, in the process of modifying the memory page, the external device 102 can detect whether the page table item corresponding to the memory page in the address translation page table registers that the memory page is a dirty page, and if the page table item is already registered, the page table item is not registered any more; if not, the memory page is registered as a dirty page through the page table entry corresponding to the memory page, and the information of the memory page (for identifying the memory page, for example, may be a Virtual Page Number (VPN)) is reported to the host 101. By adopting the mode, on one hand, a CPU is not required to poll a register, so that the possibility of fully utilizing CPU resources is improved; on the other hand, in the mode that whether the memory page is a dirty page or not is registered by adopting a page table item in the address translation page table, the same modified memory page at present and last time is not required; in yet another aspect, multiple modifications to a memory page are registered only once prior to reporting, thereby improving the efficiency of dirty page reporting over a program. This is merely a brief description of the method, and reference is made to the following description for details of this method.
It should be noted that, in a specific implementation, the external device 102 may receive information (for convenience of description and distinction, may be referred to as first information) sent by the virtual machine of the host 101 or other devices to the virtual machine, where the first information indicates data to be modified, and in a process of processing the first information, the data to be modified is processed in a memory page.
In one example, the external device 102 may be a hard disk; the first information may be an external operation request; in a specific implementation, the external device 102 may receive a data operation request sent by the host 101, and the external device 102 may process the data operation request and modify a memory page.
Illustratively, when the data operation request is delete or change, the external device 102 modifies the memory page by DMA to delete or change the data; when the data operation request is insert, the external device 102 needs to determine a memory page for writing data, and modifies the memory page in a DMA mode to realize data insert; since the host 101 does not know the result of the external device 102 processing the data operation request, it is necessary to report the dirty page to the host 101 so that the host 101 knows the memory page modified by the external device 102.
For example, the data operation request may indicate an operation to delete data, update data, or write data to a memory page. At this time, the external device 102 determines the memory page indicated by the data operation request, and modifies the memory page. Since the host 101 does not know whether the external device 102 is processing in accordance with the data operation request, it is necessary to report a dirty page to the host 101 so that the host 101 knows that the external device 102 has modified the memory page.
In one example, the external device 102 may be a network card; the first information may be a message; in a specific implementation, the external device 102 may receive a message sent by another device, then determine a memory page to which the message is written, modify the memory page by using a DMA method, and write the message sent by the other device to the host 101; illustratively, the host 101 sends a data write instruction and a range of memory pages in which data can be written to the external device 102, where the data write instruction instructs the external device 102 to write data to the memory pages when receiving the data; correspondingly, the external device 102 may select a memory page from the memory pages capable of writing data, and write a message. Since the host 101 does not know where the external device 102 stores messages that the external device 102 sends to the host 101, it is necessary to report dirty pages to the host 101 so that the host 101 knows the memory pages in which the external device 102 stores messages.
The other devices may be terminals, other computing devices 100, devices in computing device 100, such as another network card, another host, etc., as examples. The terminal may be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices.
The following sections will explain preferred embodiments of the present application in detail with reference to the figures.
Fig. 4a is a flowchart of a dirty page sending method according to an embodiment of the present application. The embodiment can be applied to a computing device 100, wherein the computing device 100 runs a virtual machine, and a host 101 of the computing device comprises an address translation page table; the address translation page table indicates the correspondence between the address of the memory page (the virtual machine physical address (GPA) in the embodiment of the present application, for example, may be a Virtual Page Number (VPN)) and the physical address of the physical page (the Host Physical Address (HPA) in the embodiment of the present application); in particular, the address translation page table includes a page table entry corresponding to a memory page of the virtual machine, where the page table entry indicates a physical address (an address of a physical page) of the memory page in the host 101; the method comprises the steps of including a first page table entry corresponding to a first memory page; then, as shown in fig. 4a, the dirty page sending method provided in the embodiment of the present application at least includes the following steps:
In step 401, the host 101 sends first information to the external device 102, where the first information indicates data to be modified corresponding to the virtual machine.
For example, when the external device 102 is a hard disk, the virtual machine running on the host 101 may determine the first information and transmit it to the external device 102. The first information may be a data manipulation request indicating deletion, update, or insertion of data. For example, the first information may indicate a first memory page and data to be modified.
Illustratively, as shown in FIG. 4c, the host 101 sends a data operation request to the external device 102 (step (1 a) in FIG. 4 c), which is determined by the virtual machine.
It should be noted that, the data to be modified corresponding to the virtual machine may consider that the data to be modified is related to the virtual machine, for example, needs to be generated by a running process of the virtual machine, or is sent to the virtual machine.
Step 402, the external device 102 determines to process the data to be modified in the first memory page based on the first information.
In particular implementations, the external device 102 may process the first information to determine an address of a first memory page, such as a virtual machine physical address (GPA), that processes data to be modified.
In some possible cases, the virtual machine physical address (GPA) may be a Virtual Page Number (VPN), and the embodiment of the present application uses this as an example to describe the scheme; when the first memory page is divided into a plurality of sub-pages, the sub-pages are numbered in sequence as addresses of the sub-pages, and the virtual machine physical address (GPA) may be a Virtual Page Number (VPN) and an address (number) of a target sub-page.
For example, when the external device 102 is a hard disk, the first information may be a data operation request, where the data operation request is used to instruct processing such as data deletion, data update, or data writing to the first memory page; the external device 102 determines a first memory page based on the first information, and then processes data to be modified in the first memory page; here, processing the data to be modified in the first memory page may be deleting, updating, or inserting the data to be modified in the first memory page.
Step 403, the external device 102 determines whether the first memory page is registered as a dirty page in the first page table entry, and if not, step 404 is performed.
Step 404, the external device 102 registers the first memory page as a dirty page in the first page table entry.
According to one possible implementation, the external device 102 determines whether to register the first memory page as a dirty page based on the information of the preset bit in the first page table entry. The preset bit is an Ignore (Ignow) bit in the first page table entry. Illustratively, as shown in fig. 4c, in a specific implementation, the external device 101 reads the preset bit information (step (5) in fig. 4 c), and determines whether the first memory page is registered as a dirty page based on the preset bit information (step (6) in fig. 4 c).
In particular implementations, to facilitate the use of page table management software to freely schedule multiple Ignore (Ignore) bits in an EPT page table, external device 102 may provide a dirty (Di rty) bit mask to page table management software, such as when the mask is 0x8000000000000000, indicating that external device 102 uses bit 63 of a page table entry as a dirty (Di rty) bit. Thus, the page table management software can set the 63 rd bit in the page table entry as a preset bit for recording whether the memory page corresponding to the page table entry is a dirty page or not. Subsequently, the external device 102 may determine a preset bit from the first page table entry and a preset dirty (Di rty) bit mask; based on the information of the preset bit, whether the first memory page is registered as a dirty page is determined.
Notably, the external device 102 can determine whether to register the first memory page as a dirty page in the first page table entry after completing the modification to the first memory page. Or before modifying the first memory page, determining whether the first memory page is registered as a dirty page in the first page table entry; it may also be determined whether the first memory page is registered as a dirty page in the first page table entry during the modification of the first memory page. The embodiment of the present application is not intended to limit the timing of determining whether to register the first memory page as a dirty page in the first page table entry, and may specifically be determined in conjunction with actual requirements, for example, when the data security comparison is re-looked at, the external device 102 may determine whether to register the first memory page as a dirty page in the first page table entry after completing the modification to the first memory page.
In this implementation, the external device 102 registering the first memory page as a dirty page in the first page table entry includes: the external device 102 sets a preset bit in the first page table entry to a preset value for indicating a dirty page. For example, as shown in fig. 4c, in a specific implementation, when it is determined that the first memory page is not registered as a dirty page, the external device 101 modifies the information of the preset bit (step (7) in fig. 4 c), thereby registering the first memory page as a dirty page in the first page table entry.
According to one possible implementation, the external device 102 may also determine the first page table entry based on the identification of the first memory page, prior to step 403.
In practical applications, the address translation page table is located in the memory of the host 101. In one possible scenario, the external device 102 determines an address of the first page table entry in memory, and reads the first page table entry from memory based on the address. Specifically, the external device 102 may read out the first page table entry by way of DMA. Illustratively, as shown in FIG. 5a, the external device 102 reads the EPTP field of the EPT page table from the host 101 (step (411) in FIG. 5 a), calculates the address of the first page table entry (entry in the level 1 page table in the EPT page table) based on the EPTP field and the Virtual Page Number (VPN) of the first memory page (step (412) in FIG. 5 a) in accordance with the method described in FIG. 3 b; based on the address, the external device 102 reads out the first page table entry from the memory of the host 101 by DMA (step (413) in fig. 5 a). It should be noted that steps (411), (412) and (413) in fig. 5a are one possible implementation of step (4) in fig. 4 c.
In another possible scenario, the external device 102 may internally cache the page table entry and the identity of the memory page to which the page table entry corresponds. Correspondingly, the external device 102 may match the identifier of the first memory page with the identifier of the cache, and take the page table entry corresponding to the matched identifier of the cache as the first page table entry. Therefore, the first page table item does not need to be read in a DMA mode, the data processing amount is reduced, and the processing efficiency is improved.
Illustratively, as shown in FIG. 5b, the external device 102 may internally cache page table entries and Virtual Page Numbers (VPNs) of memory pages corresponding to the page table entries. Correspondingly, the external device 102 may match (step (421) in fig. 5 b) based on the Virtual Page Number (VPN) of the first memory page and the cached Virtual Page Number (VPN), and use the page table entry corresponding to the matched Virtual Page Number (VPN) as the first page table entry (step (422) in fig. 5 b). It should be noted that steps (421) and (422) in fig. 5b are one possible implementation of step (4) in fig. 4 c.
In addition, the external device 102 may perform matching based on the identifier of the first memory page and the identifier of the cache, if there is no matching identifier of the cache; it is necessary to determine the address of the first page table entry in the memory and read the first page table entry from the memory based on the address.
Illustratively, as shown in FIG. 5c, the external device 102 may internally cache page table entries and Virtual Page Numbers (VPNs) of memory pages corresponding to the page table entries. Correspondingly, the external device 102 may match based on the Virtual Page Number (VPN) of the first memory page and the cached Virtual Page Number (VPN) (step (421) in fig. 5 c); if the match fails (step 423 in FIG. 5 c), the EPTP field of the EPT page table is read from host 101 (step 411 in FIG. 5 c), and the address of the first page table entry (entry in the level 1 page table in the EPT page table) is calculated (step 412 in FIG. 5 c) based on the EPTP field and the Virtual Page Number (VPN) of the first memory page in accordance with the method described in FIG. 3 b; based on the address, the external device 102 reads out the first page table entry from the memory of the host 101 by DMA (step (413) in fig. 4 c). It should be noted that steps (421), (423), (411), (412), (413) in fig. 5c are one possible implementation of step (4) in fig. 4 c.
According to one possible implementation, the external device 102 may determine whether to register the first memory page as a dirty page in the first page table entry based on information recorded in a preset bit in the first page table entry.
In one possible scenario of this implementation, the first page table entry may correspond to a second memory page, where the second memory page includes a plurality of memory pages, including the first memory page. For example, the second memory page may have a size of 2M, and the first memory page may have a size of 4K.
In one example of this, the first page table entry is used to record whether each of the second memory pages is registered as a dirty page. In a specific implementation, a plurality of Ignore (Ignore) bits in the first page table entry are respectively in one-to-one correspondence with a plurality of memory pages in the second memory page. For each of a plurality of Ignore (Ignow) bits, information of the Ignore (Ignow) bit is used to indicate whether a corresponding memory page is registered as a dirty page. Illustratively, assuming a second memory page of size 2M, the Ignore (Ignore) bits in the first page table entry include Bit61:62, bit59, bit52:56, bit11, when the dirty pages are marked with Bit61:62, bit59, bit52:56, 2MB may be divided into 8 regions, such that each region corresponds to 256KB of physical memory.
In another example of this case, the first page table entry is used to record whether the second memory page is registered as a dirty page. If the first page table entry records that the second memory page is registered as a dirty page, the second memory page is described as having the dirty page, but the dirty page is not known; in addition, the external device 102 may consider the second memory page as a dirty page as a whole, and at this time, it cannot be determined whether the first memory page is registered as a dirty page. For such a case, the host 101 may actively split the address translation page table to obtain an updated first page table entry, where the updated first page table entry corresponds to the first memory page and is used to record whether the first memory page is registered as a dirty page; subsequently, the external device 102 determines an address of the updated first page table entry in the memory, and reads the updated first page table entry from the memory based on the address. It should be noted that, after splitting the address translation page table, the host 101 needs to re-register the address translation page table in the external device 102, and after receiving the request for registering the address translation page table, the external device 102 needs to discard the related information of the previous address translation page table, such as the cached page table entry, so as to ensure that the latest address translation page table is used. It is noted that when the host 101 splits the address translation page table, the default bit in the page table entry that records whether the corresponding memory page is a dirty bit remains unchanged. Subsequently, the external device 102 determines whether to register the first memory page as a dirty page according to the updated information of the preset bit in the first page table entry. If the first memory page is not registered as a dirty page, setting a preset bit in the updated first page table entry to a preset value for indicating the dirty page.
Illustratively, as shown in fig. 5d, when the external device 102 determines the first page entry corresponding to the second memory page (step (431) in fig. 5 d), when the second memory page indicated by the first page entry is a large page, such as a 2M memory page; at this time, the external device 102 notifies the host 101 to update the EPT page table (step (432) in fig. 5 d); the host 101 splits the EPT page table to obtain an updated EPT page table; subsequently, the external device 102 reads the updated EPTP field of the updated EPT page table from the host 101 (step (433) in fig. 5 d), calculates the address of the updated first page table entry (the entry in the 1-level page table in the updated EPT page table) based on the updated EPTP field and the Virtual Page Number (VPN) of the first memory page (step (434) in fig. 5 d) in accordance with the method described in fig. 3 b; based on the address, the external device 102 reads the updated first page table entry from the memory of the host 101 (step (435) in fig. 5 d); subsequently, it is determined whether the first memory page is registered as a dirty page based on the updated information of the preset bit in the first page table entry (step (5) in fig. 5 d) (step (6) in fig. 5 d). It should be noted that steps (431), (432), (433), (434), (435) in fig. 5d are one possible implementation of step (4) in fig. 4 c.
Step 405, the external device 102 sends information of the first memory page to the host 101.
It should be noted that, the information of the first memory page indicates an address of the first memory page, so that the host 101 may access the first memory page.
For example, as shown in fig. 4c, 5a, 5b, 5c, 5d, 6a, and 6b, the information of the first memory page may be a Virtual Page Number (VPN) of the first memory page.
In other possible cases, the first memory page is divided into a plurality of sub-pages, and the information of the first memory page includes an address of a target sub-page, the target sub-page indicating a sub-page of the first memory page that processes data to be modified.
Illustratively, as shown in FIG. 4c, the host 101 is provided with a dirty page receive buffer for receiving information provided by the external device 102 to a first memory page of the host 101; the host 101 processes the information in the dirty page receive buffer.
In one possible scenario, as shown in fig. 6a, the internal portion of the external device 102 may be provided with a dirty page information buffer, which may be considered as a set of dirty page information, and in actual application, information may be added to the dirty page information buffer until the capacity of the dirty page information buffer is reached.
In a specific implementation, the external device 102 writes the information of the first memory page into a locally stored dirty page information buffer (dirty page information set); information in a dirty page information buffer (dirty page information set) is provided to the host 101. In particular implementations, the external device 102 may provide all of the information in the dirty page information buffer (dirty page information set) to the host 101, or may provide some of the information to the host 101.
In one possible implementation, as shown in fig. 6a, the external device 102 writes a Virtual Page Number (VPN) of the first memory page into a locally stored dirty page information buffer (step (811) in fig. 6 a); the information in the dirty page information buffer is provided to the host 101 after the preset condition is satisfied (step (812) in fig. 6 a).
In one example of this implementation, the external device 102 may actively provide information in the dirty page information buffer to the host 101. Alternatively, the preset condition may be that the amount of information in the dirty page information buffer reaches a preset threshold. The preset threshold may be determined in conjunction with actual requirements, which is not specifically limited in the embodiments of the present application.
In another example of this implementation, the external device 102 may passively provide information in the dirty page information buffer to the host 101. Alternatively, the preset condition may be that a query command is received. The query command may be issued by the processor of the host 101, or may be issued by the processor of the host 101 after the external device 102 notifies the host 101. In a specific implementation, as shown in fig. 6c, the external device 102 has a command interface, through which the host 101 may send a query command to the external device 102.
In one possible scenario, a dirty page information buffer (dirty page information set) may be provided external to the external device 102. In a specific implementation, as shown in fig. 6b, a dirty page information buffer (dirty page information set) may be provided in the host 101. At this time, the process in which the external device 102 writes the information of the first memory page into the dirty page information buffer (dirty page information set) may be regarded as reporting to the host 101. Illustratively, the external device 102 writes the information of the first memory page into a dirty page information buffer (dirty page information set) by way of DMA.
Subsequently, as shown in fig. 6b, the information in the dirty page information buffer (dirty page information set) is cached by the host 101, and when a preset condition is satisfied, the information in the dirty page information buffer (dirty page information set) is provided to the dirty page information receiving buffer for subsequent processing.
In example 1, the preset condition may be that the amount of information in the set of dirty page information reaches a preset threshold.
In example 2, the preset condition may be the receipt of a query command.
In the 3 rd example, as shown in fig. 6c, the preset condition may be that the external device 102 receives a dirty page transmission completion instruction sent by the external device 102 after receiving the inquiry command.
In the 4 th example, as shown in fig. 6d, the preset condition may be that a dirty page transmission completion instruction sent by the external device 102 is received, and the amount of information in the dirty page information set is greater than a threshold.
Since the external device 102 generally writes information of a fixed data amount at a time, when the information of the first memory page does not reach the fixed data amount, the information of the first memory page needs to be cached, and after the cached information reaches the fixed data amount, the dirty page information set is written. In the embodiment of the present application, in order to enable the external device 102 to not cache the information of the first memory page when the host 101 processes the information in the dirty page information set. The following 2 processing modes can be adopted:
treatment mode 1: as shown in fig. 6c and 6d, when the external device 102 does not internally cache the information of the dirty page, a dirty page transfer completion instruction is reported to the host 101. Under the condition of this processing mode 1, subsequently, the host 101 can process information in the dirty page information set when the preset condition under the above-described 4 th example is satisfied.
Treatment mode 2: as shown in fig. 6c, when receiving the inquiry command sent by the host 101, the external device 102 writes the cached information of the dirty page into a dirty page receiving buffer (dirty page information set) set by the host 101, and then reports a dirty page transfer completion instruction to the host 101. Under the condition of this processing mode 2, subsequently, the host 101 can process the information in the dirty page information set when the preset condition under the above-described 3 rd example is satisfied.
Step 406, the host 101 processes the page data of the first memory page.
Illustratively, the information of the first memory page may be a Virtual Page Number (VPN) of the first memory page; the host 101 may process all page data of the first memory page.
Illustratively, the information of the first memory page may be an address (number) of a target sub-page in the first memory page; the host 101 processes the page data of the target sub-page.
In the scheme, on one hand, a CPU is not required to poll a register, so that the possibility of fully utilizing CPU resources is improved; on the other hand, in the mode that whether the memory page is a dirty page or not is registered by adopting a page table item in the address translation page table, the same modified memory page at present and last time is not required; in yet another aspect, multiple modifications to a memory page are registered only once prior to reporting, thereby improving the efficiency of dirty page reporting over a program.
Based on the above provided dirty page transmission method, a specific application of the dirty page transmission method will be described.
Fig. 4c is a schematic diagram of a specific application of a dirty page sending method according to the embodiment of the present application. As shown in fig. 4c, specifically includes: the host 101 sends a data operation request to the external device 102, where the data operation request includes a Virtual Page Number (VPN) of a first memory page and data to be modified, and the data operation request is used to process the data to be modified in the first memory page; the external device 102 receives a data operation request sent by the host 101, and determines a Virtual Page Number (VPN) of a first memory page for processing data to be modified; the external device 102 modifies the first memory page to process the data to be modified in the first memory page; the external device 102 determines the first page table entry, reads the information of the preset bit, thereby judging whether the first memory page is registered as a dirty page in the first page table entry, and if not, the external device 102 modifies the information of the preset bit to register the first memory page as a dirty page in the first page table entry; the external device 102 sends a Virtual Page Number (VPN) of the first memory page to the host 101; the host 101 determines a first memory page based on a Virtual Page Number (VPN) of the first memory page, and processes page data of the first memory page.
Wherein, for different ways how the external device 102 determines the first page table entry, see steps (411), (412), (413) in fig. 5a, steps (421), (422) in fig. 5b, steps (421), (423), (411), (412), (413) in fig. 5c, and steps (431), (432), (433), (434), (435) in fig. 5 d; regarding different ways how the host 101 obtains the Virtual Page Number (VPN) from the external device 102, see steps (811), (812) in fig. 6a, steps (821), (822), (9) in fig. 6 b.
FIG. 4b is a flowchart illustrating a method for sending dirty pages according to an embodiment of the present application; the embodiment can be applied to a computing device 100, wherein the computing device 100 runs a virtual machine, and a host 101 of the computing device comprises an address translation page table; the address translation page table indicates the correspondence between the address of the memory page (the virtual machine physical address (GPA) in the embodiment of the present application) and the physical address of the physical page (the host machine physical address (HPA) in the embodiment of the present application), and in a specific implementation, the address translation page table includes a page table entry corresponding to the memory page of the virtual machine, where the page table entry indicates the physical address of the memory page in the host 101 (the address of the physical page); the method comprises the steps of including a first page table entry corresponding to a first memory page; as shown in fig. 4b, the dirty page sending method provided in the embodiment of the present application at least includes the following steps:
In step 411, the other devices send first information to the external device 102, where the first information indicates data to be modified corresponding to the virtual machine.
Illustratively, the external device 102 is a network card, and the first information may be a message sent by a device other than the computing device 100. Illustratively, as shown in FIG. 4c, the host 101 sends a message to the external device 102 (step (1 b) of FIG. 4 c), which needs to be sent to the virtual machine.
The other devices are illustratively devices other than the computing device 100, such as a terminal, a network card, and other computing devices 100. The terminal may be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices.
Illustratively, the other device may be a network card accessed by a host other than host 101 or other than external device 102 in computing device 100.
Step 412, the external device 102 determines to process the data to be modified in the first memory page based on the first information.
Illustratively, the host 101 sends a data write instruction to the external device 102 and a range of memory pages in which data can be written, where the data write instruction instructs the external device 102 to write data to the memory pages when the data is received. Correspondingly, the external device 102 may select a first memory page from the memory pages capable of writing data, and write the first information. Here, processing the data to be modified in the first memory page may be inserting the data to be modified in the first memory page.
Step 413, the external device 102 determines whether the first memory page is registered as a dirty page in the first page table entry, and if not, step 414 is performed.
In step 414, the external device 102 registers the first memory page as a dirty page in the first page table entry.
Details refer to step 403 and step 404, and will not be described again.
Step 415, the external device 102 sends information of the first memory page to the host 101.
Details refer to step 405, and will not be described again.
In step 416, the host 101 processes the page data of the first memory page.
See step 406 for details, which are not described in detail.
In the scheme, on one hand, a CPU is not required to poll a register, so that the possibility of fully utilizing CPU resources is improved; on the other hand, in the mode that whether the memory page is a dirty page or not is registered by adopting a page table item in the address translation page table, the same modified memory page at present and last time is not required; in yet another aspect, multiple modifications to a memory page are registered only once prior to reporting, thereby improving the efficiency of dirty page reporting over a program.
Based on the above provided dirty page transmission method, a specific application of the dirty page transmission method will be described.
Fig. 4c is a schematic diagram of a specific application of a dirty page sending method according to the embodiment of the present application. As shown in fig. 4c, specifically includes: the other devices send messages to the external device 102, which need to be sent to the virtual machine; the external device 102 determines a Virtual Page Number (VPN) of a first memory page that processes data to be modified; the external device 102 modifies the first memory page, thereby writing a message in the first memory page; the external device 102 determines the first page table entry, reads the information of the preset bit, thereby judging whether the first memory page is registered as a dirty page in the first page table entry, and if not, the external device 102 modifies the information of the preset bit to register the first memory page as a dirty page in the first page table entry; the external device 102 sends a Virtual Page Number (VPN) of the first memory page to the host 101; the host 101 determines a first memory page based on a Virtual Page Number (VPN) of the first memory page, and processes page data of the first memory page. Wherein, for different ways how the external device 102 determines the first page table entry, see steps (411), (412), (413) in fig. 5a, steps (421), (422) in fig. 5b, steps (421), (423), (411), (412), (413) in fig. 5c, and steps (431), (432), (433), (434), (435) in fig. 5 d; regarding different ways how the host 101 obtains the Virtual Page Number (VPN) from the external device 102, see steps (811), (812) in fig. 6a, steps (821), (822), (9) in fig. 6 b.
The following describes a dirty page report system to which the dirty page sending method provided by the embodiment of the present application may be applied. FIG. 7 is a diagram illustrating an exemplary architecture of a dirty page reporting system according to an embodiment of the present application. The embodiment of the application provides a dirty page sending method which can be applied to a system architecture diagram shown in fig. 7.
As shown in fig. 7, the dirty page reporting system includes a first computing device 100A and a second computing device 100B, the first computing device 100A including a host 101A and an external device 102A, and the second computing device 100B including a host 101B and an external device 102B. In the embodiment of the present application, the running state of the virtual machine running in the host 101A may be migrated to any one of the host 101B. For example, virtual machine 1 is migrated to virtual machine 2. In one possible application scenario, hosts 101A and 101B may be servers providing various cloud services. In embodiments of the present application, a Virtual Machine (VM) to be migrated may be referred to as a source Virtual Machine (VM); the Virtual Machine (VM) after migration to host 101B may be referred to as a destination Virtual Machine (VM).
Wherein communication is performed between the first computing device 100A and the second computing device 100B via a network. The network may be a wired network or a wireless network. Illustratively, the wired network may be a cable network, a fiber optic network, a digital data network (Digital Data Network, DDN), etc., and the wireless network may be a telecommunications network, an intranet, the internet, a local area network (Local Area Network, LAN), a wide area network (Wide Area Network, WAN), a wireless local area network (Wireless Local Area Network, WLAN), a metropolitan area network (Metropolitan Area Network, MAN), etc., or any combination thereof. It will be appreciated that the network may use any known network communication protocol for enabling communication between the different client layers and gateways, which may be various wired or wireless communication protocols, such as an ethernet communication protocol.
Next, a detailed description will be given of a dirty page sending method provided by the embodiment of the present application, in combination with the dirty page reporting system provided above.
Fig. 8a is a flowchart of a dirty page sending method according to an embodiment of the present application. The present embodiment may be applied to the first computing device 100A, where the host 101A of the computing device 100A runs a virtual machine, where the host 101A includes an address translation page table, where the address translation page table indicates a correspondence between an address of a memory page (which may be understood as a virtual machine physical address (GPA) in the embodiment of the present application, for example, may be a Virtual Page Number (VPN)) and a physical address of a physical page (which may be understood as a Host Physical Address (HPA)) in the embodiment of the present application; in particular implementations, the address translation page table includes page table entries corresponding to memory pages of the virtual machine, the page table entries indicating physical addresses (addresses of physical pages) of the memory pages in the host 101, including a first page table entry corresponding to a first memory page. As shown in fig. 8a, the dirty page sending method provided by the embodiment of the present application at least includes the following steps:
in step 801, the host 101 sends first information to the external device 102, where the first information indicates data to be modified corresponding to the virtual machine, and the first information is information received by the external device in a normal running process of the source virtual machine in a process of migrating the source virtual machine to the destination virtual machine.
Details refer to step 401, and will not be described again.
In addition, the first information is information received by the external equipment in the normal running process of the source virtual machine in the process of migrating the source virtual machine to the target virtual machine.
Step 802, the external device 102A determines to process data to be modified in a first memory page based on the first information.
Details refer to step 402, and will not be described again.
Step 803, the external device 102A determines whether the first memory page is registered as a dirty page in the first page table entry, and if not, step 804 is performed.
In step 804, the external device 102A registers the first memory page as a dirty page in the first page table entry.
Details refer to the descriptions of step 403 and step 404, and are not repeated.
In addition, in this embodiment, during the thermal migration of the virtual machine, during the first migration, the content in the memory of the source Virtual Machine (VM) may be copied to the destination Virtual Machine (VM) at one time; because the source Virtual Machine (VM) still operates normally, the memory of the source Virtual Machine (VM) is modified after the first migration, and therefore, after the first migration, the hot migration of the virtual machine can be completed in a mode of multiple iterative copies is required.
Specifically, the host 101A of the first computing device 100A copies the memory pages of the source virtual machine to the host 101B of the second computing device 100B in an iterative manner, where the source virtual machine is still running, and in the first memory copy, the host 101A copies all the memory pages and sends all the copied memory pages to the host 101B of the second computing device 100B, and then in the second memory copy, the source virtual machine further includes a memory page in a modified state, that is, a memory page modified in the previous copying and sending process, that is, a dirty page described in the embodiment of the present application.
In the case where the external device 102 may cache the page table entry and the identity of the memory page to which the page table entry corresponds, in one possible example of this case, the external device 102 may also cache the number of memory copies (i.e., the number of memory copies) of the page table entry. Correspondingly, for a page table item corresponding to an identifier matched with the identifier of the first memory page, if the memory copy number of the page table item is the same as the current memory copy number, the external device 102 considers whether the first memory page recorded in the cached page table item is the information of a dirty page or not, otherwise, the information is invalid; in the case of invalidation, the external device 102 needs to determine the address of the first page table entry in memory, and based on this address, read the first page table entry from memory. In a specific implementation, as shown in fig. 9, the external device 102 has a round setting interface, and the host 101 may send the number of memory copies to the external device 102 through the round setting interface.
For example, as shown in fig. 9, the external device 102 may internally cache page table entries, virtual Page Numbers (VPN) of memory pages corresponding to the page table entries, and memory copy times. Correspondingly, the external device 102 may match based on the Virtual Page Number (VPN) of the first memory page and the Virtual Page Number (VPN) of the current memory copy number (step (441) in fig. 9); a page table entry corresponding to the matching Virtual Page Number (VPN) is determined as the first page table entry (step (442) in fig. 9).
In a scenario not illustrated in fig. 9, if the Virtual Page Number (VPN) of the first memory page and the cached Virtual Page Number (VPN) fail to match, the external device 102A reads the EPTP field of the EPT page table from the host 101, and calculates the address of the first page table entry (the entry in the level 1 page table in the EPT page table) according to the method described in fig. 3b based on the EPTP field and the Virtual Page Number (VPN) of the first memory page; based on the address, the external device 102A reads out the first page table entry from the memory of the host 101.
In step 805, the external device 102A sends information of the first memory page to the host 101A.
Details refer to the description of step 405, and will not be repeated.
In step 806, the host 101A clears the information in the first page table entry that registers the first memory page as a dirty page.
It should be noted that, if the host 101A does not clear the information registered in the first page table entry that the first memory page is a dirty page; if the first memory page is modified later, the external device 102A will not register the first memory page as a dirty page in the first page table entry again, and will not report the information of the first memory page; subsequently, the host 101A will not process the information of the first memory page that is modified again, thereby omitting the processing of the first memory page. Therefore, the host 101A needs to clear the first page table entry to register the information that the first memory page is a dirty page, and when the first memory page is subsequently modified, the external device 102A may level the first memory page in the first page table entry again to be a dirty page, and report the information of the first memory page; subsequently, the host 101A can process the information of the first memory page modified again.
Step 807, host 101A sends page data of the first memory page to host 101B.
In the scheme, on one hand, a CPU is not required to poll a register, so that the possibility of fully utilizing CPU resources is improved; on the other hand, in the mode that whether the memory page is a dirty page or not is registered by adopting a page table item in the address translation page table, the same modified memory page at present and last time is not required; in yet another aspect, multiple modifications to a memory page are registered only once prior to reporting, thereby improving the efficiency of dirty page reporting over a program.
Based on the above provided dirty page transmission method, a specific application of the dirty page transmission method will be described.
As shown in fig. 9, the dirty page sending method specifically may include: the host 101A sends a data operation request determined by the virtual machine to the external device 102A, where the data operation request includes a Virtual Page Number (VPN) of a first memory page and data to be modified, and the data operation request is used to process the data to be modified in the first memory page; the external device 102A receives a data operation request sent by the host 101, and determines a Virtual Page Number (VPN) of a first memory page that processes data to be modified; the external device 102A modifies the first memory page to process data to be modified in the first memory page; the external device 102A determines the first page table entry, reads the information of the preset bit, thereby judging whether the first memory page is registered as a dirty page in the first page table entry, and if not, the external device 102A modifies the information of the preset bit to register the first memory page as a dirty page in the first page table entry; the external device 102A sends a Virtual Page Number (VPN) of the first memory page to the host 101A; the host 101A determines a first memory page based on a Virtual Page Number (VPN) of the first memory page, and transmits page data of the first memory page to the host 101B. Wherein, for different ways how the external device 102A determines the first page table entry, see steps (411), (412), (413) in fig. 5a, steps (421), (422) in fig. 5b, steps (421), (423), (411), (412), (413) in fig. 5c, and steps (431), (432), (433), (434), (435) in fig. 5 d; regarding different ways how the host 101A obtains the Virtual Page Number (VPN) from the external device 102A, see steps (811), (812) in fig. 6a, steps (821), (822), (9) in fig. 6 b.
Fig. 8b is a flowchart of a dirty page sending method according to an embodiment of the present application. The present embodiment may be applied to the first computing device 100A, where the host 101A of the computing device 100A runs a virtual machine, and the host 101A of the computing device includes an address translation page table, where the address translation page table indicates a correspondence between an address of a memory page (which may be understood as a virtual machine physical address (GPA) in the embodiment of the present application, for example, may be a Virtual Page Number (VPN)) and a physical address of a physical page (which may be understood as a Host Physical Address (HPA)) in the embodiment of the present application; in particular implementations, the address translation page table includes page table entries corresponding to memory pages of the virtual machine, the page table entries indicating physical addresses (addresses of physical pages) of the memory pages in the host 101, including a first page table entry corresponding to a first memory page. As shown in fig. 8b, the dirty page sending method provided by the embodiment of the present application at least includes the following steps:
in step 811, the other devices send first information to the external device 102, where the first information indicates data to be modified corresponding to the virtual machine.
Details refer to step 411, and will not be described again.
Step 812, the external device 102A determines, based on the first information, that the data to be modified is processed in a first memory page, where the first memory page is a memory page that needs to be modified by the source virtual machine in the process of migrating the source virtual machine to the destination virtual machine.
Details refer to step 412, and will not be described again.
Step 813, the external device 102A determines whether the first memory page is registered as a dirty page in the first page table entry, and if not, performs step 814.
In step 814, the external device 102A registers the first memory page as a dirty page in the first page table entry.
Details refer to the description of step 804, and will not be repeated.
Step 815, the external device 102A sends information of the first memory page to the host 101A.
Details refer to the description of step 405, and will not be repeated.
In step 816, the host 101A clears the information in the first page table entry that registers the first memory page as a dirty page.
Details refer to the description of step 806, and will not be repeated.
In step 817, the host 101A sends page data of the first memory page to the host 101B.
In the scheme, on one hand, a CPU is not required to poll a register, so that the possibility of fully utilizing CPU resources is improved; on the other hand, in the mode that whether the memory page is a dirty page or not is registered by adopting a page table item in the address translation page table, the same modified memory page at present and last time is not required; in yet another aspect, multiple modifications to a memory page are registered only once prior to reporting, thereby improving the efficiency of dirty page reporting over a program.
Based on the above provided dirty page transmission method, a specific application of the dirty page transmission method will be described.
As shown in fig. 9, the dirty page sending method specifically may include: the other devices send messages to the external device 102A that need to be sent to the virtual machine; the external device 102A determines a Virtual Page Number (VPN) of a first memory page that processes data to be modified; the external device 102A modifies the first memory page, thereby writing a message in the first memory page; the external device 102A determines the first page table entry, reads the information of the preset bit, thereby judging whether the first memory page is registered as a dirty page in the first page table entry, and if not, the external device 102A modifies the information of the preset bit to register the first memory page as a dirty page in the first page table entry; the external device 102A sends a Virtual Page Number (VPN) of the first memory page to the host 101A; the host 101A determines a first memory page based on a Virtual Page Number (VPN) of the first memory page, and transmits page data of the first memory page to the host 101B. Among them, regarding different ways how the external device 102A determines the first page table entry, see steps (411), (412), (413) in fig. 5a, steps (421), (422) in fig. 5b, steps (421), (423), (411), (412), (413) in fig. 5c, and steps (431), (432), (433), (434), (435) in fig. 5 d; regarding different ways how the host 101A obtains the Virtual Page Number (VPN) from the external device 102A, see steps (811), (812) in fig. 6a, steps (821), (822), (9) in fig. 6 b.
Based on the same conception as the embodiment of the method, the embodiment of the application also provides a dirty page sending device which is deployed in the external equipment. The dirty page sending device includes a plurality of modules, where each module is configured to execute each step in the dirty page sending method provided by the embodiment of the present application, and the division of the modules is not limited herein. In addition, the specific names of the modules are only for distinguishing from each other, and are not used to limit the protection scope of the present application. The specific working process of the module in the above apparatus may refer to the steps executed by the external device 102 or the external device 102A in the foregoing method embodiment, which are not described herein again.
Illustratively, the dirty page transmitting apparatus is configured to perform steps performed by the external device 102 or the external device 102A provided in the embodiment of the present application, and fig. 10 is a schematic structural diagram of the dirty page transmitting apparatus provided in the embodiment of the present application. The dirty page sending device is deployed in external equipment, the external equipment is positioned in computing equipment, and the computing equipment runs with a virtual machine; the computing device includes an address translation page table indicating a page table entry corresponding to a memory page of the virtual machine, the page table entry indicating a physical address of the memory page in the first computing device; as shown in fig. 10, a dirty page sending apparatus 1000 provided in an embodiment of the present application includes:
The information receiving module 1001 is configured to receive first information, where the first information indicates data to be modified corresponding to the virtual machine;
a page determining module 1002, configured to determine, based on the first information, to process data to be modified in a first memory page;
a determining module 1003, configured to determine whether to register the first memory page as a dirty page in the first page table entry; the first page table entry indicating a physical address in the computing device of the first memory page;
a registration module 1004, configured to register the first memory page as a dirty page in the first page table entry if the first memory page is not registered as a dirty page in the first page table entry;
a sending module 1005 is configured to send the information of the first memory page to the first computing device.
Based on the same conception as the embodiment of the method, the embodiment of the application also provides a dirty page sending device which is deployed in the host. The dirty page sending device includes a plurality of modules, where each module is configured to execute each step in the dirty page sending method provided by the embodiment of the present application, and the division of the modules is not limited herein. In addition, the specific names of the modules are only for distinguishing from each other, and are not used to limit the protection scope of the present application. The specific working process of the module in the above apparatus may refer to the steps executed by the host 101 or the host 101A in the foregoing method embodiment, which are not described herein again.
Illustratively, the dirty page sending apparatus is configured to perform steps performed by the host 101 or the host 101A provided in the embodiment of the present application, and fig. 11 is a schematic structural diagram of the dirty page sending apparatus provided in the embodiment of the present application. The dirty page sending device runs a virtual machine; the dirty page sending device comprises an address conversion page table, wherein the address conversion page table indicates a page table item corresponding to a memory page of the virtual machine, and the page table item indicates a physical address of the memory page; the address conversion page comprises a first page table entry corresponding to the first memory page; the dirty page sending apparatus 1100 provided in the embodiment of the present application includes:
a receiving module 1101, configured to receive information of a first memory page sent by an external device; registering a first memory page as a dirty page in a first page table entry; the first page table entry indicating a physical address in the computing device of the first memory page;
a clearing module 1102, configured to clear information in the first page table entry registered that the first memory page is a dirty page;
the processing module 1103 is configured to process the page data of the first memory page.
In addition to the methods, apparatus and electronic devices described above, embodiments of the present application may also provide a computer program product comprising computer program instructions which, when executed by a processor, cause the processor to perform the steps in the dirty page transmission method of the various embodiments of the present application described in the "methods" section of the present specification. Wherein the computer program product may write computer program code for performing operations of embodiments of the present application in any combination of one or more programming languages, including an object oriented programming language such as Java, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. Wherein the computer program code may be in the form of source code, object code, executable files, or in some intermediate form, etc. The computer program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device or entirely on the remote computing device or server.
Furthermore, embodiments of the present application may also provide a computer-readable storage medium having stored thereon computer program instructions which, when executed by a processor, cause the processor to perform the steps in a dirty page transmission method according to various embodiments of the present disclosure described in the "method" section of the present specification. The computer readable storage medium may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may include, for example, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium would include the following: an electrical connection having one or more wires, a portable disk, a hard disk, random Access Memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. It should be noted that the computer readable medium contains content that can be appropriately scaled according to the requirements of jurisdictions in which such content is subject to legislation and patent practice, such as in certain jurisdictions in which such content is subject to legislation and patent practice, the computer readable medium does not include electrical carrier signals and telecommunication signals.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and in part, not described or illustrated in any particular embodiment, reference is made to the related descriptions of other embodiments.
It should be understood that the sequence number of each step in the foregoing embodiment does not mean that the execution sequence of each process should be determined by the function and the internal logic, and should not limit the implementation process of the embodiment of the present application.
The basic principles of the present application have been described above in connection with specific embodiments, however, it should be noted that the advantages, benefits, effects, etc. mentioned in the present application are merely examples and not intended to be limiting, and these advantages, benefits, effects, etc. are not to be considered as essential to the various embodiments of the present disclosure. Furthermore, the specific details disclosed herein are for purposes of illustration and understanding only, and are not intended to be limiting, since the disclosure is not necessarily limited to practice with the specific details described.
The block diagrams of the devices, apparatuses, devices, systems referred to in this disclosure are merely illustrative examples and are not intended to require or imply that the connections, arrangements, configurations must be made in the manner shown in the block diagrams. As will be appreciated by one of skill in the art, the devices, apparatuses, devices, systems may be connected, arranged, configured in any manner. Words such as "including," "comprising," "having," and the like are words of openness and mean "including but not limited to," and are used interchangeably therewith. The terms "or" and "as used herein refer to and are used interchangeably with the term" and/or "unless the context clearly indicates otherwise. The term "such as" as used herein refers to, and is used interchangeably with, the phrase "such as, but not limited to.
It is also noted that in the apparatus, devices and methods of the present disclosure, components or steps may be disassembled and/or assembled. Such decomposition and/or recombination should be considered equivalent to the present disclosure.
The foregoing description has been presented for purposes of illustration and description. Furthermore, this description is not intended to limit the embodiments of the disclosure to the form disclosed herein. Although a number of example aspects and embodiments have been discussed above, a person of ordinary skill in the art will recognize certain variations, modifications, alterations, additions, and subcombinations thereof.
It will be appreciated that the various numerical numbers referred to in the embodiments of the present application are merely for ease of description and are not intended to limit the scope of the embodiments of the present application.

Claims (12)

1. The dirty page sending method is characterized by being applied to an external device in a first computing device, wherein the first computing device comprises an address translation page table, the address translation page table indicates a page table item corresponding to a memory page of a virtual machine, and the page table item indicates a physical address in the first computing device; the address conversion page comprises a first page table entry corresponding to a first memory page; the method comprises the following steps:
Receiving first information, wherein the first information indicates data to be modified corresponding to the virtual machine;
determining to process the data to be modified in a first memory page based on the first information;
determining whether to register the first memory page as a dirty page in the first page table entry;
if not, registering the first memory page as a dirty page in a first page table entry;
and sending the information of the first memory page to the first computing device.
2. The method of claim 1, wherein the sending the information of the first memory page to the first computing device comprises:
recording the information of the first memory page into a locally stored dirty page information set;
information in the set of dirty page information is sent to the first computing device.
3. The method of claim 2, wherein the sending information in the set of dirty page information to the first computing device comprises:
and when the information quantity in the dirty page information set reaches a preset threshold value or a query command of the first computing device is received, sending the information in the dirty page information set to the first computing device.
4. A method according to any one of claims 1 to 3, wherein said registering said first memory page as a dirty page in said first page table entry comprises: setting a preset bit in the first page table entry to be a preset value for indicating a dirty page, wherein the preset bit is an ignore bit in the page table entry; or alternatively, the first and second heat exchangers may be,
the method further comprises the steps of: when the first memory page is registered as a dirty page in the first page table entry, the first memory page is kept registered as a dirty page in the first page table entry.
5. The method of claim 1, wherein the first information is information received by the external device during normal operation of the virtual machine during migration of the virtual machine to the second computing device; and/or the number of the groups of groups,
the first memory page is divided into a plurality of sub-pages, and the information of the first memory page comprises the address of a target sub-page, wherein the target sub-page is a sub-page for processing data to be modified in the first memory page.
6. The method according to any one of claims 1 to 5, further comprising:
determining the first page table entry based on matching of the first identification of the first memory page and cached page table entry information; the page table entry information includes the first page table entry and the first identifier corresponding to the first page table entry.
7. The method of claim 6, wherein the first memory page is a modified memory page for a first number of memory copies; wherein the first memory copy number indicates a copy number of a memory in the first computing device;
and the page table item information is cached information under the first memory copy number.
8. The method of claim 1, wherein the first page table entry corresponds to a second memory page, the second memory page comprising a plurality of memory pages, the plurality of memory pages comprising a first memory page;
the first page table entry is used for recording whether the memory pages are respectively logged into dirty pages or not; or,
the first page table entry registers the second memory page as a dirty page; the method further comprises the steps of:
updating the first page table item, and determining the updated first page table item; wherein the updated first page table entry does not register the first memory page as a dirty page;
based on the updated first page table entry, it is determined that the first memory page is not registered as a dirty page in the first page table entry.
9. A dirty page sending method, characterized by being applied to a first computing device; the first computing device includes an address translation page table indicating a page table entry corresponding to a memory page of a virtual machine, the page table entry indicating a physical address in the first computing device for the memory page; the address conversion page comprises a first page table entry corresponding to a first memory page; the method comprises the following steps:
Receiving information of the first memory page sent by external equipment; the external device is used for receiving first information, and the first information indicates data to be modified corresponding to the virtual machine; determining to process the data to be modified in a first memory page based on the first information; determining whether to register the first memory page as a dirty page in the first page table entry; if not, registering the first memory page as a dirty page in a first page table entry; transmitting information of the first memory page to the first computing device;
clearing information registered in the first page table entry that the first memory page is a dirty page;
and processing the page data of the first memory page.
10. The method of claim 9, wherein the first information is information received by the external device during normal operation of the virtual machine during migration of the virtual machine to the second computing device;
the processing the page data in the first memory page includes:
and sending the page data in the first memory page to the second computing device.
11. An external device for performing the method of any one of claims 1 to 8.
12. A first computing device for performing the method of claim 9 or 10.
CN202310936593.1A 2023-07-27 2023-07-27 Dirty page sending method, external device and computing device Pending CN117193931A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310936593.1A CN117193931A (en) 2023-07-27 2023-07-27 Dirty page sending method, external device and computing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310936593.1A CN117193931A (en) 2023-07-27 2023-07-27 Dirty page sending method, external device and computing device

Publications (1)

Publication Number Publication Date
CN117193931A true CN117193931A (en) 2023-12-08

Family

ID=88985876

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310936593.1A Pending CN117193931A (en) 2023-07-27 2023-07-27 Dirty page sending method, external device and computing device

Country Status (1)

Country Link
CN (1) CN117193931A (en)

Similar Documents

Publication Publication Date Title
CN112422615B (en) Communication method and device
US10713074B2 (en) Method, apparatus, and system for accessing storage device
JP4303688B2 (en) Data access response system and method for accessing data access response system
US9665534B2 (en) Memory deduplication support for remote direct memory access (RDMA)
US7234006B2 (en) Generalized addressing scheme for remote direct memory access enabled devices
US5884313A (en) System and method for efficient remote disk I/O
US20180027074A1 (en) System and method for storage access input/output operations in a virtualized environment
EP4220419B1 (en) Modifying nvme physical region page list pointers and data pointers to facilitate routing of pcie memory requests
US10169247B2 (en) Direct memory access between an accelerator and a processor using a coherency adapter
CN109857545B (en) Data transmission method and device
WO2015180598A1 (en) Method, apparatus and system for processing access information of storage device
US20190163643A1 (en) Dynamic address translation for a virtual machine
US20090199194A1 (en) Mechanism to Prevent Illegal Access to Task Address Space by Unauthorized Tasks
US20040098369A1 (en) System and method for managing memory
US10936499B2 (en) Method, device and computer programme product for storage management
EP3465450A1 (en) Improving throughput in openfabrics environments
CN115242813A (en) File access method, network card and computing device
CN116303126B (en) Caching method, data processing method and electronic equipment
CN117193931A (en) Dirty page sending method, external device and computing device
CN112764668A (en) Method, electronic device and computer program product for expanding GPU memory
JP2004246702A (en) Computer system, computer apparatus, and data access method and program in computer system
US10691478B2 (en) Migrating virtual machine across datacenters by transferring data chunks and metadata
JP2007004710A (en) Storage access system, data transfer device, storage accessing method and program
WO2014137008A1 (en) System and method for sharing graphic resource
JP2022018964A (en) Information processing apparatus and access control program

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination