[go: up one dir, main page]

CN117873921B - A queue page table management method and device based on remote direct memory access - Google Patents

A queue page table management method and device based on remote direct memory access Download PDF

Info

Publication number
CN117873921B
CN117873921B CN202311641570.4A CN202311641570A CN117873921B CN 117873921 B CN117873921 B CN 117873921B CN 202311641570 A CN202311641570 A CN 202311641570A CN 117873921 B CN117873921 B CN 117873921B
Authority
CN
China
Prior art keywords
queue
page table
memory access
direct memory
remote direct
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.)
Active
Application number
CN202311641570.4A
Other languages
Chinese (zh)
Other versions
CN117873921A (en
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.)
Yusur Technology Co ltd
Original Assignee
Yusur Technology 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 Yusur Technology Co ltd filed Critical Yusur Technology Co ltd
Priority to CN202311641570.4A priority Critical patent/CN117873921B/en
Publication of CN117873921A publication Critical patent/CN117873921A/en
Application granted granted Critical
Publication of CN117873921B publication Critical patent/CN117873921B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/10Address translation
    • G06F12/1009Address translation using page tables, e.g. page table structures
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0806Multiuser, multiprocessor or multiprocessing cache systems
    • G06F12/0815Cache consistency protocols
    • G06F12/0831Cache consistency protocols using a bus scheme, e.g. with bus monitoring or watching means
    • G06F12/0835Cache consistency protocols using a bus scheme, e.g. with bus monitoring or watching means for main memory peripheral accesses (e.g. I/O or DMA)

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本发明提供一种基于远程直接内存访问的队列页表管理方法及装置,包括:远程直接内存访问用户态驱动在用户态分配队列缓冲区,并创建一个队列;远程直接内存访问用户态驱动基于预设函数向内核态驱动发起队列的注册请求;远程直接内存访问内核态驱动从操作系统内核获取分配给队列的物理页链表,并为队列分配内存作为队列页表;远程直接内存访问内核态驱动遍历物理页链表中的每一项,并将每一项信息依次写入队列页表;远程直接内存访问内核态驱动将队列页表的基地址写入队列寄存器,将队列页表指针写入队列寄存器,并设置初始值。本发明提供的方法能够高效且便利地存储、管理队列页表,极大降低远程直接内存访问队列页表的访问延迟和存储开销。

The present invention provides a queue page table management method and device based on remote direct memory access, including: the remote direct memory access user state driver allocates a queue buffer in the user state and creates a queue; the remote direct memory access user state driver initiates a queue registration request to the kernel state driver based on a preset function; the remote direct memory access kernel state driver obtains the physical page list allocated to the queue from the operating system kernel, and allocates memory for the queue as a queue page table; the remote direct memory access kernel state driver traverses each item in the physical page list, and writes each item of information into the queue page table in sequence; the remote direct memory access kernel state driver writes the base address of the queue page table into the queue register, writes the queue page table pointer into the queue register, and sets an initial value. The method provided by the present invention can efficiently and conveniently store and manage the queue page table, greatly reducing the access delay and storage overhead of the remote direct memory access queue page table.

Description

Queue page table management method and device based on remote direct memory access
Technical Field
The present invention relates to the field of network communications technologies, and in particular, to a method and an apparatus for managing a queue page table based on remote direct memory access.
Background
Remote Direct memory access (Remote Direct MemoryAccess, RDMA) is a high-performance network technology, and the RoCEv RDMA network card realizes zero-copy network transmission service with an operating system kernel bypass through a hardware offload InfiniBand (InfiniBand) transmission layer, and effectively reduces the occupancy rate of a server CPU during network data transmission. The InfibiBand transport layer interfaces with the software and hardware interactions with queues (Queue) including Send Queue (SQ), receive Queue (RQ), shared Receive Queue (SHAREDRECEIVE QUEUE, SRQ), and Completion Queue (CQ). The queues are generally stored in the server memory, and the RDMA network card user mode driver allocates queue storage spaces with continuous virtual address space and aligned physical pages in the user process address space. In modern Linux operating systems, when RDMA queues occupy more than one physical page, it is often apparent as a discontinuous physical page. RDMA network card reads RDMA queue through PCIe (Peripheral Component Interconnect Express) bus in Direct memory access (Direct MemoryAccess, DMA), DMA can not directly use virtual address of user process, and DMA address uniformly distributed by operating system kernel is needed to access memory.
In the prior art, as shown in fig. 1, an RDMA kernel mode driver acquires DMA addresses of corresponding memory spaces, organizes mapping relation from virtual addresses of queue memory spaces to DMA addresses in a multi-level page table mode according to page units (gray parts in fig. 1), and synchronizes page table information to an RDMA network card. The queue page table information is generally stored in a server for main storage, and when the RDMA network card accesses the queue, the corresponding queue DMA address needs to be acquired firstly based on the virtual address of the queue to be accessed and the base address of the queue page table.
For ease of understanding, the exemplary queue access basic block size is 64B, assuming an operating system physical page size of typically 4KB, with each queue page table entry storing a size of 8B. If the size of the queue storage space is smaller than or equal to 4KB, the page table progression is one stage, the page table only comprises one page table item, the page table item can be directly synchronized to the queue information storage space on the RDAM network card, if the size of the queue storage space is larger than or equal to 4KB and smaller than or equal to 2MB, the page table progression is two stages, the first stage page table stores the DMA base address of the second stage page table, the second stage page table stores the page table item of the queue, the size of the second stage page table is 4KB, and the page table cannot be directly synchronized to the limited RDMA network card queue information storage space, therefore, in the process of accessing 64 queue basic blocks, the next queue page table item needs to be initiated through a PCIe bus once, if the size of the queue storage space is larger than or equal to 1 MB, the page table progression is three stages, the first stage page table stores the DMA base address of the second stage page table, and the second stage page table stores the DMA base address of the third stage page table, and in the process of accessing 64 queues, the next page table item needs to be initiated through the PCIe bus twice to be read.
Disclosure of Invention
In view of this, the embodiment of the invention provides a method and a device for managing a queue page table based on remote direct memory access, so as to eliminate or improve one or more defects existing in the prior art, and solve the problem of high page table access overhead in the existing remote direct memory access queue access process.
In one aspect, the present invention provides a method for managing a queue page table based on remote direct memory access, where the method is executed on a remote direct memory access network card, and includes the following steps:
The remote direct memory access user mode driver allocates a queue buffer in a user mode and creates a queue; the remote direct memory access user mode driver initiates a registration request of the queue to a kernel mode driver based on a preset function;
The remote direct memory access kernel mode driver acquires a physical page linked list allocated to the queue from an operating system kernel, and allocates a section of memory as a queue page table for the queue;
The remote direct memory access kernel mode driver traverses each item in the physical page list and writes each item of information into the queue page list in turn;
and the remote direct memory access kernel mode driver writes the base address of the queue page table into a queue register, writes the pointer of the queue page table into the queue register, and sets an initial value.
In some embodiments of the present invention, the method for managing a queue page table based on remote direct memory access further includes:
the remote direct memory access kernel mode driver allocates a continuous and physically page-aligned memory as a queue page table for the queue.
In some embodiments of the present invention, the remote direct memory access kernel mode driver traverses each item in the physical page table and writes each item of information into the queue page table in turn, further comprising:
each item of the queue page table is 8 bytes, the lower 12 bits are the number of physical pages mapped by the item, and the upper 52 bits are the upper 52 bits of the initial physical page address corresponding to the item;
If the item mapping of the physical page linked list exceeds 4096 physical pages, splitting the physical page linked list into a plurality of queue page table items for storage.
In some embodiments of the present invention, the method for managing a queue page table based on remote direct memory access further includes:
The remote direct memory access kernel mode driver writes the base address of the queue page table and the queue page table pointer to the queue register based on PCIe protocol standards.
In some embodiments of the present invention, the remote direct memory access kernel mode driver writes a base address of the queue page table to a queue register, writes a queue page table pointer to the queue register, and sets an initial value, the method further comprises:
The remote direct memory access kernel mode driver returns queue creation completion information to the remote direct memory access user mode driver;
and the remote direct memory access user mode driver receives the queue creation completion information, and the queue creation process is ended.
In some embodiments of the invention, after completion of the queue creation, the method further comprises:
The remote direct memory access kernel mode driver judges the number of the queue page table entries;
If the number of the first item and the second item of the queue page table is greater than or equal to two items, writing the first item and the second item of the queue page table into a first cache item and a second cache item of the queue register in sequence, and modifying initial values of the first cache item and the second cache item;
And the remote direct memory access kernel mode driver sets the initial value of the buffer entry pointer of the queue register.
In some embodiments of the present invention, when the current cache entry pointer points to the first cache entry and the queue page table entry is greater than or equal to two entries, the remote direct memory access network card accesses the queue, the method further includes:
the remote direct memory access network card initiates a direct memory access read queue basic block based on the physical address of the first cache entry;
The method comprises the steps of judging the remaining length of a physical page mapped by a first cache item, if the remaining length is a queue basic block, initiating a queue page table item prefetching request by a remote direct memory access network card, checking the valid bit of a second cache item, if the valid bit is valid, pointing a current cache item pointer to the second cache item, and initializing the remaining length.
In some embodiments of the present invention, if the remaining length is a queue basic block, the remote direct memory access network card initiates a queue page table entry prefetch request, and further includes:
Initiating the queue page table entry prefetch request based on the current cache entry pointer to read a next page table entry;
and returning a prefetched page table entry obtained based on the queue page table entry prefetching request, and replacing the consumed page table entry with the prefetched page table entry.
In another aspect, the present invention provides a queue page table management device based on remote direct memory access, where the device is applied to a remote direct memory access network card, and the device includes:
the queue access module is used for realizing the reading and writing functions of each queue;
The queue information storage module is used for storing a base address of a queue page table, a pointer of the queue page table, a valid bit value of a first cache item, a valid bit value of a second cache item and a pointer of the cache item;
And the page table entry cache maintenance module is used for receiving and executing the queue page table entry prefetching request initiated by the queue access module.
In another aspect, the invention also provides a computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the steps of a method as described in any one of the above-mentioned.
The invention has the advantages that:
The invention provides a queue page table management method and device based on remote direct memory access, wherein the remote direct memory access user state driver distributes a queue buffer area in a user state and creates a queue, the remote direct memory access user state driver initiates a registration request of the queue to a kernel state based on a preset function, the remote direct memory access kernel state driver acquires a physical page linked list distributed to the queue from an operating system kernel and distributes memory as a queue page table for the queue, the remote direct memory access kernel state driver traverses each item in the physical page linked list and sequentially writes information of each item into the queue page table, and the remote direct memory access kernel state driver writes a base address of the queue page table into a queue register, writes a pointer of the queue page table into the queue register and sets an initial value. The method provided by the invention can efficiently and conveniently store and manage the queue page table, and greatly reduce the access delay and the storage overhead of the remote direct memory access queue page table.
Additional advantages, objects, and features of the invention will be set forth in part in the description which follows and in part will become apparent to those having ordinary skill in the art upon examination of the following or may be learned from practice of the invention. The objectives and other advantages of the invention may be realized and attained by the structure particularly pointed out in the written description and drawings.
It will be appreciated by those skilled in the art that the objects and advantages that can be achieved with the present invention are not limited to the above-described specific ones, and that the above and other objects that can be achieved with the present invention will be more clearly understood from the following detailed description.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this specification, illustrate and together with the description serve to explain the application. In the drawings:
FIG. 1 is a diagram illustrating a page table mapping of a prior art queue in page units according to an embodiment of the present invention.
FIG. 2 is a diagram illustrating steps of a method for managing a queue page table based on remote direct memory access according to an embodiment of the present invention.
FIG. 3 is a diagram illustrating a queue page table storage mechanism based on consecutive pages in a remote direct memory access-based queue page table management method according to an embodiment of the invention.
FIG. 4 is a flowchart illustrating an initialization process of a table tennis table entry based on a ping pong buffer according to an embodiment of the present invention.
FIG. 5 is a diagram illustrating a table tennis table entry maintenance flow for a table tennis buffer in accordance with an embodiment of the present invention.
FIG. 6 is a diagram illustrating a table tennis buffer-based queue page table entry prefetching process according to one embodiment of the invention.
FIG. 7 is a schematic diagram of a device for managing a queue page table based on remote direct memory access according to an embodiment of the invention.
Detailed Description
The present invention will be described in further detail with reference to the following embodiments and the accompanying drawings, in order to make the objects, technical solutions and advantages of the present invention more apparent. The exemplary embodiments of the present invention and the descriptions thereof are used herein to explain the present invention, but are not intended to limit the invention.
It should be noted here that, in order to avoid obscuring the present invention due to unnecessary details, only structures and/or processing steps closely related to the solution according to the present invention are shown in the drawings, while other details not greatly related to the present invention are omitted.
It should be emphasized that the term "comprises/comprising" when used herein is taken to specify the presence of stated features, elements, steps or components, but does not preclude the presence or addition of one or more other features, elements, steps or components.
It is also noted herein that the term "coupled" may refer to not only a direct connection, but also an indirect connection in which an intermediate is present, unless otherwise specified.
Hereinafter, embodiments of the present invention will be described with reference to the accompanying drawings. In the drawings, the same reference numerals represent the same or similar components, or the same or similar steps.
It should be emphasized that the references to steps below are not intended to limit the order of the steps, but rather should be understood to mean that the steps may be performed in a different order than in the embodiments, or that several steps may be performed simultaneously.
In order to solve the problem of high page table access overhead in the existing remote direct memory access queue access process, the invention provides a queue page table management method based on remote direct memory access, which is executed on a remote direct memory access RDMA network card, as shown in fig. 2, and comprises the following steps S101-S104:
step S101, a remote direct memory access user mode driver distributes a queue buffer area in a user mode and creates a queue, and the remote direct memory access user mode driver initiates a registration request of the queue to a kernel mode driver based on a preset function.
Step S102, the remote direct memory access kernel mode driver acquires a physical page list allocated to the queue from the operating system kernel, and allocates a section of memory as a queue page table for the queue.
Step S103, the remote direct memory access kernel mode drive traverses each item in the physical page list and writes each item of information into the queue page list in turn.
Step S104, the remote direct memory access kernel mode driver writes the base address of the queue page table into the queue register, writes the pointer of the queue page table into the queue register, and sets an initial value.
In step S101, the remote direct memory access user mode driver allocates a memory space in a user mode as a queue buffer for storing queue data, control information, etc., and creates a queue, and may specify a size and other related parameters of the queue when creating the queue.
The remote direct memory access user mode driver calls a preset function provided by the remote direct memory access kernel mode driver, and initiates a queue registration request to the kernel mode driver. The kernel mode driver allocates resources to the queue and initializes the queue according to the parameters passed by the user mode driver.
In step S102, the remote direct memory access kernel mode driver obtains the physical page link list SCATTER LIST of the queue through an interface provided by the operating system kernel. The physical page linked list includes information of all physical pages related to the queue, and illustratively includes information of a start address, a size, access rights and the like of the physical pages, and other related information of a memory area, a node and the like of the physical pages.
The remote direct memory access kernel mode driver allocates a section of memory as a queue page table for the queue. Wherein the queue page table is an array, and each element (i.e., the queue page table entry) corresponds to address mapping information of a physical page.
In some embodiments, the remote direct memory access kernel mode driver allocates a continuous and physically page-aligned segment of memory for the queue as a queue page table.
In step S103, the remote direct memory access kernel mode driver traverses each item in the physical page table in turn, and writes the corresponding physical page address mapping information into the queue page table in turn.
In some embodiments, each entry of the queue page table, i.e., each queue page table entry, contains 8 bytes, with the lower 12 bits being the number of physical pages mapped by this entry and the upper 52 bits being the upper 52 bits of the initial physical page address corresponding to this entry.
In some embodiments, if the current physical page table entry maps over 4096 physical pages, then it may be necessary to split into multiple queue page table entries for storage.
In step S104, the remote direct memory access kernel mode driver writes the base address of the queue page table into a queue register for storing the queue information related to the remote direct memory access network card, writes the queue page table pointer into the queue register for storing the queue information related to the remote direct memory access network card, and sets an initial value of the queue page table pointer, and exemplarily, sets the initial value to 0.
In some embodiments, the remote direct memory access kernel mode driver writes the base address of the queue page table and the queue page table pointer to the queue register based on PCIe protocol standards.
In some embodiments, after step S104, the following steps are further included:
after the queue creating process is completed, the remote direct memory access kernel mode driver returns control rights to the remote direct memory access user mode driver, and returns queue creating completion information to the remote direct memory access user mode driver.
After receiving the queue creation completion information returned by the kernel mode driver, the remote direct memory access user mode driver creates a process result of the queue. At this time, the application program can access the queue to perform operations such as data transmission through the interface provided by the remote direct memory access user mode driver.
Based on the above description, compared with the prior art, the method provided by the invention can map a continuous physical page by using a queue page table item, and for convenience of understanding and embodying the technical effects, the following is exemplified and compared:
the existing remote direct memory access queue page table storage mechanism adopts a mapping mechanism taking pages as units, so that the remote direct memory access network card is ensured to inquire corresponding page table items within constant time complexity.
For example, defining that the BASE address of the remote direct memory access queue in the process virtual address space is va_base, the BASE block virtual address of the remote direct memory access queue to be accessed currently is va_current, the 4KB PAGE offset page_shift is 12, > > represents a logical right SHIFT operation, and then the corresponding queue PAGE table entry index pt_idx= (va_current > > page_shift) -va_base > > page_shift may be directly located to the corresponding queue PAGE table entry according to pt_idx for the mapping manner shown in fig. 1.
However, when the operating system allocates the storage space of the remote direct memory access queue, there are cases where a plurality of physical pages are consecutive, as shown in fig. 3, 6 virtual pages correspond to three consecutive physical page blocks, the first block includes 1 physical page, the second block includes 2 physical pages, and the third block includes 3 physical pages. For the queue memory distribution situation shown in fig. 3, using the existing conventional queue page table storage mechanism, 6 queue page table entry storage spaces are required to be consumed, and in the running process, the remote direct memory access network card needs 6 PCIe DMA read queue page table entries to completely access the queue once.
If one queue page table entry is used to map a continuous physical page, as shown in fig. 3, the queue page table entry_0 maps 1 physical page, the queue page table entry_1 maps 2 physical pages, and the queue page table_2 maps 3 physical pages. Even if the queue page table management mode provided by the invention is used, only 3 queue page table entry storage spaces are consumed for storing the queue page table information shown in fig. 3, and only 3 PCIe DMA read queue page table entries are required for the remote direct memory access network card to completely access the queue once.
Meanwhile, considering that the queue page table management mechanism provided by the invention cannot directly use the queue basic block VA to determine PT_IDX, in the invention, for each queue, a page table item read pointer is maintained to point to the next queue page table item to be read, and the initial value is 0, because the remote direct memory access network card accesses the queue strictly according to the sequence, after each time the queue page table is accessed by using the page table item read pointer, the queue page table item read pointer is incremented to be used as the next queue page table item pointer to be accessed.
In some embodiments, the invention further provides a table tennis table entry caching and prefetching mechanism based on the queue creation management method of the steps S101-S104. Among them, ping-Pong Operation (Ping-Pong Operation) is a common technique used in computer systems to reduce the need for main memory access and improve the efficiency of data transmission.
Two queue page table cache entries are maintained in the queue information, namely a first cache entry (denoted as cache entry 0) and a second cache entry (denoted as cache entry 1), whether the cache entry is Valid or not is recorded by using two Valid bits (Valid 0 and Valid 1), and a currently used cache entry identifier is recorded by using a current cache entry pointer (0/1), as shown in fig. 4, specifically:
After creating the queue page table based on steps S101 to S104, the remote direct memory access kernel mode driver judges the number of the queue page table entries, if the number is greater than or equal to two, the first entry and the second entry of the queue page table are sequentially written into the first cache entry and the second cache entry of the queue register, and initial values of the first cache entry and the second cache entry are modified, namely, the first entry of the queue page table is written into the cache entry 0, the second entry of the queue page table is written into the cache entry 1, and Valid0 and Valid1 are initialized to 1, and if the number is less than two, the entry (the only one entry) is written into the first cache entry, and the initial values of the first cache entry are modified, namely, the entry is written into the cache entry 0, and Valid0 is initialized to 1.
The remote direct memory access kernel mode driver initializes the cache entry pointer of the queue register to 0.
In some embodiments, the remote direct memory access kernel mode drivers all write information over PCIe.
Considering that the remote direct memory access network card accesses the queue strictly in sequence, when the remote direct memory access network card accesses the queue for the first time, the first cache entry is directly used without reading the page table entry of the queue through PCIe DMA.
In some embodiments, the present invention proposes to maintain a variable, the remaining length, in the queue information. The surplus length is used for recording the surplus length of the continuous physical page of the currently used cache item mapping, and the surplus length is expressed in bytes. As shown in fig. 5, assume that the current cache entry pointer is 0, that is, when the current cache entry pointer points to the first cache entry and the queue page table entry is greater than or equal to two entries, specifically:
The remote direct memory access network card initiates a direct memory access read queue basic block based on the physical address of the first cache entry. The method comprises the steps of judging the remaining length of a physical page mapped by a first cache item, if the remaining length is a queue basic block, initiating a queue page table item prefetching request by a remote direct memory access network card, checking the valid bit of a second cache item, if the valid bit is valid, pointing a pointer of a current cache item to the second cache item, and initializing the remaining length.
The remaining length is a queue basic block, which indicates that the page table item pointed by the current cache item pointer is consumed after the current access is completed, so that after the current PCIe DMA access queue request is completed, the valid bit of another cache page table item is checked, if the cache page table item is valid, the current cache item pointer is updated to point to the cache page table item, and the cache page table item is used for subsequent accesses to the queue.
In some embodiments, if the remaining length is a queue basic block, the remote direct memory access network card initiates a queue page table entry prefetch request, as shown in fig. 6, specifically:
if the page table item pointed by the current cache item pointer is consumed after the current access is completed, triggering page table item prefetching, and initiating a PCIe DMA request to prefetch the next page table item based on the current queue page table pointer. When a PCIe DMA requests a prefetch page table entry return, the prefetch page table entry is used to replace the already consumed page table entry.
One cached page table entry may support multiple PCIe DMA queue accesses, illustratively a queue basic block size of 64 bytes, and in the worst case, one page table entry maps only one 4KB physical page, then one page table entry mapped physical page may accommodate 64 queue basic blocks. Thus, one cache page table entry may support 64 queue accesses, requiring 64 PCIe DMA reads, while a prefetch of one cache page table entry requires only 1 PCIe DMA read. Typically, a page table entry prefetched by a PCIe DMA is returned and updated before the current cached page table entry runs out. In the invention, in the process of accessing the network card access queue by the remote direct memory access, a currently available cache item is necessarily existed, and the situation that waiting for the effective page table item blocks the PCIe DMA read queue does not occur, so the invention can be considered to reduce the address translation overhead to 0 in the process of accessing the large-scale remote direct memory access queue.
The invention also provides a queue page table management device based on remote direct memory access, as shown in fig. 7, which comprises:
and the queue access module is used for realizing the reading and writing functions of each queue.
The queue information storage module is used for storing a base address of a queue page table, a pointer of the queue page table, a valid bit value of a first cache item, a valid bit value of a second cache item and a pointer of the cache item.
And the page table entry cache maintenance module is used for receiving and executing the queue page table entry prefetching request initiated by the queue access module.
In some embodiments, both the queue access and the access to the queue page table are implemented through a PCIe bus interface.
The present invention also provides a computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of a method of queue page table management based on remote direct memory access.
Accordingly, the present invention also provides an apparatus comprising a computer apparatus including a processor and a memory, the memory having stored therein computer instructions for executing the computer instructions stored in the memory, the apparatus implementing the steps of the method as described above when the computer instructions are executed by the processor.
The embodiments of the present invention also provide a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the edge computing server deployment method described above. The computer readable storage medium may be a tangible storage medium such as Random Access Memory (RAM), memory, read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, floppy disks, hard disk, a removable memory disk, a CD-ROM, or any other form of storage medium known in the art.
In summary, the invention provides a queue page table management method and device based on remote direct memory access, which comprises the steps that a remote direct memory access user state driver allocates a queue buffer area in a user state and creates a queue, the remote direct memory access user state driver initiates a registration request of the queue to a kernel state driver based on a preset function, the remote direct memory access kernel state driver obtains a physical page linked list allocated to the queue from an operating system kernel and allocates memory as a queue page table for the queue, the remote direct memory access kernel state driver traverses each item in the physical page linked list and sequentially writes information of each item into the queue page table, and the remote direct memory access kernel state driver writes a base address of the queue page table into a queue register, writes a pointer of the queue page table into the queue register and sets an initial value. The method provided by the invention can efficiently and conveniently store and manage the queue page table, and greatly reduce the access delay and the storage overhead of the remote direct memory access queue page table.
Those of ordinary skill in the art will appreciate that the various illustrative components, systems, and methods described in connection with the embodiments disclosed herein can be implemented as hardware, software, or a combination of both. The particular implementation is hardware or software dependent on the specific application of the solution and the design constraints. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention. When implemented in hardware, it may be, for example, an electronic circuit, an Application Specific Integrated Circuit (ASIC), suitable firmware, a plug-in, a function card, or the like. When implemented in software, the elements of the invention are the programs or code segments used to perform the required tasks. The program or code segments may be stored in a machine readable medium or transmitted over transmission media or communication links by a data signal carried in a carrier wave.
It should be understood that the invention is not limited to the particular arrangements and instrumentality described above and shown in the drawings. For the sake of brevity, a detailed description of known methods is omitted here. In the above embodiments, several specific steps are described and shown as examples. The method processes of the present invention are not limited to the specific steps described and shown, but various changes, modifications and additions, or the order between steps may be made by those skilled in the art after appreciating the spirit of the present invention.
In this disclosure, features that are described and/or illustrated with respect to one embodiment may be used in the same way or in a similar way in one or more other embodiments and/or in combination with or instead of the features of the other embodiments.
The above description is only of the preferred embodiments of the present invention and is not intended to limit the present invention, and various modifications and variations can be made to the embodiments of the present invention by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (7)

1.一种基于远程直接内存访问的队列页表管理方法,其特征在于,所述方法在远程直接内存访问网卡上执行,包括以下步骤:1. A queue page table management method based on remote direct memory access, characterized in that the method is executed on a remote direct memory access network card, comprising the following steps: 远程直接内存访问用户态驱动在用户态分配队列缓冲区,并创建一个队列;所述远程直接内存访问用户态驱动基于预设函数向内核态驱动发起所述队列的注册请求;The remote direct memory access user state driver allocates a queue buffer in the user state and creates a queue; the remote direct memory access user state driver initiates a registration request for the queue to the kernel state driver based on a preset function; 远程直接内存访问内核态驱动从操作系统内核获取分配给所述队列的物理页链表,并为所述队列分配一段内存作为队列页表;The remote direct memory access kernel state driver obtains the physical page linked list allocated to the queue from the operating system kernel, and allocates a section of memory for the queue as a queue page table; 所述远程直接内存访问内核态驱动遍历所述物理页链表中的每一项,并将每一项信息依次写入所述队列页表;The remote direct memory access kernel-mode driver traverses each item in the physical page linked list, and writes each item of information into the queue page table in sequence; 所述远程直接内存访问内核态驱动将所述队列页表的基地址写入队列寄存器,将队列页表指针写入所述队列寄存器,并设置初始值;The remote direct memory access kernel mode driver writes the base address of the queue page table into the queue register, writes the queue page table pointer into the queue register, and sets an initial value; 所述远程直接内存访问内核态驱动判断所述队列页表项数量;若大于等于两项,则将所述队列页表的第一项和第二项依次写入所述队列寄存器的第一缓存项和第二缓存项,并修改所述第一缓存项和所述第二缓存项的初始值;若小于两项,则将该项写入所述第一缓存项,并修改所述第一缓存项的初始值;所述远程直接内存访问内核态驱动设置所述队列寄存器缓存项指针的初始值;The remote direct memory access kernel-mode driver determines the number of queue page table entries; if it is greater than or equal to two, the first item and the second item of the queue page table are written into the first cache item and the second cache item of the queue register in sequence, and the initial values of the first cache item and the second cache item are modified; if it is less than two, the item is written into the first cache item, and the initial value of the first cache item is modified; the remote direct memory access kernel-mode driver sets the initial value of the queue register cache item pointer; 当当前所述缓存项指针指向所述第一缓存项,所述队列页表项大于等于两项时,所述远程直接内存访问网卡访问所述队列时,所述远程直接内存访问网卡基于所述第一缓存项的物理地址发起直接内存访问读取队列基本块;判断所述第一缓存项映射的物理页剩余长度;若所述剩余长度为一个队列基本块,则所述远程直接内存访问网卡发起队列页表项预取请求;并检查所述第二缓存项的有效位,若所述有效位为有效,则将当前所述缓存项指针指向所述第二缓存项,并初始化所述剩余长度;若所述剩余长度为一个队列基本块,则所述远程直接内存访问网卡基于当前所述缓存项指针发起队列页表项预取请求,以读取下一个页表项;返回基于所述队列页表项预取请求得到的预取页表项,使用所述预取页表项替换已经消耗完的页表项。When the current cache item pointer points to the first cache item and the queue page table item is greater than or equal to two items, when the remote direct memory access network card accesses the queue, the remote direct memory access network card initiates a direct memory access to read the queue basic block based on the physical address of the first cache item; determines the remaining length of the physical page mapped by the first cache item; if the remaining length is one queue basic block, the remote direct memory access network card initiates a queue page table item prefetch request; and checks the valid bit of the second cache item. If the valid bit is valid, the current cache item pointer is pointed to the second cache item and the remaining length is initialized; if the remaining length is one queue basic block, the remote direct memory access network card initiates a queue page table item prefetch request based on the current cache item pointer to read the next page table item; returns a prefetch page table item obtained based on the queue page table item prefetch request, and uses the prefetch page table item to replace the consumed page table item. 2.根据权利要求1所述的基于远程直接内存访问的队列页表管理方法,其特征在于,所述方法还包括:2. The queue page table management method based on remote direct memory access according to claim 1, characterized in that the method further comprises: 所述远程直接内存访问内核态驱动为所述队列分配一段连续且物理页对齐的内存作为队列页表。The remote direct memory access kernel mode driver allocates a continuous and physically page-aligned memory segment for the queue as a queue page table. 3.根据权利要求1所述的基于远程直接内存访问的队列页表管理方法,其特征在于,所述远程直接内存访问内核态驱动遍历所述物理页链表中的每一项,并将每一项信息依次写入所述队列页表,还包括:3. The queue page table management method based on remote direct memory access according to claim 1, characterized in that the remote direct memory access kernel state driver traverses each item in the physical page linked list and writes each item of information into the queue page table in sequence, and further comprises: 所述队列页表的每一项为8字节,低12位为该项映射的物理页数量,高52位为该项对应的初始物理页地址的高52位;Each entry in the queue page table is 8 bytes, the lower 12 bits are the number of physical pages mapped by the entry, and the upper 52 bits are the upper 52 bits of the initial physical page address corresponding to the entry; 若所述物理页链表的项映射超过4096个物理页,则拆分为多个队列页表项进行存储。If the entries of the physical page linked list map more than 4096 physical pages, they are split into multiple queue page table entries for storage. 4.根据权利要求1所述的基于远程直接内存访问的队列页表管理方法,其特征在于,所述方法还包括:4. The queue page table management method based on remote direct memory access according to claim 1, characterized in that the method further comprises: 所述远程直接内存访问内核态驱动基于PCIe协议标准将所述队列页表的基地址和所述队列页表指针写入所述队列寄存器。The remote direct memory access kernel mode driver writes the base address of the queue page table and the queue page table pointer into the queue register based on the PCIe protocol standard. 5.根据权利要求1所述的基于远程直接内存访问的队列页表管理方法,其特征在于,所述远程直接内存访问内核态驱动将所述队列页表的基地址写入队列寄存器,将队列页表指针写入所述队列寄存器,并设置初始值之后,所述方法还包括:5. The queue page table management method based on remote direct memory access according to claim 1, characterized in that after the remote direct memory access kernel state driver writes the base address of the queue page table into the queue register, writes the queue page table pointer into the queue register, and sets the initial value, the method further comprises: 所述远程直接内存访问内核态驱动向所述远程直接内存访问用户态驱动返回队列创建完成信息;The remote direct memory access kernel state driver returns queue creation completion information to the remote direct memory access user state driver; 所述远程直接内存访问用户态驱动接收所述队列创建完成信息,队列创建过程结束。The remote direct memory access user mode driver receives the queue creation completion information, and the queue creation process ends. 6.一种基于远程直接内存访问的队列页表管理装置,其特征在于,所述装置应用于远程直接内存访问网卡,所述装置被执行时实现如权利要求1至5中任一项所述基于远程直接内存访问的队列页表管理方法的步骤,所述装置包括:6. A queue page table management device based on remote direct memory access, characterized in that the device is applied to a remote direct memory access network card, and when the device is executed, the steps of the queue page table management method based on remote direct memory access according to any one of claims 1 to 5 are implemented, and the device comprises: 队列访问模块,用于实现各队列的读与写功能;Queue access module, used to implement the read and write functions of each queue; 队列信息存储模块,用于存储队列页表的基地址、队列页表指针、第一缓存项的有效位值、第二缓存项的有效位值以及缓存项指针;A queue information storage module, used to store a base address of a queue page table, a queue page table pointer, a valid bit value of a first cache item, a valid bit value of a second cache item, and a cache item pointer; 页表项缓存维护模块,用于接收并执行所述队列访问模块发起的队列页表项预取请求。The page table entry cache maintenance module is used to receive and execute the queue page table entry pre-fetch request initiated by the queue access module. 7.一种计算机可读存储介质,其上存储有计算机程序,其特征在于,该程序被处理器执行时实现如权利要求1至5中任一项所述方法的步骤。7. A computer-readable storage medium having a computer program stored thereon, wherein when the program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
CN202311641570.4A 2023-12-01 2023-12-01 A queue page table management method and device based on remote direct memory access Active CN117873921B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311641570.4A CN117873921B (en) 2023-12-01 2023-12-01 A queue page table management method and device based on remote direct memory access

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311641570.4A CN117873921B (en) 2023-12-01 2023-12-01 A queue page table management method and device based on remote direct memory access

Publications (2)

Publication Number Publication Date
CN117873921A CN117873921A (en) 2024-04-12
CN117873921B true CN117873921B (en) 2025-04-04

Family

ID=90587273

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311641570.4A Active CN117873921B (en) 2023-12-01 2023-12-01 A queue page table management method and device based on remote direct memory access

Country Status (1)

Country Link
CN (1) CN117873921B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119544648B (en) * 2024-11-07 2025-10-24 中汽创智科技有限公司 Method, device and electronic equipment for processing message communication
CN120434198B (en) * 2025-07-01 2025-10-21 浪潮(北京)电子信息产业有限公司 Network communication method, device, medium and program product

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114116524A (en) * 2020-08-25 2022-03-01 华为技术有限公司 Method and device for creating secure page table and accessing memory
CN115729880A (en) * 2022-11-28 2023-03-03 北京百度网讯科技有限公司 Data processing method, device, device and storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1280735C (en) * 2003-12-04 2006-10-18 中国科学院计算技术研究所 Initiator triggered remote memory access virtual-physical address conversion method
CN110647480B (en) * 2018-06-26 2023-10-13 华为技术有限公司 Data processing methods, remote direct access network cards and equipment
CN117171073A (en) * 2019-09-30 2023-12-05 华为技术有限公司 Method and computer apparatus for handling remote direct memory access requests
CN114201317B (en) * 2021-12-16 2024-02-02 北京有竹居网络技术有限公司 Data transmission method and device, storage medium and electronic equipment

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114116524A (en) * 2020-08-25 2022-03-01 华为技术有限公司 Method and device for creating secure page table and accessing memory
CN115729880A (en) * 2022-11-28 2023-03-03 北京百度网讯科技有限公司 Data processing method, device, device and storage medium

Also Published As

Publication number Publication date
CN117873921A (en) 2024-04-12

Similar Documents

Publication Publication Date Title
EP3647932B1 (en) Storage device processing stream data, system including the same, and operation method thereof
US9116800B2 (en) Block-based storage device with a memory-mapped interface
US8250254B2 (en) Offloading input/output (I/O) virtualization operations to a processor
US9785545B2 (en) Method and apparatus for providing dual memory access to non-volatile memory
US6542968B1 (en) System and method for managing data in an I/O cache
US9798655B2 (en) Managing a cache on storage devices supporting compression
EP3382559B1 (en) Apparatus, computer program product, and method to perform cache operations in a solid state drive
US7275123B2 (en) Method and apparatus for providing peer-to-peer data transfer within a computing environment
US8255593B2 (en) Direct memory access with striding across memory
JP3264319B2 (en) Bus bridge
CN117873921B (en) A queue page table management method and device based on remote direct memory access
CN110895446A (en) storage devices and systems
EP4439312A1 (en) Data storage method and system, storage access configuration method and related device
KR20190033284A (en) Method and system for transmitting data between storage devices over peer-to-peer(P2P) connections of PCI-express
US7103747B2 (en) Memory table and memory manager for use in managing memory
US7451259B2 (en) Method and apparatus for providing peer-to-peer data transfer within a computing environment
CN113296691B (en) Data processing system, method and device and electronic equipment
KR100758272B1 (en) How to Move a Dataless Copy File
EP3916567A1 (en) Method for processing page fault by processor
KR102725214B1 (en) Storage device processing stream data and computing system comprising the same and operation method thereof
US7702875B1 (en) System and method for memory compression
US8850159B2 (en) Method and system for latency optimized ATS usage
CN118260218A (en) Data processing method, device, chip and computer readable storage medium
US9424227B2 (en) Providing byte enables for peer-to-peer data transfer within a computing environment
JP2002024007A (en) Processor system

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
GR01 Patent grant
GR01 Patent grant