CN113608686B - Remote memory direct access method and related device - Google Patents

Remote memory direct access method and related device Download PDF

Info

Publication number
CN113608686B
CN113608686B CN202110744630.XA CN202110744630A CN113608686B CN 113608686 B CN113608686 B CN 113608686B CN 202110744630 A CN202110744630 A CN 202110744630A CN 113608686 B CN113608686 B CN 113608686B
Authority
CN
China
Prior art keywords
sliding window
memory
data
target
available space
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
CN202110744630.XA
Other languages
Chinese (zh)
Other versions
CN113608686A (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.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent 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 Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202110744630.XA priority Critical patent/CN113608686B/en
Publication of CN113608686A publication Critical patent/CN113608686A/en
Application granted granted Critical
Publication of CN113608686B publication Critical patent/CN113608686B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/064Management of blocks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The application discloses a control method and a related device for remote memory direct access, comprising the following steps: creating a sliding window according to the information of the memory pool of the server; the sliding window stores the ID of the memory block in the memory pool, and the size of the available space of the sliding window is equal to the size of the idle memory block in the memory pool; when writing data, determining a target memory block according to the data to be written and the available space of the sliding window, and reducing the available space of the sliding window after writing the data to be written into the target memory block; when reading data, sending a read request to a server side so that the server side determines a target memory block according to target read data designated by the read request and the available space of the sliding window, and copying the target read data to the target memory block; and reducing the available space of the sliding window after the target read data is read from the target memory block. The method can reduce the exchange times of the memory state and improve the unilateral operation transmission efficiency.

Description

Remote memory direct access method and related device
Technical Field
The application relates to the technical field of memory access, in particular to a remote memory direct access method; and to a remote memory direct access apparatus, device and computer readable storage medium.
Background
RDMA (Remote-Direct Memory Access, remote memory direct access) is a network transmission technology for directly accessing a Remote computer storage area, and can quickly copy data from a local system to a Remote system memory, only occupies unilateral CPU resources in the transmission process, bypasses an operating system kernel protocol stack, and can remarkably improve the data transmission performance. RDMA technology is applied to various business scenes, particularly for a distributed storage system with very high bandwidth and time delay requirements, an RDMA network is adopted to transmit a large amount of file data, the performance bottleneck of a traditional network is bypassed, and the performance of novel hardware such as NVMe SSD, PM and the like can be fully exerted. Single-sided operation is key to achieving RDMA protocol performance advantages, requiring two conditions: firstly, a target address is obtained, and secondly, the availability of the target memory state is confirmed. RDMA remote read memory is premised on remote memory update completion, RDMA remote write memory is premised on target memory being coverable.
However, the current scheme mostly adopts a scheme of multiplexing memory pools, taking remote write operation as an example, the execution flow is as follows: the client is linked with the server according to the IP address, and the server forms a memory pool through a plurality of sections of memories. And the client initiates a memory allocation request to the server according to the service requirement. The server allocates a memory block from the memory pool, and the response message contains address and primary key information. And the client executes a write-with-imm instruction to write data into the memory of the server. The server processes the data in the memory according to the service requirement, and the memory restores the usable state. The client re-executes the operation that the client initiates a memory allocation request to the server according to the service requirement. Before the client writes data each time, the client must apply for the free memory from the service port. Thus, in theory, only write instructions that require single-sided CPU involvement are downgraded to multiple interactions that both CPUs are involved, which is contrary to the initiative of RDMA.
Therefore, how to reduce the number of memory state exchanges is a technical problem to be solved by those skilled in the art.
Disclosure of Invention
The purpose of the application is to provide a remote memory direct access method, which can reduce the exchange times of memory states, improve the unilateral operation transmission efficiency and increase the usability of an RDMA network. Another object of the present application is to provide a remote memory direct access device, apparatus and computer readable storage medium, which have the above technical effects.
In order to solve the above technical problems, the present application provides a control method for direct access of a remote memory, including:
creating a sliding window according to the information of the memory pool of the server; the sliding window stores the ID of the memory block in the memory pool, and the size of the available space of the sliding window is equal to the size of the idle memory block in the memory pool;
when writing data, determining a target memory block according to the data to be written and the available space of the sliding window, and reducing the available space of the sliding window after writing the data to be written into the target memory block;
when data is read, a read request is sent to the server side, so that the server side determines a target memory block according to target read data designated by the read request and the available space of the sliding window, and copies the target read data to the target memory block; and reducing the available space of the sliding window after the target read data is read from the target memory block.
Optionally, the sliding window is a circular linked list.
Optionally, the narrowing the available space of the sliding window includes:
and advancing the tail of the circular linked list by X units, wherein X is equal to the number of the idle memory blocks reduced in the memory pool.
Optionally, the determining the target memory block according to the data to be written and the available space of the sliding window includes:
calculating the ratio of the data to be written to the unit length of the memory blocks in the memory pool, and rounding the ratio upwards;
comparing the upward rounding result with the size of the available space, and selecting the number of target memory blocks of the upward rounding result and the minimum value of the available space;
and taking the number of idle memory blocks as target memory blocks.
Optionally, the method further comprises:
when writing data, receiving an Ack message sent by the server, and increasing the available space of the sliding window according to the Ack message;
and when data is read, sending an Ack message to the server side so that the server side increases the available space of the sliding window according to the Ack message.
Optionally, the increasing the available space of the sliding window includes:
and advancing the head of the circular linked list by Y units, wherein Y is equal to the number of the increased idle memory blocks.
Optionally, the sending the Ack message to the server includes:
and sending an Ack message to the server according to the Nagle algorithm.
In order to solve the above technical problem, the present application further provides a control device for direct access of a remote memory, including:
the creation module is used for creating a sliding window according to the information of the memory pool of the server; the sliding window stores the ID of the memory block in the memory pool, and the size of the available space of the sliding window is equal to the size of the idle memory block in the memory pool;
the data writing module is used for determining a target memory block according to the data to be written and the available space of the sliding window when writing data, and reducing the available space of the sliding window after writing the data to be written into the target memory block;
the data reading module is used for sending a read request to the server side when reading data, so that the server side determines a target memory block according to target read data designated by the read request and the available space of the sliding window, and copies the target read data to the target memory block; and reducing the available space of the sliding window after the target read data is read from the target memory block.
In order to solve the above technical problem, the present application further provides a control device for direct access of a remote memory, including:
a memory for storing a computer program;
a processor for implementing the steps of the method for controlling direct access to a remote memory as claimed in any one of the preceding claims when executing the computer program.
To solve the above technical problem, the present application further provides a computer readable storage medium, where a computer program is stored, where the computer program, when executed by a processor, implements the steps of the method for controlling remote memory direct access as described in any one of the above.
The control method for remote memory direct access provided by the application comprises the following steps: creating a sliding window according to the information of the memory pool of the server; the sliding window stores the ID of the memory block in the memory pool, and the size of the available space of the sliding window is equal to the size of the idle memory block in the memory pool; when writing data, determining a target memory block according to the data to be written and the available space of the sliding window, and reducing the available space of the sliding window after writing the data to be written into the target memory block; when data is read, a read request is sent to the server side, so that the server side determines a target memory block according to target read data designated by the read request and the available space of the sliding window, and copies the target read data to the target memory block; and reducing the available space of the sliding window after the target read data is read from the target memory block.
Therefore, according to the remote memory direct access control method, the sliding window is set, the IDs of the memory blocks in the memory pool are stored in the sliding window, and the available space of the sliding window is equal to the number of the memory blocks in the memory pool. Whether the data is read from the memory pool or written into the memory pool, the available space of the sliding window is correspondingly reduced as long as the free memory blocks in the memory pool are reduced, so that the reading operation or the writing operation can be performed according to the IDs of the memory blocks stored in the sliding window as long as the sliding window has enough available space, the memory state does not need to be frequently exchanged with the server side, the exchange times of the memory state can be greatly reduced, the transmission efficiency of single-side operation is improved, and the usability of an RDMA network is improved.
The control device, the equipment and the computer readable storage medium for remote memory direct access provided by the application have the technical effects.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following description will briefly explain the drawings needed in the prior art and embodiments, and it is obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings can be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flow chart of a control method for remote memory direct access according to an embodiment of the present application;
FIG. 2 is a schematic diagram of memory pool information according to an embodiment of the present disclosure;
fig. 3 is a schematic diagram of a remote memory direct access control device according to an embodiment of the present application;
fig. 4 is a schematic diagram of a remote memory direct access control device according to an embodiment of the present application.
Detailed Description
The core of the application is to provide a remote memory direct access method which can reduce the exchange times of memory states. Another core of the present application is to provide a remote memory direct access device, apparatus, and computer readable storage medium, which all have the above technical effects.
For the purposes of making the objects, technical solutions and advantages of the embodiments of the present application more clear, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
Referring to fig. 1, fig. 1 is a flowchart of a remote memory direct access method according to an embodiment of the present application, and referring to fig. 1, the method includes:
s101: creating a sliding window according to the information of the memory pool of the server; the sliding window stores the ID of the memory block in the memory pool, and the size of the available space of the sliding window is equal to the size of the idle memory block in the memory pool;
specifically, an RC (Reliable Connection ) connection is first established between the client and the server, so that after the RC connection is established between the client and the server, the client and the server support all RDMA operation instructions. After establishing RC connection, the client side sends recv instructions to the server side. The server allocates a memory pool supporting remote reading and writing, sends a send instruction to the client, and sends information of the memory pool to the client. Referring to fig. 2, the information of the memory pool includes the size of the memory pool, that is, the number of memory blocks constituting the memory pool, the unit length of the memory blocks, and the address and key value of each memory block.
After receiving the information of the memory pool sent by the server, the client creates a sliding window according to the information of the memory pool. The size of the sliding window is equal to the size of the memory pool. The size of the memory pool is M (i.e., it is composed of M memory blocks), and the size of the sliding window is M. The size of the available space of the sliding window is equal to the size of the empty memory blocks in the memory pool. And if the size of the hollow memory block in the memory pool is N (N is less than or equal to M), the size of the available space of the sliding window is equal to N. When each memory block in the memory pool is an idle memory block, the size of the available space of the sliding window is the size of the sliding window. In addition, the sliding window holds the ID of the memory block in the memory pool, so that the client can directly specify the memory block to be written or read with data according to the ID.
In a specific embodiment, the sliding window is a circular linked list.
Specifically, in this embodiment, the sliding window is specifically in the form of a circular linked list. Each node of the circular linked list respectively stores the ID value of each memory block: [1, addr ]. addr is 1 to M.
S102: when writing data, determining a target memory block according to the data to be written and the available space of the sliding window, and reducing the available space of the sliding window after writing the data to be written into the target memory block;
specifically, when the remote writing process is executed, firstly, according to the data to be written and the available space of the sliding window, the memory block to be actually written with the data is determined, namely, the target memory block is determined. Further, after the target memory block is determined, data is written into the target memory block of the server through the cyclic execution of the write-with-imm instruction. The immediate of each write-with-imm instruction is the ID value of the memory block. And each time data is successfully written into one memory block, the available space of the sliding window is reduced by one unit, and x memory blocks are written, and the available space of the sliding window is reduced by x units.
In a specific embodiment, the determining the target memory block according to the data to be written and the available space of the sliding window includes: calculating the ratio of the data to be written to the unit length of the memory blocks in the memory pool, and rounding the ratio upwards; comparing the upward rounding result with the size of the available space, and selecting the number of target memory blocks of the upward rounding result and the minimum value of the available space; and taking the number of idle memory blocks as target memory blocks.
I.e. according to X 1 =min(ceil(L 1 And/m), r) to obtain the number of memory blocks to be written with data, and then taking the idle memory blocks of the number as target memory blocks. L (L) 1 Represents the length of the data to be written, m represents the unit length of the memory block, r represents the available space of the sliding window, X 1 The number of target memory blocks determined by the client when writing data is represented.
S103: when data is read, a read request is sent to the server side, so that the server side determines a target memory block according to target read data designated by the read request and the available space of the sliding window, and copies the target read data to the target memory block; and reducing the available space of the sliding window after the target read data is read from the target memory block.
Specifically, when executing the remote data reading flow, the client first sends a read request to the server. And the server determines a target memory block according to the data to be read by the client, namely target read data and the available space of the sliding window (the related information of the sliding window created by the client can be synchronized to the server), and then writes the data to be read by the client into the target memory block for the client to read the data from the target memory block. The client reads data from the target memory block of the server through circularly executing the read-with-imm instruction. The immediate of each read-with-imm instruction is the ID value of the memory block. And if the data is successfully read from one memory block, the available space of the sliding window is reduced by one unit, and if the x memory blocks are read, the available space of the sliding window is reduced by x units.
The method for determining the target memory block by the server according to the target read data specified by the read request and the available space of the sliding window is as follows: according to X 2 =min(ceil(L 2 /m),r), obtaining the number of memory blocks of the data to be copied, and further copying the target read data into the idle memory blocks of the number. L (L) 2 Represents the length of target read data, m represents the unit length of a memory block, r represents the available space of a sliding window, X 2 And the number of the target memory blocks determined by the server side during data reading is represented.
The steps S102 and S103 are in parallel relation, and only the step S102 may be performed, only the step S103 may be performed, or both the step S102 and the step S103 may be performed. In the case of performing both step S102 and step S103, the order of steps S102 and S103 is not limited, and step S102 may be performed first and then step S103 may be performed, or step S103 may be performed first and then step S102 may be performed.
Further, corresponding to the embodiment in which the sliding window is a circular linked list, the manner of reducing the available space of the sliding window may be: and advancing the tail of the circular linked list by X units, wherein X is equal to the number of the idle memory blocks reduced in the memory pool.
It will be appreciated that tail forward of a circular linked list refers to the tail of the circular linked list moving in the head direction.
Further, on the basis of the above embodiment, the method further includes:
when writing data, receiving an Ack message sent by the server, and increasing the available space of the sliding window according to the Ack message;
and when data is read, sending an Ack message to the server side so that the server side increases the available space of the sliding window according to the Ack message.
Specifically, when writing data, after the client writes the data to be written into the target memory block, the service logic processing flow of the server will process the data in the target memory block, and after the data in the target memory block is used up, the target memory block is restored to an idle state, and at this time, the server further sends an Ack message, that is, a confirmation message, to the server. The confirmation message indicates the number of the memory blocks restored to the idle state, and then the client increases the available space of the sliding window after receiving the Ack message sent by the server, wherein the size of the increased available space is equal to the size of the memory blocks restored to the idle state.
When data is read, the target read data is written into the target memory block at the server side, and after the target read data is successfully read from the target memory block by the client side, the client side sends an Ack message to the server side so as to inform the server side that the target read data is successfully read. After the client reads the data from the target memory block, the target memory block is restored to an idle state. Furthermore, the server increases the available space of the sliding window, and the size of the increased available space is equal to the size of the memory block restored to the idle state.
Corresponding to the embodiment that the sliding window is a circular linked list, the manner of increasing the available space of the sliding window may be: and advancing the head of the circular linked list by Y units, wherein Y is equal to the number of the increased idle memory blocks.
In addition, the method for sending the Ack message to the server may be: and sending an Ack message to the server according to the Nagle algorithm.
In order to further improve the transmission efficiency of single-side operation, in this embodiment, an Ack message is sent to the server according to the Nagle algorithm. Specifically, the client sends an Ack message to the server when the following conditions are satisfied:
TimeWait>=MAT||SegAvail>=MAS;
wherein TimeWait represents the current memory block idle waiting time, MAT represents the memory block idle time threshold, segAvail represents the total number of current idle memory blocks, MAS represents the idle memory block number threshold.
Of course, in addition to sending an Ack message to the server according to the Nagle algorithm, an Ack message may also be sent to the server according to the NoDelay algorithm, that is, an Ack message whose value is the number of memory blocks restored to the idle state may be immediately sent to the server.
Likewise, for the server, the method that the server sends the Ack to the client may also be to send an Ack message to the client according to Nagle algorithm.
Further, in order to reduce the cost of packet loss retransmission, a smaller length of data may be written each time when writing data.
When the available space of the sliding window is zero, the client pauses the writing operation and the reading operation. If the available space of the sliding window is exhausted for a plurality of times, the size of the memory pool can be increased, and the size of the sliding window is correspondingly increased.
In summary, according to the remote memory direct access control method provided by the application, a sliding window is set, the sliding window stores the IDs of the memory blocks in the memory pool, and the available space of the sliding window is equal to the number of the memory blocks in the memory pool. Whether the data is read from the memory pool or written into the memory pool, the available space of the sliding window is correspondingly reduced as long as the free memory blocks in the memory pool are reduced, so that the reading operation or the writing operation can be performed according to the IDs of the memory blocks stored in the sliding window as long as the sliding window has enough available space, the memory state does not need to be frequently exchanged with the server side, the exchange times of the memory state can be greatly reduced, the transmission efficiency of single-side operation is improved, and the usability of an RDMA network is improved.
The application also provides a control device for direct access of the remote memory, and the device described below can be referred to correspondingly with the method described above. Referring to fig. 3, fig. 3 is a schematic diagram of a remote memory direct access control device according to an embodiment of the present application, and in combination with fig. 3, the device includes:
the creation module 10 is used for creating a sliding window according to the information of the memory pool of the server; the sliding window stores the ID of the memory block in the memory pool, and the size of the available space of the sliding window is equal to the size of the idle memory block in the memory pool;
the data writing module 20 is configured to determine a target memory block according to the data to be written and the available space of the sliding window when writing data, and reduce the available space of the sliding window after writing the data to be written into the target memory block;
the data reading module 30 is configured to send a read request to the server when reading data, so that the server determines a target memory block according to target read data specified by the read request and an available space of the sliding window, and copies the target read data to the target memory block; and reducing the available space of the sliding window after the target read data is read from the target memory block.
Based on the above embodiment, optionally, the sliding window is a circular linked list.
Based on the above embodiment, optionally, the write data module 20 is specifically configured to:
and advancing the tail of the circular linked list by X units, wherein X is equal to the number of the idle memory blocks reduced in the memory pool.
Based on the above embodiment, optionally, the write data module 20 is specifically configured to:
calculating the ratio of the data to be written to the unit length of the memory blocks in the memory pool, and rounding the ratio upwards;
comparing the upward rounding result with the size of the available space, and selecting the number of target memory blocks of the upward rounding result and the minimum value of the available space;
and taking the number of idle memory blocks as target memory blocks.
On the basis of the above embodiment, optionally, the method further includes:
the receiving module is used for receiving the Ack message sent by the server side when writing data, and increasing the available space of the sliding window according to the Ack message;
and the sending module is used for sending an Ack message to the server side when reading data, so that the server side increases the available space of the sliding window according to the Ack message.
On the basis of the above embodiment, optionally, the receiving module is specifically configured to:
and advancing the head of the circular linked list by Y units, wherein Y is equal to the number of the increased idle memory blocks.
On the basis of the above embodiment, optionally, the sending module is specifically configured to:
and sending an Ack message to the server according to the Nagle algorithm.
According to the remote memory direct access control device, the sliding window is set, IDs of memory blocks in the memory pool are stored in the sliding window, and the available space of the sliding window is equal to the number of the memory blocks in the memory pool. Whether the data is read from the memory pool or written into the memory pool, the available space of the sliding window is correspondingly reduced as long as the free memory blocks in the memory pool are reduced, so that the reading operation or the writing operation can be performed according to the IDs of the memory blocks stored in the sliding window as long as the sliding window has enough available space, the memory state does not need to be frequently exchanged with the server side, the exchange times of the memory state can be greatly reduced, the transmission efficiency of single-side operation is improved, and the usability of an RDMA network is improved.
The present application also provides a remote memory direct access control device, which is shown with reference to fig. 4, and includes a memory 1 and a processor 2.
A memory 1 for storing a computer program;
a processor 2 for executing a computer program to perform the steps of:
creating a sliding window according to the information of the memory pool of the server; the sliding window stores the ID of the memory block in the memory pool, and the size of the available space of the sliding window is equal to the size of the idle memory block in the memory pool; when writing data, determining a target memory block according to the data to be written and the available space of the sliding window, and reducing the available space of the sliding window after writing the data to be written into the target memory block; when data is read, a read request is sent to the server side, so that the server side determines a target memory block according to target read data designated by the read request and the available space of the sliding window, and copies the target read data to the target memory block; and reducing the available space of the sliding window after the target read data is read from the target memory block.
For the description of the apparatus provided in the present application, reference is made to the above method embodiments, and the description is omitted herein.
The present application also provides a computer readable storage medium having a computer program stored thereon, which when executed by a processor, performs the steps of:
creating a sliding window according to the information of the memory pool of the server; the sliding window stores the ID of the memory block in the memory pool, and the size of the available space of the sliding window is equal to the size of the idle memory block in the memory pool; when writing data, determining a target memory block according to the data to be written and the available space of the sliding window, and reducing the available space of the sliding window after writing the data to be written into the target memory block; when data is read, a read request is sent to the server side, so that the server side determines a target memory block according to target read data designated by the read request and the available space of the sliding window, and copies the target read data to the target memory block; and reducing the available space of the sliding window after the target read data is read from the target memory block.
The computer readable storage medium may include: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
For the description of the computer-readable storage medium provided in the present application, reference is made to the above method embodiments, and the description is omitted herein.
In the description, each embodiment is described in a progressive manner, and each embodiment is mainly described by the differences from other embodiments, so that the same similar parts among the embodiments are mutually referred. For the apparatus, device and computer readable storage medium of the embodiment disclosure, since it corresponds to the method of the embodiment disclosure, the description is relatively simple, and the relevant points refer to the description of the method section.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative elements and steps are described above generally in terms of functionality in order to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. 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 application.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. The software modules may be disposed in Random Access Memory (RAM), memory, read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The method, apparatus, device and computer readable storage medium for controlling remote memory direct access provided in the present application are described in detail above. Specific examples are set forth herein to illustrate the principles and embodiments of the present application, and the description of the examples above is only intended to assist in understanding the methods of the present application and their core ideas. It should be noted that it would be obvious to those skilled in the art that various improvements and modifications can be made to the present application without departing from the principles of the present application, and such improvements and modifications fall within the scope of the claims of the present application.

Claims (7)

1. The control method for the direct access of the remote memory is characterized by comprising the following steps:
creating a sliding window according to the information of the memory pool of the server; the sliding window stores the ID of the memory block in the memory pool, and the size of the available space of the sliding window is equal to the size of the idle memory block in the memory pool; the information of the memory pool comprises the number of memory blocks forming the memory pool, the unit length of the memory blocks and the address and key value of each memory block;
when writing data, determining a target memory block according to the data to be written and the available space of the sliding window, and reducing the available space of the sliding window after writing the data to be written into the target memory block;
when data is read, a read request is sent to the server side, so that the server side determines a target memory block according to target read data designated by the read request and the available space of the sliding window, and copies the target read data to the target memory block; when the target read data is read from the target memory block, the available space of the sliding window is reduced;
the sliding window is a circular linked list;
the narrowing the available space of the sliding window includes:
advancing the tail of the circular linked list by X units, wherein X is equal to the number of the idle memory blocks reduced in the memory pool;
further comprises:
when writing data, receiving an Ack message sent by the server, and increasing the available space of the sliding window according to the Ack message; after the data in the target memory block is used, the client sends the Ack message to the server, wherein the Ack message indicates the number of memory blocks restored to an idle state;
when data is read, an Ack message is sent to the server side, so that the server side increases the available space of the sliding window according to the Ack message; and after the client side successfully reads the target read data from the target memory block, sending an Ack message to the server side.
2. The control method according to claim 1, wherein the determining the target memory block according to the data to be written and the available space of the sliding window includes:
calculating the ratio of the data to be written to the unit length of the memory blocks in the memory pool, and rounding the ratio upwards;
comparing the upward rounding result with the size of the available space, and selecting the number of target memory blocks of the upward rounding result and the minimum value of the available space;
and taking the number of idle memory blocks as target memory blocks.
3. The control method of claim 1, wherein the increasing the available space of the sliding window comprises:
and advancing the head of the circular linked list by Y units, wherein Y is equal to the number of the increased idle memory blocks.
4. The control method according to claim 1, wherein the sending the Ack message to the server includes:
and sending an Ack message to the server according to the Nagle algorithm.
5. A remote memory direct access control device, comprising:
the creation module is used for creating a sliding window according to the information of the memory pool of the server; the sliding window stores the ID of the memory block in the memory pool, and the size of the available space of the sliding window is equal to the size of the idle memory block in the memory pool; the information of the memory pool comprises the number of memory blocks forming the memory pool, the unit length of the memory blocks and the address and key value of each memory block;
the data writing module is used for determining a target memory block according to the data to be written and the available space of the sliding window when writing data, and reducing the available space of the sliding window after writing the data to be written into the target memory block;
the data reading module is used for sending a read request to the server side when reading data, so that the server side determines a target memory block according to target read data designated by the read request and the available space of the sliding window, and copies the target read data to the target memory block; when the target read data is read from the target memory block, the available space of the sliding window is reduced;
the sliding window is a circular linked list;
the data writing module is specifically configured to:
advancing the tail of the circular linked list by X units, wherein X is equal to the number of the idle memory blocks reduced in the memory pool;
further comprises:
the receiving module is used for receiving the Ack message sent by the server side when writing data, and increasing the available space of the sliding window according to the Ack message; after the data in the target memory block is used, the client sends the Ack message to the server, wherein the Ack message indicates the number of memory blocks restored to an idle state;
the sending module is used for sending an Ack message to the server when reading data, so that the server increases the available space of the sliding window according to the Ack message; after the client side successfully reads the target read data from the target memory block, the sending module sends an Ack message to the server side.
6. A remote memory direct access control device, comprising:
a memory for storing a computer program;
a processor for implementing the steps of the remote memory direct access control method according to any one of claims 1 to 4 when executing the computer program.
7. A computer readable storage medium, characterized in that the computer readable storage medium has stored thereon a computer program which, when executed by a processor, implements the steps of the remote memory direct access control method according to any of claims 1 to 4.
CN202110744630.XA 2021-06-30 2021-06-30 Remote memory direct access method and related device Active CN113608686B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110744630.XA CN113608686B (en) 2021-06-30 2021-06-30 Remote memory direct access method and related device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110744630.XA CN113608686B (en) 2021-06-30 2021-06-30 Remote memory direct access method and related device

Publications (2)

Publication Number Publication Date
CN113608686A CN113608686A (en) 2021-11-05
CN113608686B true CN113608686B (en) 2023-05-26

Family

ID=78337141

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110744630.XA Active CN113608686B (en) 2021-06-30 2021-06-30 Remote memory direct access method and related device

Country Status (1)

Country Link
CN (1) CN113608686B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104484295A (en) * 2014-12-16 2015-04-01 中国人民解放军国防科学技术大学 Receiver sliding window-based data transmission method in parallel computer system
CN107104902A (en) * 2017-04-05 2017-08-29 广东浪潮大数据研究有限公司 A kind of method, relevant apparatus and the system of RDMA data transfers
CN107493329A (en) * 2017-08-15 2017-12-19 诸葛晴凤 A kind of remote document access method of distributed memory file system

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7031928B1 (en) * 2000-10-02 2006-04-18 Hewlett-Packard Development Company, L.P. Method and system for throttling I/O request servicing on behalf of an I/O request generator to prevent monopolization of a storage device by the I/O request generator
CN100473028C (en) * 2002-12-02 2009-03-25 中兴通讯股份有限公司 A internal memory management method
CN102255794B (en) * 2010-05-17 2014-07-30 塔塔咨询服务有限公司 Remote message transmit-receive handling capacity and waiting time shortening system and method
CN103645994A (en) * 2013-11-05 2014-03-19 华为技术有限公司 Data processing method and device
US9311044B2 (en) * 2013-12-04 2016-04-12 Oracle International Corporation System and method for supporting efficient buffer usage with a single external memory interface
CN109918203A (en) * 2019-03-18 2019-06-21 深圳市网心科技有限公司 Access server memory management optimization method, access server and communication system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104484295A (en) * 2014-12-16 2015-04-01 中国人民解放军国防科学技术大学 Receiver sliding window-based data transmission method in parallel computer system
CN107104902A (en) * 2017-04-05 2017-08-29 广东浪潮大数据研究有限公司 A kind of method, relevant apparatus and the system of RDMA data transfers
CN107493329A (en) * 2017-08-15 2017-12-19 诸葛晴凤 A kind of remote document access method of distributed memory file system

Also Published As

Publication number Publication date
CN113608686A (en) 2021-11-05

Similar Documents

Publication Publication Date Title
EP3873062A1 (en) Data transmission method, system, and proxy server
CN112948318B (en) RDMA-based data transmission method and device under Linux operating system
CN107608632B (en) Communication method, device and system of distributed storage cluster
JP2016529575A (en) Hard disk and data processing method
US6826622B2 (en) Method of transferring data between memories of computers
CN113422793A (en) Data transmission method and device, electronic equipment and computer storage medium
US20210392187A1 (en) Data transmission and network interface controller
CN113608686B (en) Remote memory direct access method and related device
JP2008544371A (en) How to handle lock-related inconsistencies
CN111611068B (en) Data writing method in distributed system, server and client
CN109992213B (en) Data deleting method, system, device and computer readable storage medium
CN109992447A (en) Data copy method, device and storage medium
WO2020253407A1 (en) Method and device for executing write operation and read operation
CN111274176B (en) Information processing method, electronic equipment, system and storage medium
CN113641604A (en) Data transmission method and system
CN113204517A (en) Inter-core sharing method of Ethernet controller special for electric power
CN116069262B (en) Distributed storage unloading method and device, electronic equipment and storage medium
CN114490463A (en) Method and network equipment for executing write request in order-preserving manner
CN112104729A (en) Storage system and caching method thereof
CN112003860B (en) Memory management method, system and medium suitable for remote direct memory access
CN114827017B (en) Communication method and device of Kafka cluster, electronic equipment and storage medium
CN114153401A (en) Remote persistence method and remote persistence system for data of sending end or receiving end
CN114157529B (en) Distributed data transmission system and method
CN109165099B (en) Electronic equipment, memory copying method and device
CN116149575B (en) Server-oriented non-perception computing disk redundant array writing method and 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