Memory page missing processing method and system
By introducing page request processing devices in the data processing device, sending messages to the virtual machine manager directly to the virtual machine manager, which solves the problem of long -term processing links caused by the I/O lack function, improved the I/O memory The efficiency of the lack of page recovery and reduce the delay of the device access memory.
Patent Information
- Application Number
- CN202310890608.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-19
- Publication Date
- 2025-01-28
AI Technical Summary
In the prior art, IOMMU does not support the I/O page-deficiency function, resulting in a long processing link for I/O memory page-deficiency recovery, which increases the delay in device access memory.
Introduce the lack of page request processing devices in the data processing device. By sending the device to the page request processing device to send a page shortage request, send messages to the virtual machine manager directly to realize the I/O page request interface that does not rely on IOMMU.
The processing link of the I/O memory pages deficiency page recovery has been shortened, which improves the processing efficiency of the recovery of the I/O memory pages, and reduced the delay of the access memory of the device.
Smart Images

Figure CN119376904A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present specification relate to the field of computer technology, and in particular to a method for processing a memory page fault. Background Art
[0002] In a virtual machine scenario with pass-through enabled, address translation is required in the IOMMU (Input / Output Memory Management Unit). The IOMMU can connect the Direct Memory Access (DMA) I / O (Input / Output) bus and the host's memory to convert the virtual address of the device access into a physical address.
[0003] In actual applications, the Virtual Machine Manager (VMM) will reclaim physical memory, store the data stored in physical memory on the hard disk, and release the physical memory pages for other processes to use. When the process accessed by I / O needs memory again, an I / O memory page fault will occur.
[0004] The IOMMU of the mainstream CPU (Central Processing Unit) currently in service on the market does not support the I / O page fault function. When an I / O memory page fault occurs, the IOMMU cannot directly send a page fault request to the VMM, but returns a page fault exception message to a pass-through device, such as a PCI device. The pass-through device then relies on the IOMMU to send a page fault request to the VMM based on the page fault exception message to recover the missing memory page, which increases the processing link for I / O memory page fault recovery and takes a long time to recover the I / O memory page fault, resulting in a large delay in device access to memory. Summary of the invention
[0005] In view of this, an embodiment of the present specification provides a method for processing a memory page fault. One or more embodiments of the present specification also relate to a memory page fault processing system, a page fault request processing device, a computing device, a computer-readable storage medium, and a computer program to solve the technical defects existing in the prior art.
[0006] According to a first aspect of an embodiment of this specification, a method for processing a memory page fault is provided, comprising:
[0007] The data processing device, when determining that a memory page corresponding to the I / O access sent by the virtual machine is missing, sends the page missing request to the page missing request processing device;
[0008] The page fault request processing device sends a page fault message to a page fault exception queue according to the page fault request;
[0009] The virtual machine manager obtains the page fault message in the page fault exception queue, performs page fault processing according to the page fault message, obtains the missing memory page, and sends a processing completion instruction for the missing memory page to the page fault request processing device;
[0010] The page missing request processing device updates a status table according to the processing completion instruction, so that the data processing device performs the I / O access processing according to the updated status table, wherein the status table includes the existence status of the missing memory page.
[0011] According to a second aspect of an embodiment of this specification, a memory page fault processing system is provided, including:
[0012] The data processing device is configured to send the page missing request to the page missing request processing device when determining that a memory page corresponding to the I / O access sent by the virtual machine is missing;
[0013] The page fault request processing device is configured to send a page fault message to a page fault exception queue according to the page fault request;
[0014] The virtual machine manager is configured to obtain the page fault message in the page fault exception queue, perform page fault processing according to the page fault message, obtain the missing memory page, and send a processing completion instruction for the missing memory page to the page fault request processing device;
[0015] The page missing request processing device is configured to update a status table according to the processing completion instruction so that the data processing device performs the I / O access processing according to the updated status table, wherein the status table includes the existence status of the missing memory page.
[0016] According to a third aspect of an embodiment of this specification, a page missing request processing device is provided, including a page missing message sending module and a status table updating module, wherein:
[0017] The page fault message sending module is configured to send a page fault message to a page fault exception queue according to a page fault request, wherein the page fault message is sent by the data processing device when it is determined that a memory page corresponding to an I / O access sent by the virtual machine is missing;
[0018] The status table update module is configured to update the status table according to a processing completion instruction so that the data processing device performs the I / O access processing according to the updated status table, wherein the processing completion instruction is sent by the virtual machine manager after obtaining a page fault message in the page fault exception queue and performing page fault processing according to the page fault message to obtain the missing memory page, and the status table includes the existence status of the missing memory page.
[0019] According to a fourth aspect of an embodiment of this specification, a computing device is provided, including:
[0020] Memory and processor;
[0021] The memory is used to store computer executable instructions, and the processor is used to execute the computer executable instructions. When the computer executable instructions are executed by the processor, the steps of the above-mentioned memory page fault processing method are implemented.
[0022] According to a fifth aspect of the embodiments of this specification, a computer-readable storage medium is provided, which stores computer-executable instructions, and when the instructions are executed by a processor, the steps of the above-mentioned memory page fault processing method are implemented.
[0023] According to a sixth aspect of the embodiments of this specification, a computer program is provided, wherein when the computer program is executed in a computer, the computer is caused to execute the steps of the above-mentioned memory page fault processing method.
[0024] A memory page fault processing method provided by an embodiment of the present specification is applied to a memory page fault processing system, wherein the memory page fault processing system includes a host, a virtual machine and a virtual machine manager running in the host, a data processing device deployed in the host to process I / O access of the virtual machine, and a page fault request processing device deployed in the host to process a page fault request sent by the data processing device, wherein the method includes: the data processing device, when determining that the memory page corresponding to the I / O access sent by the virtual machine is missing, sends the page fault request to the page fault request processing device; the page fault request processing device sends a page fault message to a page fault exception queue according to the page fault request; the virtual machine manager obtains the page fault message in the page fault exception queue, performs page fault processing according to the page fault message, obtains the missing memory page, and sends a processing completion instruction for the missing memory page to the page fault request processing device; the page fault request processing device updates a state table according to the processing completion instruction, so that the data processing device performs the I / O access processing according to the updated state table, wherein the state table includes the existence status of the missing memory page.
[0025] Specifically, the memory page fault processing method introduces a page fault request processing device in a data processing device. When the data processing device sends a page fault request to the page fault request processing device, the page fault request processing device sends a page fault message to the virtual machine manager according to the page fault request, thereby realizing an I / O page fault request interface that is independent of the IOMMU, shortening the processing link of I / O memory page fault recovery, improving the processing efficiency of I / O memory page fault recovery, and reducing the device's memory access delay. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 This is a scenario diagram of a method for processing a memory page fault provided by an embodiment of this specification;
[0027] Figure 2 is a flow chart of a method for processing a memory page fault provided by an embodiment of the present specification;
[0028] Figure 3 It is a schematic diagram of a VPRI architecture under a DPU-assisted virtualization architecture to which a memory page fault processing method is applied provided by an embodiment of the present specification;
[0029] Figure 4 It is a process flow chart of a method for processing a memory page fault provided by an embodiment of the present specification;
[0030] Figure 5 It is a structural schematic diagram of a page missing request processing device provided by an embodiment of this specification;
[0031] Figure 6 It is a structural schematic diagram of a memory page fault processing system provided by an embodiment of the present specification;
[0032] Figure 7 It is a structural block diagram of a computing device provided by an embodiment of this specification. DETAILED DESCRIPTION
[0033] Many specific details are described in the following description to facilitate a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of this specification, so this specification is not limited to the specific implementation disclosed below.
[0034] The terms used in one or more embodiments of this specification are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of this specification. The singular forms of "a", "said" and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.
[0035] It should be understood that although the terms first, second, etc. may be used to describe various information in one or more embodiments of this specification, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0036] In addition, it should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in one or more embodiments of this specification are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0037] First, the terms involved in one or more embodiments of this specification are explained.
[0038] DMA: Direct Memory Access is a function provided by some computer bus architectures that enables data to be sent directly from an attached device (such as a disk drive) to the computer motherboard's memory.
[0039] ATS: ATS stands for Address Translation Service. As the name implies, it is an address translation service mechanism. ATS under PCIe is CPU-centric. Each device on the PCIe bus can apply to the host for the physical address mapping corresponding to the untranslated address and the corresponding attributes, permissions and other information through the ATS mechanism.
[0040] IOPF: I / O Page Fault, an I / O page fault request directly initiated by the PCI device.
[0041] PCI: Peripheral Component Interconnect, a standard for defining a local bus.
[0042] PCI Function: PCI function is designed as a logical level within each device.
[0043] VMM: The full name is Virtual Machine Monitor, a virtual machine monitoring system, also called Hypervisor, which is the specific implementation of the virtualization layer and centrally manages physical resources. Each virtual processor system needs to access physical resources through VMM.
[0044] MMIO: Memory-mapped I / O, which is part of the PCI specification.
[0045] MSI-X interrupt: Extended message signaled interrupt (MSI-X) is an enhanced version of MSI interrupt. MSI (MessageSignaled Interrupt) is a PCI device that triggers a DPU interrupt by writing a specific message to a specific address. The purpose of the MSI-X interrupt mechanism is to expand the number of interrupt vectors used by PCIe devices and solve the problem that the MSI interrupt requires the interrupt vectors to be continuous.
[0046] PRI: Page Request Interface is a standard PCI device capability (PCI Capability) defined by PCI-SIG. Its existence combined with ATS can eliminate the need to fix the I / O memory used by the device in the memory, alleviating the virtual machine from occupying too much fixed memory and reducing the bottleneck of the host's overall allocatable memory.
[0047] In order to solve the technical problem that the recovery time of I / O memory page fault is long, resulting in a large delay in device access to memory, in some embodiments of this specification, a bypass PCI Function for page fault request service is added on the device side to provide IOPF function for the host of IOMMU without PRI function, so as to realize the recovery of large block I / O memory page faults corresponding to large blocks of data, and the device can access the recovered memory page. Compared with the existing memory page fault processing method, there is no need to rely on IOMMU hardware, shortening the processing link of memory page fault recovery, helping to reduce the recovery time of I / O memory page faults, and thus reducing the delay in device access to memory.
[0048] In this specification, a memory page fault processing method is provided. This specification also relates to a memory page fault processing system, a computing device, and a computer-readable storage medium, which are described in detail one by one in the following embodiments.
[0049] See also Figure 1 , Figure 1 A schematic diagram of a scenario of a memory page fault processing method provided by an embodiment of the present specification is shown, including: a host machine 102 , a virtual machine 104 , a pass-through device 106 and a VPRI-PCI device 108 .
[0050] The host machine 102 can be understood as a computer device with computing, storage and communication functions. For example, the host machine 102 can be a server device. For example, the host machine 102 can be a single server device or a cloud server array. Of course, the host machine 102 can also be a terminal device such as a mobile phone, a tablet computer, a personal computer, a wearable device, etc.
[0051] In the embodiment of the present application, a host machine 102 is deployed with a virtual machine (VM) 104. The virtual machine 104 may also be referred to as a client (Guest) of the host machine 102. The virtual machine 104 has an independent CPU, memory, network, and disk.
[0052] The pass-through device 106 can be understood as an I / O hardware device mounted on the host machine 102, which may include: a network card, a storage medium, etc. Among them, the storage medium may be a persistent storage medium such as a disk or a hard disk. The pass-through device 106 can be connected to the host machine 102 through a communication interface. According to different forms of the communication interface, the pass-through device 106 can be implemented as a PCI device, a PCIe device, etc.
[0053] The VMM can be understood as a logical node that manages the virtual machine 104, and can be deployed on the host machine 102, or on other physical machines that communicate with the host machine 102. When the VMM is deployed on the host machine 102, the VMM can run on the processing unit of the host machine 102. The VMM can schedule tasks, load balance, and monitor the status of the virtual machine 104. The processing unit of the host machine 102 can be a CPU, a DPU, and the like.
[0054] In the pass-through technology, the virtual machine 104 can directly access the pass-through device 106 mounted on the host machine 102 through the VMM, so that the I / O operation path of the virtual machine 104 is almost the same as the I / O path in a non-virtualized environment, and the pass-through device 106 can access the memory of the host machine 102 through direct memory access (DMA). For the DMA method, there is a data path between the pass-through device 106 and the memory of the host machine 102, realizing direct data transmission between the pass-through device 106 and the memory of the host machine 102. In the data transmission process between the pass-through device 106 and the memory of the host machine 102, the CPU of the host machine 102 does not need to participate.
[0055] In virtualization technology, the operating system (guest OS) running on the virtual machine 104 usually does not know the physical memory address of the host machine it accesses, which can also be called the host physical address (Host physical address, HPA), or simply the physical address. If a DMA operation is to be performed, the memory may be damaged. Because the pass-through device 106 can only know the physical memory address of the virtual machine, referred to as the virtual address (Virtual address, VA), which can also be called the client physical address (Guestphysical address, GPA), the pass-through device 106 does not know the mapping relationship between GPA and HPA. Therefore, in an embodiment of the present application, IOMMU is introduced in the pass-through technology.
[0056] The IOMMU can be communicatively connected between the pass-through device 106 and the memory of the host machine 102. Optionally, the IOMMU can be communicatively connected to the pass-through device 106 and the memory of the host machine 102 through a communication interface bus. The serial interface bus can be a PCI interface bus, a PCIe interface bus, etc. The IOMMU can ensure that the pass-through device 106 can access the memory of the host machine 102 when performing a DMA operation.
[0057] For a host machine 102 without an IOMMU, the pass-through device 106 can access the entire memory address space of the host machine 102 through DMA. For a host machine equipped with an IOMMU, the CPU of the virtual machine 104 can allocate a GPA accessible to the pass-through device 106, and the VMM allocates a corresponding HPA to the GPA. The IOMMU can maintain a mapping table between the GPA and the HPA, which can also be called a page table. The page table records the correspondence between the GPA and the HPA. When the pass-through device 106 accesses the memory of the host machine 102 through DMA, the VMM can capture the DMA request issued by the pass-through device 106 and pass the DMA request to the IOMMU. The IOMMU can obtain the GPA to be accessed from the DMA request; thereafter, the GPA to be accessed is matched in the page table stored in the IOMMU to obtain the HPA corresponding to the GPA to be accessed. For the pass-through device 106, the memory space corresponding to the memory of the host machine 102 can be accessed through the HPA corresponding to the GPA to be accessed.
[0058] In actual application, VMM will recycle physical memory, store the data stored in physical memory in hard disk, and release physical memory pages for other processes to use. When the process of pass-through device 106 needs memory again, I / O memory page fault will occur.
[0059] Taking the pass-through device 106 as a DPU as an example, the memory page fault processing method provided in the embodiment of this specification is described in detail.
[0060] In the embodiment of the present specification, a VPRI-PCI device 108 is introduced into the DPU, wherein the VPRI-PCI device 108 is a bypass PCI Function independent of the DPU 106. The VPRI-PCI device can be embedded in the pass-through device 106 or connected to the pass-through device 106 through an interface, and the present specification does not limit this. The VPRI-PCI device 108 can store the presence state (present state) of a memory page (4K / 2M / 1G) corresponding to the GPA, and one page uses one bit to record its presence state. If the presence state is "1", it indicates that the memory page corresponding to the GPA exists; if the presence state is "0", it indicates that the memory page corresponding to the GPA is missing.
[0061] After the virtual machine 104 sends an I / O access to the DPU, the DPU searches the status table in the VPRI-PCI device 108 and finds that an I / O memory page is missing. The DPU then sends a page missing request to the VPRI-PCI device 108. The VPRI-PCI device 108 can send a page missing message to the VMM according to the page missing request, so that the VMM performs page missing processing according to the page missing message, obtains the missing memory page, and sends a processing completion instruction for the missing memory page to the VPRI-PCI device 108, wherein the processing completion instruction is a data communication instruction, which is used to convey the message that the missing memory page is obtained through the page missing processing of the VMM, so as to update the status table in the VPRI-PCI device 108. Before the page missing processing, the existence status of the missing memory page in the status table is 0, and after the processing is completed, the existence status of the missing memory page in the status table is 1, indicating that the missing memory page is obtained, and the DPU can perform I / O access processing according to the updated status table.
[0062] Based on this, the memory page fault processing method provided in the embodiment of the present specification introduces a page fault request processing device in the data processing device. When the data processing device sends a page fault request to the page fault request processing device, the page fault request processing device sends a page fault message to the virtual machine manager according to the page fault request, thereby realizing an I / O page fault request interface that is independent of the IOMMU. That is to say, when page fault processing is required, there is no need for the IOMMU to send a page fault message to the data processing device, and then the data processing device relies on the IOMMU to send a page fault request to perform page fault processing; the page fault request processing device in the data processing device can directly send a page fault request, shortening the processing link of I / O memory page fault recovery, improving the processing efficiency of I / O memory page fault recovery, and reducing the device's memory access delay.
[0063] See also Figure 2 , Figure 2A flowchart of a memory page fault processing method provided by an embodiment of the present specification is shown. The memory page fault processing method is applied to a memory page fault processing system, wherein the memory page fault processing system includes a host, a virtual machine and a virtual machine manager running in the host, a data processing device deployed in the host to process I / O access of the virtual machine, and a page fault request processing device deployed in the host to process page fault requests sent by the data processing device, and specifically includes the following steps.
[0064] Step 202: When the data processing device determines that a memory page corresponding to the I / O access sent by the virtual machine is missing, the data processing device sends the page missing request to the page missing request processing device.
[0065] The data processing device may be understood as: Figure 1 The pass-through device 106 in the system is a PCI I / O hardware device, such as a standard network card NIC (Network Interface Card), a data processor DPU (Data Processing Unit), etc.; a virtual machine can be understood as a software implementation of a host machine that runs in a host machine and can run programs like a real machine; I / O (Input / Output, i.e., input / output, usually refers to the input and output of data between an internal memory and an external memory or other peripheral devices) access can be understood as input / output access. For example, when a virtual machine performs I / O access to a disk, I / O access can be understood as the read and write access of the virtual machine to the disk.
[0066] Memory pages can be understood as cutting the physical memory space into segments of fixed size, storing physical addresses; page fault request processing devices can be understood as, Figure 1 VPRI-PCI device 108 in the actual application; in the actual application, the page fault request processing device can be understood as a device that sends a page fault request, wherein the page fault request can be understood as a page fault request for a memory page fault in the above-mentioned I / O access.
[0067] In one or more embodiments of the present specification, before determining that the memory page corresponding to the I / O access sent by the virtual machine is missing, the data processing device must first receive the I / O access, and a virtual machine can send multiple I / O accesses. In order for the data processing device to process the I / O access in an orderly manner, the received I / O access is added to the I / O queue; and to find out whether the memory page is missing, the virtual address corresponding to the I / O access must first be obtained. After obtaining the virtual address, it is possible to find out whether the physical address corresponding to the virtual address exists. The specific implementation is as follows:
[0068] Before determining that a memory page corresponding to the I / O access sent by the virtual machine is missing, the method further includes:
[0069] The data processing device receives the I / O access sent by the virtual machine, adds the I / O access to an I / O queue, and determines a virtual address corresponding to the I / O access;
[0070] Calling a status table in the page fault request processing device to find the existence status of the memory page corresponding to the virtual address;
[0071] Accordingly, determining that a memory page corresponding to the I / O access sent by the virtual machine is missing includes:
[0072] The data processing device determines, according to the existence status of the memory page, that a memory page corresponding to the I / O access sent by the virtual machine is missing.
[0073] Among them, the I / O queue can be understood as a queue for storing the I / O access of a virtual machine, following the first-in-first-out principle; the state table can be understood as a table that stores the existence status of the memory page corresponding to the GPA; the virtual address can be understood as the GPA; the memory page can be understood as the physical address corresponding to the virtual address.
[0074] The memory page fault processing method provided in the embodiments of this specification is that the data processing device can add the received I / O access to the I / O queue so as to perform I / O access processing in an orderly manner, and the data processing device can directly call the status table in the page fault request processing device to check the existence status of the memory page corresponding to the virtual address, thereby improving the efficiency of finding memory page faults.
[0075] In one or more embodiments of the present specification, before determining that the memory page corresponding to the I / O access sent by the virtual machine is missing, the virtual machine must first send the I / O access to clarify the access object of the I / O access, and the access object is located in the data processing device. The access object of the I / O access sent by the virtual machine is the data processing component in the data processing device to obtain data in the data processing component. The specific implementation is as follows:
[0076] The data processing device includes a data processing component;
[0077] Accordingly, before receiving the I / O access sent by the virtual machine and determining the virtual address corresponding to the I / O access, the method further includes:
[0078] The virtual machine sends an I / O access to the data processing component to the data processing device.
[0079] Among them, the data processing components can be understood as network devices, disk devices, etc. in data processing devices, such as virtio-net, rdma, virtio-blk, NVMe, etc.
[0080] The memory page fault processing method provided in the embodiment of the present specification can obtain data in the data processing component by sending it to the data processing device and targeting the I / O access of the data processing component.
[0081] For ease of understanding, the following embodiments all take the data processing device as DPU, the page fault request processing device as VPRI-PCI device, and I / O access as read and write access to the disk device virtio-blk as an example to describe in detail a memory page fault processing method provided in the embodiments of this specification.
[0082] The virtual machine sends to the DPU for read and write access of the disk device virtio-blk in the DPU. The DPU receives the I / O access sent by the virtual machine, adds the I / O access to the I / O queue corresponding to the virtual machine, and determines the virtual address corresponding to the I / O access; the DPU can call the status table in the VPRI-PCI device to find the existence status of the memory page corresponding to the virtual address. When the existence status of the corresponding memory page is "0", that is, the DPU determines that the memory page corresponding to the I / O access sent by the virtual machine is missing, it sends a page missing request to the VPRI-PCI device.
[0083] In one or more embodiments of the present specification, after determining that the memory page corresponding to the I / O access sent by the virtual machine is missing, other I / O accesses in the I / O queue that are located after the I / O access are interrupted, so that the subsequent other I / O accesses and the I / O access uniformly query the updated mapping page table, reduce the probability of memory page missing of other I / O accesses, and improve thread execution efficiency. The specific implementation method is as follows:
[0084] After determining that the memory page corresponding to the I / O access sent by the virtual machine is missing, the method further includes:
[0085] The page fault request processing device interrupts the processing of the I / O access in the I / O queue and the processing of other I / O accesses in the I / O queue, wherein the other I / O accesses are located after the I / O access in the I / O queue.
[0086] In actual applications, the processing of the I / O access in the I / O queue and the processing of other I / O access in the I / O queue can be interrupted through the MSI-X interrupt mode of the VPRI-PCI device.
[0087] For example, when a memory page is missing during read / write access to the disk device virtio-blk, the VPRI-PCI device interrupts the I / O queue where the read / write access to the disk device virtio-blk is located, and suspends the I / O access in the I / O queue that is located after the read / write access. If there are multiple I / O queues for the disk device virtio-blk, the other queues under the disk device virtio-blk can still continue to work; similarly, the I / O access in the I / O queue of another device (such as virtio-net) continues to work and is not affected by the page missing state of the disk device virtio-blk (unless the memory accessed by this queue itself also encounters a page missing).
[0088] The memory page fault processing method provided in the embodiment of this specification, the page fault request processing device interrupts the processing of the I / O access in the I / O queue, and the processing of other I / O accesses in the I / O queue, so that subsequent other I / O accesses and the I / O access uniformly query the updated mapping page table, reduce the probability of memory page faults of other I / O accesses, and improve thread execution efficiency.
[0089] Step 204: The page fault request processing device sends a page fault message to a page fault exception queue according to the page fault request.
[0090] Among them, the page fault message can be understood as a message corresponding to the page fault request and carrying the virtual address information corresponding to the missing memory page; the page fault exception queue can be understood as a queue storing all virtual machine I / O access page fault messages.
[0091] Continuing with the above example, the page fault request processing device sends a page fault message to the page fault exception queue according to the page fault request. It can be understood that the VPRI-PCI device sends a message carrying the virtual address information corresponding to the missing memory page to the page fault exception queue according to the page fault request sent by the DPU.
[0092] In one or more embodiments of the present specification, a page fault message is sent to a page fault exception queue according to a page fault request. The page fault exception queue is a shared memory residing in the host memory. The shared memory can be understood as a large-capacity memory that can be accessed by different data processors in a multi-processor computer system. It is a high-speed communication channel between a VPRI-PCI device and a VMM, and can achieve I / O page fault processing with minimal delay. The specific implementation method is as follows:
[0093] The sending a page fault message to a page fault exception queue according to the page fault request includes:
[0094] The page fault request processing device sends a page fault message to the page fault exception queue of the shared memory in the host memory according to the page fault request.
[0095] Continuing with the above example, the page fault request processing device sends a page fault message to the page fault exception queue of the shared memory in the host memory according to the page fault request. It can be understood that the VPRI-PCI device sends a page fault message to the page fault exception queue of the shared memory in the host memory according to the page fault request.
[0096] The memory page fault processing method provided in the embodiment of the present specification can complete the I / O page fault processing with minimal delay by sending a page fault message to the page fault exception queue of the shared memory in the host memory.
[0097] Step 206: The virtual machine manager obtains the page fault message in the page fault exception queue, performs page fault processing according to the page fault message, obtains the missing memory page, and sends a processing completion instruction for the missing memory page to the page fault request processing device.
[0098] Among them, the virtual machine manager can be understood as the VMM in the above embodiment; the page fault processing can be understood as operations such as obtaining the virtual address in the page fault message and assigning a physical address to the virtual address; the processing completion instruction can be understood as a completion instruction for assigning the corresponding physical address to the virtual address in the page fault message.
[0099] In specific implementation, the VMM obtains the page fault message in the page fault exception queue, performs page fault processing according to the virtual address in the page fault message, obtains the physical address corresponding to the virtual address in the page fault message, and sends a completion instruction to the VPRI-PCI device to allocate the physical address to the virtual address in the page fault message.
[0100] In one or more embodiments of the present specification, a page fault request processing driver corresponding to the page fault request processing device is included in the virtual machine manager. The page fault request processing driver is a special program that enables the computer and the page fault request processing device to communicate with each other, which is equivalent to a hardware interface. The page fault request processing driver is used to obtain the page fault message from the page fault exception queue. The specific implementation method is as follows:
[0101] The virtual machine manager includes a page fault request processing driver corresponding to the page fault request processing device;
[0102] Correspondingly, obtaining the page fault message in the page fault exception queue includes:
[0103] The virtual machine manager obtains the page fault message in the page fault exception queue through the page fault request processing driver.
[0104] Among them, the page fault request processing driver can be understood as a page fault request processing driver corresponding to the page fault request processing device in the host. The page fault request processing driver can be understood as an interface between the page fault request processing device and the operating system. The operating system can control the operation of the page fault request processing device through this interface.
[0105] That is, after the VPRI-PCI device sends a page fault message to the page fault exception queue, the VPRI-PCI driver corresponding to the VPRI-PCI device in the VMM obtains the page fault message sent by the VPRI-PCI device from the page fault exception queue.
[0106] The memory page fault processing method provided in the embodiment of this specification obtains the page fault message in the page fault exception queue through the page fault request processing driver, so as to connect the VPRI-PCI device with the operating system, which is convenient for the operating system to control the VPRI-PCI device.
[0107] In one or more embodiments of the present specification, the virtual manager performs page fault processing, and the memory management unit in the virtual machine manager performs page fault processing, and the memory management unit obtains the virtual address corresponding to the missing memory page in the page fault message, and allocates a physical address to the virtual address to obtain the missing memory page. The specific implementation method is as follows:
[0108] The performing page missing processing according to the page missing message to obtain the missing memory page includes:
[0109] The memory management unit in the virtual machine manager determines a memory page corresponding to the virtual address according to the virtual address corresponding to the missing memory page carried in the missing page message.
[0110] The memory management unit can be understood as a software functional unit that manages and allocates memory.
[0111] In actual applications, the VMM recovers the missing memory page through the memory management unit in the VMM according to the virtual address corresponding to the missing memory page carried in the page fault message. Specifically, the memory management unit in the VMM allocates a physical address to the virtual address according to the virtual address corresponding to the missing memory page carried in the page fault message, obtains the memory page corresponding to the virtual address, modifies the IOMMU page table of the virtual machine, and updates the GPA memory mapping state of the virtual machine and the mapped physical address.
[0112] The memory page fault processing method provided in the embodiment of this specification performs page fault processing through the memory management unit in the virtual machine manager, so that the memory management unit allocates a reasonable physical address to the virtual address corresponding to the missing memory page carried in the page fault message, and obtains the memory page corresponding to the virtual address.
[0113] Step 208: The page fault request processing device updates the status table according to the processing completion instruction, so that the data processing device performs the I / O access processing according to the updated status table, wherein the status table includes the existence status of the missing memory page.
[0114] Still taking the page fault request processing device as a VPRI-PCI device as an example, the memory page fault processing method provided in the embodiments of this specification is described in detail.
[0115] The page fault request processing device updates the status table according to the processing completion instruction so that the data processing device performs the I / O access processing according to the updated status table. It can be understood that after obtaining the missing memory page, the VMM sends a processing completion instruction to the VPRI-PCI device. After receiving the processing completion instruction, the VPRI-PCI device updates the status table, such as setting the status corresponding to the missing memory page to "1" to indicate that the memory page exists. The DPU performs the I / O access processing of the above-mentioned virtual machine according to the updated status table.
[0116] In one or more embodiments of the present specification, after the page fault request processing device completes the status table update, it sends a processing completion notification to the data processing device, so that the data processing device can quickly process the I / O access in the I / O queue according to the processing completion notification. The specific implementation method is as follows:
[0117] The updating of the status table according to the processing completion instruction so that the data processing device performs the I / O access processing according to the updated status table includes:
[0118] The page fault request processing device updates the status table according to the processing completion instruction, and sends an update completion instruction for the updated status table to the data processing device;
[0119] The data processing device, in response to the update completion instruction, performs the I / O access processing according to the updated status table.
[0120] In actual applications, the VPRI-PCI device updates the status table in the VPRI-PCI device according to the processing completion instruction obtained from the VMM, and sends the update completion instruction to the DPU; the DPU responds to the update completion instruction and processes the I / O access according to the updated status table.
[0121] The memory page fault processing method provided in the embodiment of this specification is that after the page fault request processing device completes the status table update, it sends an update completion instruction to the data processing device. The data processing device receives the update completion instruction and quickly processes the I / O access in the I / O queue according to the update completion instruction.
[0122] In one or more embodiments of the present specification, there may be one virtual machine or multiple virtual machines. In the case of multiple virtual machines, the page fault requests corresponding to the I / O access sent by multiple virtual machines may be processed concurrently to achieve more efficient memory page fault processing efficiency. The specific implementation method is as follows:
[0123] There are at least two virtual machines;
[0124] Correspondingly, sending a page fault message to a page fault exception queue according to the page fault request includes:
[0125] The page fault request processing device sends at least two page fault messages to the page fault exception queue according to the at least two page fault requests, wherein the at least two page fault requests are sent to the page fault request processing device by the data processing device when it is determined that the memory pages corresponding to the I / O accesses sent by the at least two virtual machines are all missing;
[0126] Correspondingly, the acquiring the page fault message in the page fault exception queue, performing page fault processing according to the page fault message, obtaining the missing memory page, and sending a processing completion instruction for the missing memory page to the page fault request processing device, includes:
[0127] The virtual machine manager obtains the at least two page fault messages in the page fault exception queue, performs page fault processing according to the at least two page fault messages, obtains the at least two missing memory pages, and sends a processing completion instruction for the at least two missing memory pages to the page fault request processing device.
[0128] Accordingly, updating the state table according to the processing completion instruction so that the data processing device performs the I / O access processing according to the updated state table includes:
[0129] The page fault request processing device updates at least two status tables according to the processing completion instruction, so that the data processing device performs the at least two I / O access processes according to the updated at least two status tables, wherein the status tables include the existence status of the at least two missing memory pages.
[0130] In an actual application, two virtual machines are taken, namely virtual machine A and virtual machine B; I / O access is respectively virtual machine A's read and write access A to disk A, and virtual machine B's read and write access B to disk B as an example for detailed description.
[0131] When the DPU determines that the memory pages corresponding to the read and write access A and read and write access B sent by virtual machines A and B are missing, it sends page fault request A and page fault request B to the VPRI-PCI device. The VPRI-PCI device sends page fault message A and page fault message B to the page fault exception queue according to page fault request A and page fault request B.
[0132] The VMM obtains the page fault message A and the page fault message B in the page fault exception queue, and performs page fault processing according to the two page fault messages, obtains the missing memory page A corresponding to the page fault message A, and the missing memory page B corresponding to the page fault message B, and sends a processing completion instruction for the missing memory page A and the missing memory page B to the VPRI-PCI device.
[0133] The VPRI-PCI device updates the status of the missing memory page A in the state table A corresponding to virtual machine A and updates the status of the missing memory page B in the state table B corresponding to virtual machine B according to the processing completion instruction, so that the DPU performs read-write access A and read-write access B according to the updated state table A and the updated state table B.
[0134] The memory page fault processing method provided in the embodiment of this specification can process page fault requests corresponding to I / O access sent by multiple virtual machines when there are multiple virtual machines, so as to achieve more efficient memory page fault processing efficiency.
[0135] In one or more embodiments of the present specification, when there are multiple virtual machines, after obtaining multiple missing memory pages corresponding to the multiple virtual machines, the state table corresponding to each virtual machine is updated, and after the update is completed, the corresponding update completion instruction can be sent out of order to the data processing device through the missing page request processing interface, so that the data processing device can quickly process the I / O access corresponding to the multiple virtual machines. The specific implementation method is as follows:
[0136] The page fault request processing device includes a page fault request processing interface;
[0137] Accordingly, updating at least two status tables according to the processing completion instruction so that the data processing device performs the at least two I / O access processes according to the updated at least two status tables includes:
[0138] The page fault request processing device updates at least two status tables according to the processing completion instruction, and sends at least two update completion instructions for the updated at least two status tables to the data processing device through the page fault request processing interface;
[0139] The data processing device, in response to the at least two update completion instructions, performs the I / O access processing according to the at least two subsequent status tables.
[0140] The page fault request processing interface may be understood as a page response interface, and the page response interface is used to send an update completion instruction to a data processing device.
[0141] Specifically, continuing with the above example, in the VPRI-PCI device, after updating the status table A according to the processing completion instruction for the missing memory page A and updating the status table B according to the processing completion instruction for the missing memory page B, the update completion instruction A corresponding to the updated status table A and the update completion instruction B corresponding to the updated status table B can be sent to the DPU through the page response interface of the VPRI-PCI device; the DPU responds to the update completion instruction A and the update completion instruction B, and performs read-write access A and read-write access B according to the updated status table A and the updated status table B.
[0142] In actual applications, the page response interface of the VPRI-PCI device can send the update completion instruction A corresponding to the updated status table A and the update completion instruction B corresponding to the updated status table B out of order. It is not necessary to send the update completion instructions in the order in which they are taken out from the page fault exception queue, thereby improving processing efficiency.
[0143] The memory page fault processing method provided in the embodiment of this specification sends corresponding update completion instructions to the data processing device in a disorderly manner through the page fault request processing interface, so that the data processing device can quickly process the I / O accesses corresponding to multiple virtual machines.
[0144] Based on this, the memory page fault processing method provided in the embodiment of this specification introduces a page fault request processing device in the data processing device. When the data processing device sends a page fault request to the page fault request processing device, the page fault request processing device sends a page fault message to the virtual machine manager according to the page fault request, thereby realizing an I / O page fault request interface that is independent of the IOMMU, shortening the processing link of I / O memory page fault recovery, improving the processing efficiency of I / O memory page fault recovery, and reducing the device's memory access delay.
[0145] See also Figure 3 , Figure 3 A schematic diagram of a VPRI architecture under a DPU-assisted virtualization architecture to which a memory page fault processing method is applied is shown according to an embodiment of the present specification, which will be introduced below in conjunction with a specific embodiment.
[0146] The figure shows a VPRI architecture under a DPU-assisted virtualization architecture that applies a memory page fault processing method, specifically including a server and a DPU, wherein the server includes a host, multiple virtual machines running in the host, such as virtual machine 1, virtual machine 2...virtual machine N, etc., a virtual machine manager, connected to the DPU through a device interface, and the DPU includes a DPU IO engine, a VPRI-PCI device, and some other PCI devices, such as network, storage, disk devices, etc.
[0147] There is an independent PCI function in the VPRI architecture, namely the VPRI-PCI device. The VPRI-PCI device is one of the PCI devices that the DPU provides or emulates along with all other network and storage PCI devices. The VPRI-PCI device is independent of any other PCI devices on the DPU.
[0148] However, the IO engines behind other PCI devices rely on the VPRI-PCI device to detect the page existence attribute of the memory page, because the VPRI-PCI device provides a detection method for whether the memory page is mapped. For example, a state table is stored in the VPRI-PCI device, which stores the mapping existence status (mapped / unmapped) of each memory page of each virtual machine, such as the state table corresponding to virtual machine 1, the state table corresponding to virtual machine 2... The state table corresponding to virtual machine N. Therefore, before performing DMA, other PCI devices need to first determine whether the memory to be accessed is in a missing page state through the page mapping information in the state table in the VPRI-PCI device. It should be noted that the VPRI-PCI device can send IOPF messages to the virtual machine manager.
[0149] The VPRI-PCI device provides an MMIO device interface and a standard MSI-X interrupt, wherein MMIO can be understood as a register of a PCI device, which is used by the host CPU to access the PCI device through memory mapping. On top of these basic PCI models, the IOPF shared memory queue negotiation between the virtual machine manager and the VPRI-PCI device is implemented. This queue is called Page Fault Queue (PFQ), which is the page fault exception queue in the above embodiment. PFQ can be understood as a shared memory residing in the host memory. The PFQ paired with the MSI-X interrupt can be understood as a high-speed communication channel between the VPRI-PCI device and the VMM, which can complete the I / O page fault processing with minimal delay.
[0150] Specifically, the virtual machine can directly access the PCI devices in the DPU through device pass-through. For example, virtual machine 1 can directly access the network, storage, and disk devices corresponding to virtual machine 1 in the DPU. When virtual machine 1 performs I / O access to these PCI devices, these PCI devices are processed through I / O, that is, the DPU I / O engine calls the state table corresponding to virtual machine 1 in the VPRI-PCI device to perform page search. When it is determined that the memory page corresponding to the I / O access sent by virtual machine 1 is missing, the DPU I / O engine sends a page request to the VPRI-PCI device. The VPRI-PCI device queues the page missing message in the page request into the PFQ. The VPRI-PCI driver corresponding to the VPRI-PCI device takes the page missing message out of the PFQ to dequeue the message, and sends the page missing message to the virtual machine manager. The virtual machine manager performs page missing processing, obtains the missing memory page, performs mapping update, and completes the state table update.
[0151] Based on this, the memory page fault processing method provided in the embodiment of this specification adds a bypass Function independent of the DPU in the DPU. When a memory page fault occurs, a page fault message is sent according to this bypass Function, thereby realizing a bypass PCI Function that does not rely on the IOMMU PRI to provide PRI request service, shortening the processing link of I / O memory page fault recovery, improving the processing efficiency of I / O memory page fault recovery, and reducing the device's memory access delay.
[0152] See also Figure 4 , Figure 4 A flowchart of a method for processing a memory page fault provided by an embodiment of the present specification is shown.
[0153] based on Figure 3 The architecture in the embodiment of the present invention describes in detail the method for handling the memory page fault and the specific processing process of the memory page fault corresponding to the I / O access of the virtual machine.
[0154] in, Figure 4 Virtual machines A and B in the Figure 3 In the case where virtual machine A reads and writes disk A through DMA, and virtual machine B reads and writes disk B through DMA, a DMA job can be understood as an I / O request in the above embodiment, and a DMA queue can be understood as an I / O queue in the above embodiment.
[0155] Step 1: Encountered a page error.
[0156] When the IO engine of the DPU identifies through some means (such as ATS translation, or page table mirroring on the device, etc.) that an IO request of one of the IO queues (such as virtio-net, virtio-blk, NVMe, RDMA) encounters a page fault, for example, a DMA job in the DMA queue corresponding to the virtual machine A in the figure, and a DMA job in the DMA queue corresponding to the virtual machine B have a page fault; encountering a page fault means that the memory page corresponding to the I / O access sent by the virtual machine in the above embodiment is missing.
[0157] Specifically, the I / O engine of the DPU identifies that an I / O request of the I / O queue encounters a page fault.
[0158] Step 2: Submit the page request.
[0159] The page request may be understood as the page missing request in the above embodiment.
[0160] When a page fault occurs, the I / O engine generates an IOPF message, sends the IOPF message to the PFQ queue, and interrupts the I / O processing through the VPRI-PCI device. According to the queuing order of the DMA queue, the DMA job below the page fault DMAjob is locked.
[0161] Specifically, to ensure the semantic consistency of the I / O queues, the I / O queues that encounter the IOPF device are stopped from processing before the page fault is processed. The I / O engine only suspends the I / O queue where the IOPF occurs, and other I / O queues are not affected.
[0162] For the specific implementation, please refer to the above embodiments, which will not be described in detail here.
[0163] Step 3: Concurrently process IOPFs.
[0164] Specifically, according to the queuing order of page errors, IOPF is processed concurrently, and page request A corresponding to virtual machine A and page request B corresponding to virtual machine B are processed simultaneously in the page request thread pool of the virtual machine manager. Page request A of virtual machine A is processed in page request thread A, and page request B of virtual machine B is processed in page request thread B.
[0165] Step 4: Out-of-order page responses.
[0166] The page response may be understood as the update completion instruction in the above embodiment.
[0167] Specifically, the page response interface provided by the VPRI-PCI device can process out-of-order IOPF completion events to ensure that there is no congestion or interference between virtual machines.
[0168] For the specific implementation, please refer to the above embodiments, which will not be described in detail here.
[0169] Step 5: Process the next I / O.
[0170] After completing the I / O access in which the page fault occurred, the interruption to the I / O queue is released, and the next I / O is processed according to the queuing order of the I / O queue.
[0171] For the specific implementation, please refer to the above embodiments, which will not be described in detail here.
[0172] The memory page fault processing method provided in the embodiments of the present specification introduces a page fault request processing device into a data processing device. When the data processing device sends a page fault request to the page fault request processing device, the page fault request processing device sends a page fault message to the virtual machine manager according to the page fault request, thereby realizing an I / O page fault request interface that is independent of the IOMMU, shortening the processing link of I / O memory page fault recovery, improving the processing efficiency of I / O memory page fault recovery, and reducing the device's memory access delay.
[0173] See also Figure 5 , Figure 5 A schematic diagram of the structure of a page fault request processing device provided by an embodiment of the present specification is shown.
[0174] like Figure 5 As shown, the device comprises:
[0175] The page fault message sending module 502 is configured to send a page fault message to a page fault exception queue according to a page fault request, wherein the page fault message is sent by the data processing device when it is determined that a memory page corresponding to an I / O access sent by the virtual machine is missing.
[0176] The status table update module 504 is configured to update the status table according to the processing completion instruction so that the data processing device performs the I / O access processing according to the updated status table, wherein the processing completion instruction is sent by the virtual machine manager after obtaining the page fault message in the page fault exception queue and performing page fault processing according to the page fault message to obtain the missing memory page, and the status table includes the existence status of the missing memory page.
[0177] Specifically, the page fault request processing device can send a page fault message to the virtual machine manager according to the page fault request, implement an I / O page fault request interface that is independent of the IOMMU, shorten the processing link of I / O memory page fault recovery, improve the processing efficiency of I / O memory page fault recovery, and reduce the device's memory access delay.
[0178] Corresponding to the above method embodiment, this specification also provides a memory page fault system embodiment, Figure 6 FIG. 2 shows a schematic diagram of a memory page fault system provided by an embodiment of the present specification. Figure 6 As shown, the system includes:
[0179] The data processing device 602 is configured to send the page missing request to the page missing request processing device when determining that the memory page corresponding to the I / O access sent by the virtual machine is missing;
[0180] A page fault request processing device 604 is configured to send a page fault message to a page fault exception queue according to the page fault request;
[0181] The virtual machine manager 606 is configured to obtain the page fault message in the page fault exception queue, perform page fault processing according to the page fault message, obtain the missing memory page, and send a processing completion instruction for the missing memory page to the page fault request processing device;
[0182] The page missing request processing device 604 is configured to update a status table according to the processing completion instruction so that the data processing device performs the I / O access processing according to the updated status table, wherein the status table includes the existence status of the missing memory page.
[0183] Optionally, the data processing device 602 is further configured to:
[0184] Receive an I / O access sent by the virtual machine, add the I / O access to an I / O queue, and determine a virtual address corresponding to the I / O access;
[0185] Calling a status table in the page fault request processing device to find the existence status of the memory page corresponding to the virtual address;
[0186] According to the existence state of the memory page, it is determined that the memory page corresponding to the I / O access sent by the virtual machine is missing.
[0187] Optionally, the system further comprises:
[0188] The virtual machine is configured to send I / O accesses to the data processing component to the data processing device.
[0189] Optionally, the page fault request processing device 604 is further configured to:
[0190] The processing of the I / O access in the I / O queue and the processing of other I / O accesses in the I / O queue that are located after the I / O access in the I / O queue are interrupted.
[0191] Optionally, the virtual machine manager 606 is further configured to:
[0192] The page fault message in the page fault exception queue is acquired through the page fault request processing driver.
[0193] Optionally, the virtual machine manager 606 is further configured to:
[0194] According to the virtual address corresponding to the missing memory page carried in the missing page message, a memory page corresponding to the virtual address is determined.
[0195] Optionally, the page fault request processing device 604 is further configured to:
[0196] updating the state table according to the processing completion instruction, and sending an update completion instruction for the updated state table to the data processing device;
[0197] The data processing device, in response to the update completion instruction, performs the I / O access processing according to the updated status table.
[0198] Optionally, the system further comprises:
[0199] The page fault request processing device sends at least two page fault messages to the page fault exception queue according to the at least two page fault requests, wherein the at least two page fault requests are sent to the page fault request processing device by the data processing device when it is determined that the memory pages corresponding to the I / O accesses sent by the at least two virtual machines are all missing;
[0200] The virtual machine manager obtains the at least two page fault messages in the page fault exception queue, performs page fault processing according to the at least two page fault messages, obtains the at least two missing memory pages, and sends a processing completion instruction for the at least two missing memory pages to the page fault request processing device.
[0201] The page fault request processing device updates at least two status tables according to the processing completion instruction, so that the data processing device performs the at least two I / O access processes according to the updated at least two status tables, wherein the status tables include the existence status of the at least two missing memory pages.
[0202] The page fault request processing device updates at least two status tables according to the processing completion instruction, and sends at least two update completion instructions for the updated at least two status tables to the data processing device through the page fault request processing interface;
[0203] The data processing device, in response to the at least two update completion instructions, performs the I / O access processing according to the at least two updated status tables.
[0204] Optionally, the page fault request processing device 604 is further configured to:
[0205] A page fault message is sent to a page fault exception queue of the shared memory in the host memory according to the page fault request.
[0206] Specifically, the memory page fault processing system introduces a page fault request processing device in a data processing device. When the data processing device sends a page fault request to the page fault request processing device, the page fault request processing device sends a page fault message to the virtual machine manager according to the page fault request, thereby realizing an I / O page fault request interface that is independent of the IOMMU, shortening the processing link of I / O memory page fault recovery, improving the processing efficiency of I / O memory page fault recovery, and reducing the device's memory access delay.
[0207] The above is a schematic scheme of a memory page fault system of this embodiment. It should be noted that the technical scheme of the memory page fault system and the technical scheme of the above-mentioned memory page fault system belong to the same concept, and the details of the technical scheme of the memory page fault system that are not described in detail can all be referred to the description of the technical scheme of the above-mentioned memory page fault method.
[0208] Figure 7 The block diagram of a computing device 700 according to an embodiment of the present specification is shown. The components of the computing device 700 include but are not limited to a memory 710 and a processor 720. The processor 720 is connected to the memory 710 via a bus 730, and the database 750 is used to store data.
[0209] The computing device 700 also includes an access device 740 that enables the computing device 700 to communicate via one or more networks 760. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 740 may include one or more of any type of network interface (e.g., a network interface card (NIC)) that is wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a world-wide interoperability for microwave access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, and a near field communication (NFC).
[0210] In one embodiment of the present specification, the above components of the computing device 700 and Figure 7 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Figure 7 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.
[0211] The computing device 700 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or a personal computer (PC). The computing device 700 may also be a mobile or stationary server.
[0212] The processor 720 is used to execute the following computer executable instructions, which, when executed by the processor, implement the steps of the above-mentioned memory page fault method.
[0213] The above is a schematic scheme of a computing device of this embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the above-mentioned memory page fault method belong to the same concept, and the details not described in detail in the technical scheme of the computing device can be referred to the description of the technical scheme of the above-mentioned memory page fault method.
[0214] An embodiment of the present specification further provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the steps of the above-mentioned memory page fault method.
[0215] The above is a schematic scheme of a computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the above-mentioned memory page fault method belong to the same concept, and the details not described in detail in the technical scheme of the storage medium can be referred to the description of the technical scheme of the above-mentioned memory page fault method.
[0216] An embodiment of the present specification further provides a computer program, wherein when the computer program is executed in a computer, the computer is caused to execute the steps of the above-mentioned memory page fault method.
[0217] The above is a schematic scheme of a computer program of this embodiment. It should be noted that the technical scheme of the computer program and the technical scheme of the above-mentioned memory page fault method belong to the same concept, and the details not described in detail in the technical scheme of the computer program can be referred to the description of the technical scheme of the above-mentioned memory page fault method.
[0218] The above is a description of a specific embodiment of the present specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0219] The computer instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate forms, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of patent practice. For example, in some regions, according to patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0220] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of this specification are not limited by the order of the actions described, because according to the embodiments of this specification, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the embodiments of this specification.
[0221] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0222] The preferred embodiments of this specification disclosed above are only used to help explain this specification. The optional embodiments do not describe all the details in detail, nor do they limit the invention to only the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of the embodiments of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the embodiments of this specification, so that technicians in the relevant technical field can well understand and use this specification. This specification is only limited by the claims and their full scope and equivalents.
Claims
1. A method for processing a memory page fault, applied to a memory page fault processing system, the memory page fault processing system comprising a host, a virtual machine and a virtual machine manager running in the host, a data processing device deployed in the host to process I / O access of the virtual machine, and a page fault request processing device deployed in the host to process a page fault request sent by the data processing device, wherein: The method comprises: The data processing device, when determining that a memory page corresponding to the I / O access sent by the virtual machine is missing, sends the page missing request to the page missing request processing device; The page fault request processing device sends a page fault message to a page fault exception queue according to the page fault request; The virtual machine manager obtains the page fault message in the page fault exception queue, performs page fault processing according to the page fault message, obtains the missing memory page, and sends a processing completion instruction for the missing memory page to the page fault request processing device; The page missing request processing device updates a status table according to the processing completion instruction, so that the data processing device performs the I / O access processing according to the updated status table, wherein the status table includes the existence status of the missing memory page.
2. The method for processing a memory page fault according to claim 1, before determining that a memory page corresponding to the I / O access sent by the virtual machine is missing, further comprising: The data processing device receives the I / O access sent by the virtual machine, adds the I / O access to an I / O queue, and determines a virtual address corresponding to the I / O access; Calling a status table in the page fault request processing device to find the existence status of the memory page corresponding to the virtual address; Accordingly, determining that a memory page corresponding to the I / O access sent by the virtual machine is missing includes: The data processing device determines, according to the existence status of the memory page, that a memory page corresponding to the I / O access sent by the virtual machine is missing.
3. The memory page fault processing method according to claim 2, wherein the data processing device comprises a data processing component; Accordingly, before receiving the I / O access sent by the virtual machine and determining the virtual address corresponding to the I / O access, the method further includes: The virtual machine sends an I / O access to the data processing component to the data processing device.
4. The method for processing a memory page fault according to claim 2, after determining that the memory page corresponding to the I / O access sent by the virtual machine is missing, further comprising: The page fault request processing device interrupts the processing of the I / O access in the I / O queue and the processing of other I / O accesses in the I / O queue, wherein the other I / O accesses are located after the I / O access in the I / O queue.
5. The memory page fault processing method according to claim 1, wherein the virtual machine manager comprises a page fault request processing driver corresponding to the page fault request processing device; Correspondingly, obtaining the page fault message in the page fault exception queue includes: The virtual machine manager obtains the page fault message in the page fault exception queue through the page fault request processing driver.
6. The memory page fault processing method according to claim 1, wherein the page fault processing is performed according to the page fault message to obtain the missing memory page, comprising: The memory management unit in the virtual machine manager determines a memory page corresponding to the virtual address according to the virtual address corresponding to the missing memory page carried in the missing page message.
7. The memory page fault processing method according to claim 2, wherein the updating of the status table according to the processing completion instruction so that the data processing device performs the I / O access processing according to the updated status table comprises: The page fault request processing device updates the status table according to the processing completion instruction, and sends an update completion instruction for the updated status table to the data processing device; The data processing device, in response to the update completion instruction, performs the I / O access processing according to the updated status table.
8. The memory page fault processing method according to claim 1, wherein the number of the virtual machines is at least two; Correspondingly, sending a page fault message to a page fault exception queue according to the page fault request includes: The page fault request processing device sends at least two page fault messages to the page fault exception queue according to the at least two page fault requests, wherein the at least two page fault requests are sent to the page fault request processing device by the data processing device when it is determined that the memory pages corresponding to the I / O accesses sent by the at least two virtual machines are all missing; Correspondingly, the acquiring the page fault message in the page fault exception queue, performing page fault processing according to the page fault message, obtaining the missing memory page, and sending a processing completion instruction for the missing memory page to the page fault request processing device, includes: The virtual machine manager obtains the at least two page fault messages in the page fault exception queue, performs page fault processing according to the at least two page fault messages, obtains the at least two missing memory pages, and sends a processing completion instruction for the at least two missing memory pages to the page fault request processing device.
9. The memory page fault processing method according to claim 8, wherein the number of the virtual machines is at least two; Accordingly, updating the state table according to the processing completion instruction so that the data processing device performs the I / O access processing according to the updated state table includes: The page fault request processing device updates at least two status tables according to the processing completion instruction, so that the data processing device performs the at least two I / O access processes according to the updated at least two status tables, wherein the status tables include the existence status of the at least two missing memory pages.
10. The memory page fault processing method according to claim 9, wherein the page fault request processing device comprises a page fault request processing interface; Accordingly, updating at least two status tables according to the processing completion instruction so that the data processing device performs the at least two I / O access processes according to the updated at least two status tables includes: The page fault request processing device updates at least two status tables according to the processing completion instruction, and sends at least two update completion instructions for the updated at least two status tables to the data processing device through the page fault request processing interface; The data processing device, in response to the at least two update completion instructions, performs the I / O access processing according to the at least two updated status tables.
11. The memory page fault processing method according to claim 1, wherein sending a page fault message to a page fault exception queue according to the page fault request comprises: The page fault request processing device sends a page fault message to the page fault exception queue of the shared memory in the host memory according to the page fault request.
12. A memory page fault processing system, comprising: The data processing device is configured to send the page missing request to the page missing request processing device when determining that a memory page corresponding to the I / O access sent by the virtual machine is missing; The page fault request processing device is configured to send a page fault message to a page fault exception queue according to the page fault request; The virtual machine manager is configured to obtain the page fault message in the page fault exception queue, perform page fault processing according to the page fault message, obtain the missing memory page, and send a processing completion instruction for the missing memory page to the page fault request processing device; The page missing request processing device is configured to update a status table according to the processing completion instruction so that the data processing device performs the I / O access processing according to the updated status table, wherein the status table includes the existence status of the missing memory page.
13. A page missing request processing device, comprising a page missing message sending module and a status table updating module, wherein: The page fault message sending module is configured to send a page fault message to a page fault exception queue according to a page fault request, wherein the page fault message is sent by the data processing device when it is determined that a memory page corresponding to an I / O access sent by the virtual machine is missing; The status table update module is configured to update the status table according to a processing completion instruction so that the data processing device performs the I / O access processing according to the updated status table, wherein the processing completion instruction is sent by the virtual machine manager after obtaining a page fault message in the page fault exception queue and performing page fault processing according to the page fault message to obtain the missing memory page, and the status table includes the existence status of the missing memory page.
14. A computing device comprising: Memory and processor; The memory is used to store computer executable instructions, and the processor is used to execute the computer executable instructions. When the computer executable instructions are executed by a processor, the steps of the target object determination method described in any one of claims 1 to 11 are implemented.
Citation Information
Cited By
Memory page fault handling method and system
EP4718252A1