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

Remote memory direct access method and related device Download PDF

Info

Publication number
CN113608686A
CN113608686A CN202110744630.XA CN202110744630A CN113608686A CN 113608686 A CN113608686 A CN 113608686A CN 202110744630 A CN202110744630 A CN 202110744630A CN 113608686 A CN113608686 A CN 113608686A
Authority
CN
China
Prior art keywords
sliding window
data
memory
available space
target
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.)
Granted
Application number
CN202110744630.XA
Other languages
Chinese (zh)
Other versions
CN113608686B (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

Landscapes

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

Abstract

The application discloses a control method and a related device for remote direct memory access, which comprise 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 data is written, 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 the data to be written is written into the target memory block; when reading data, sending a reading request to the server side so that the server side determines a target memory block according to target reading data specified by the reading request and available space of the sliding window, and copying the target reading data to the target memory block; and after reading the target read data from the target memory block, reducing the available space of the sliding window. The method can reduce the exchange times of the memory states and improve the transmission efficiency of unilateral operation.

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 direct access method for a remote memory; it also relates to a remote memory direct access device, an apparatus and a computer readable storage medium.
Background
RDMA (Remote-Direct Memory Access) is a network transmission technology for directly accessing a Remote computer storage area, can quickly copy data from a local system to a Remote system storage, only occupies unilateral CPU resources in the transmission process, and bypasses an operating system kernel protocol stack, thereby being capable of obviously improving the data transmission performance. The RDMA technology is applied to various service scenes, particularly for a distributed storage system with high requirements on bandwidth and time delay, the RDMA network is adopted to transmit a large amount of file data, the performance bottleneck of the traditional network is bypassed, and the performance of novel hardware such as NVMe SSD and PM can be fully exerted. Unilateral operation is the key to achieving the performance advantage of RDMA protocols, and requires two conditions: first, the target address is obtained, and then the target memory state is confirmed to be available. RDMA remote memory read presupposes that the remote memory update is completed, and RDMA remote memory write presupposes that the target memory can be covered.
However, in the current scheme, a scheme of multiplexing a memory pool is mostly adopted, and 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 side initiates a memory allocation request to the server side according to the service requirement. The server allocates a memory block from the memory pool, and the response message comprises an address and primary key information. The client executes the write-with-imm instruction to write data into the server memory. And the server side processes the data in the memory according to the service requirement, and the memory recovers the available state. And the client re-executes the operation that the client initiates the memory allocation request to the server according to the service requirement. Before writing data each time, the client must apply for a free memory from the service port. Thus, theoretically, only a single CPU participating write instruction would be required to demote to multiple interactions with both CPUs participating, which is contrary to the RDMA initiative.
Therefore, how to reduce the number of times of memory state exchange has become an urgent technical problem to be solved by those skilled in the art.
Disclosure of Invention
The application aims to provide a remote direct memory 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. It is another object of the present application to provide a remote direct memory access device, an apparatus and a computer readable storage medium, all of which have the above technical effects.
In order to solve the above technical problem, the present application provides a method for controlling direct access to 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 data is written, 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 the data to be written is written into the target memory block;
when reading data, sending a read request to the server, so that the server determines a target memory block according to target read data specified by the read request and the available space of the sliding window, and copying the target read data to the target memory block; and after the target read data is read from the target memory block, reducing the available space of the sliding window.
Optionally, the sliding window is a circular linked list.
Optionally, the narrowing the available space of the sliding window includes:
and moving the tail part of the circular linked list forward by X units, wherein X is equal to the number of the idle memory blocks reduced in the memory pool.
Optionally, the determining a 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 block in the memory pool, and rounding the ratio upwards;
comparing the upward rounding result with the size of the available space, and selecting the minimum value of the upward rounding result and the available space to obtain the number of the target memory blocks;
and taking the idle memory blocks with the number as target memory blocks.
Optionally, the method further includes:
when data is written, 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, so that the server 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 packet to the server includes:
and sending an Ack message to the server according to a Nagle algorithm.
In order to solve the above technical problem, the present application further provides a control device for direct access to a remote memory, including:
the creating 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 data to be written and the available space of the sliding window when data is written, and reducing the available space of the sliding window after the data to be written is written into the target memory block;
the data reading module is used for sending a read request to the server when data is read, so that the server determines a target memory block according to target read data specified by the read request and the available space of the sliding window, and copies the target read data to the target memory block; and after the target read data is read from the target memory block, reducing the available space of the sliding window.
In order to solve the above technical problem, the present application further provides a control device for direct remote memory access, including:
a memory for storing a computer program;
a processor for implementing the steps of the method for controlling direct remote memory access as described in any one of the above when executing the computer program.
In order to solve the above technical problem, the present application further provides a computer-readable storage medium, on which a computer program is stored, and the computer program, when executed by a processor, implements the steps of the method for controlling direct remote memory access according to any one of the above.
The control method for the direct access of the remote memory 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 data is written, 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 the data to be written is written into the target memory block; when reading data, sending a read request to the server, so that the server determines a target memory block according to target read data specified by the read request and the available space of the sliding window, and copying the target read data to the target memory block; and after the target read data is read from the target memory block, reducing the available space of the sliding window.
Therefore, the control method for the direct access of the remote memory provided by the application is provided with the sliding window, the sliding window stores the ID of the memory blocks in the memory pool, and the available space of the sliding window is equal to the number of the idle memory blocks in the memory pool. No matter data is read from the memory pool or written into the memory pool, as long as the free memory blocks in the memory pool are reduced, the available space of the sliding window is correspondingly reduced, so that as long as the sliding window has enough available space, reading operation or writing operation can be carried out according to the ID of the memory blocks stored in the sliding window, and the memory state does not need to be frequently exchanged with the server, thereby greatly reducing the exchange times of the memory state, improving the transmission efficiency of unilateral operation, and increasing the usability of the RDMA network.
The control device, the equipment and the computer readable storage medium for the remote direct memory access have the technical effects.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the prior art and the embodiments are briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
Fig. 1 is a schematic flowchart of a method for controlling direct remote memory access according to an embodiment of the present disclosure;
fig. 2 is a schematic diagram of memory pool information provided in an embodiment of the present application;
fig. 3 is a schematic diagram of a control apparatus for direct remote memory access according to an embodiment of the present disclosure;
fig. 4 is a schematic diagram of a control device for direct remote memory access according to an embodiment of the present disclosure.
Detailed Description
The core of the application is to provide a remote direct memory access method which can reduce the exchange times of memory states. At the other core of the present application, a remote direct memory access apparatus, a device and a computer-readable storage medium are provided, which all have the above technical effects.
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in 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 obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Referring to fig. 1, fig. 1 is a schematic flow chart of a remote direct memory 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 commands. After the RC connection is established, the client sends a recv instruction to the server. And the server allocates a memory pool supporting remote reading and writing, sends a send instruction to the client and sends the 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.
And 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. And the size of the sliding window is equal to that of the memory pool. The size of the memory pool is M (i.e., the memory pool 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 idle memory blocks in the memory pool. The size of the idle memory block in the memory pool is N (N is less than or equal to M), and the size of the available space of the sliding window is equal to N. When all the memory blocks in the memory pool are idle memory blocks, the size of the available space of the sliding window is the size of the sliding window. In addition, the sliding window stores 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 according to the ID.
In a specific embodiment, the sliding window is a circular linked list.
Specifically, in this embodiment, the form of the sliding window is specifically 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-M.
S102: when data is written, 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 the data to be written is written into the target memory block;
specifically, when the remote write process is executed, the memory block to which data is actually written, that is, the target memory block, is determined according to the data to be written and the available space of the sliding window. And after the target memory block is determined, writing data into the target memory block of the server side by circularly executing the write-with-imm instruction. The immediate of each write-with-imm instruction is the ID value of the memory block. When data is successfully written into one memory block, the available space of the sliding window is reduced by one unit, and when x memory blocks are written, the available space of the sliding window is reduced by x units.
In a specific embodiment, the determining a 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 block in the memory pool, and rounding the ratio upwards; comparing the upward rounding result with the size of the available space, and selecting the minimum value of the upward rounding result and the available space to obtain the number of the target memory blocks; and taking the idle memory blocks with the number as target memory blocks.
I.e. according to X1=min(ceil(L1And/m), r) to obtain the number of memory blocks in which data is written, and taking the free memory blocks with the number as target memory blocks. L is1Representing the length of the data to be written, m representing the unit length of the memory block, r representing the available space of the sliding window, X1The number of the target memory blocks determined by the client during data writing is represented.
S103: when reading data, sending a read request to the server, so that the server determines a target memory block according to target read data specified by the read request and the available space of the sliding window, and copying the target read data to the target memory block; and after the target read data is read from the target memory block, reducing the available space of the sliding window.
Specifically, when executing a remote data reading process, the client first sends a read request to the server. And then the server determines a target memory block according to the data to be read by the client, namely the target read data and the available space of the sliding window (the relevant information of the sliding window created by the client is synchronized to the server), and further 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. And the client reads data from the target memory block of the server by circularly executing the read-with-imm instruction. The immediate of each read-with-imm instruction is the ID value of the memory block. When data is successfully read from one memory block, the available space of the sliding window is reduced by one unit, and when x memory blocks are read, the available space of the sliding window is reduced by x units.
In analogy to the implementation manner of determining the target memory block according to the data to be written and the available space of the sliding window, the manner of determining, by the server, the target memory block according to the target read data specified by the read request and the available space of the sliding window is as follows: according to X2=min(ceil(L2And/m), r) obtaining the number of the memory blocks of which the data is to be copied, and further copying the target read data into the idle memory blocks with the number. L is2Representing the length of the target read data, m representing the unit length of the memory block, r representing the available space of the sliding window, X2And the number of the target memory blocks determined by the server side when the data is read is represented.
It should be noted that steps S102 and S103 are in parallel, and only step S102 may be executed, only step S103 may be executed, or both step S102 and step S103 may be executed. In the case of executing both step S102 and step S103, the order of steps S102 and S103 is not limited, and step S102 may be executed first and then step S103 may be executed, or step S103 may be executed first and then step S102 may be executed.
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 moving the tail part of the circular linked list forward 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 advance of a circularly linked list refers to the tail of the circularly linked list moving in the head direction.
Further, on the basis of the above embodiment, the method further includes:
when data is written, 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, so that the server increases the available space of the sliding window according to the Ack message.
Specifically, when data is written, after the client writes data to be written into the target memory block, the service logic processing flow of the server processes 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, an acknowledgement message, to the server. The confirmation message indicates the number of the memory blocks recovered 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 recovered to the idle state.
When reading data, writing the target read data into the target memory block at the server, and after the client successfully reads the target read data from the target memory block, sending an Ack message to the server by the client to inform the server that the target read data is successfully read. And after the client reads 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 in which 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 manner of sending the Ack packet to the server may be: and sending an Ack message to the server according to a Nagle algorithm.
In order to further improve the transmission efficiency of the unilateral operation, in this embodiment, an Ack packet is sent to the server according to a Nagle algorithm. Specifically, the client sends an Ack message to the server when the following conditions are met:
TimeWait>=MAT||SegAvail>=MAS;
the TimeWait represents idle waiting time of the current memory block, MAT represents idle time threshold of the memory block, SegAvail represents total number of the current idle memory blocks, and MAS represents number threshold of the idle memory blocks.
Of course, in addition to sending the Ack packet to the server according to the Nagle algorithm, the Ack packet may also be sent to the server according to the NoDelay algorithm, that is, the Ack packet with the number of the memory blocks recovered to the idle state is immediately sent to the server.
Similarly, for the server, the way in which the server sends the Ack to the client may be to send an Ack packet to the client according to a Nagle algorithm.
Further, in order to reduce the cost of packet loss retransmission, when data is written, data with a smaller length can be written each time.
When the available space of the sliding window is zero, the client suspends the write operation and the read operation at the moment. 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, in the control method for direct remote memory access provided by the present application, a sliding window is set, where the sliding window stores IDs of memory blocks in a memory pool, and an available space of the sliding window is equal to the number of idle memory blocks in the memory pool. No matter data is read from the memory pool or written into the memory pool, as long as the free memory blocks in the memory pool are reduced, the available space of the sliding window is correspondingly reduced, so that as long as the sliding window has enough available space, reading operation or writing operation can be carried out according to the ID of the memory blocks stored in the sliding window, and the memory state does not need to be frequently exchanged with the server, thereby greatly reducing the exchange times of the memory state, improving the transmission efficiency of unilateral operation, and increasing the usability of the RDMA network.
The present application also provides a control device for remote direct memory access, which can be referred to with the above method. Referring to fig. 3, fig. 3 is a schematic diagram of a control apparatus for direct remote memory access according to an embodiment of the present application, and referring to fig. 3, the apparatus includes:
a creating module 10, configured to create a sliding window according to information of a memory pool of a 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;
a data writing module 20, configured to determine a target memory block according to data to be written and an 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;
a read data module 30, 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 after the target read data is read from the target memory block, reducing the available space of the sliding window.
On the basis of the above embodiment, optionally, the sliding window is a circular linked list.
On the basis of the foregoing embodiment, optionally, the data writing module 20 is specifically configured to:
and moving the tail part of the circular linked list forward by X units, wherein X is equal to the number of the idle memory blocks reduced in the memory pool.
On the basis of the foregoing embodiment, optionally, the data writing module 20 is specifically configured to:
calculating the ratio of the data to be written to the unit length of the memory block in the memory pool, and rounding the ratio upwards;
comparing the upward rounding result with the size of the available space, and selecting the minimum value of the upward rounding result and the available space to obtain the number of the target memory blocks;
and taking the idle memory blocks with the number 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 when data is written, 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 when data is read so that the server can increase the available space of the sliding window according to the Ack message.
On the basis of the foregoing 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 foregoing embodiment, optionally, the sending module is specifically configured to:
and sending an Ack message to the server according to a Nagle algorithm.
The control device for remote direct memory access is provided with the sliding window, the sliding window stores the ID of the memory blocks in the memory pool, and the available space of the sliding window is equal to the number of the idle memory blocks in the memory pool. No matter data is read from the memory pool or written into the memory pool, as long as the free memory blocks in the memory pool are reduced, the available space of the sliding window is correspondingly reduced, so that as long as the sliding window has enough available space, reading operation or writing operation can be carried out according to the ID of the memory blocks stored in the sliding window, and the memory state does not need to be frequently exchanged with the server, thereby greatly reducing the exchange times of the memory state, improving the transmission efficiency of unilateral operation, and increasing the usability of the RDMA network.
The present application also provides a control device for remote direct memory access, which is shown in 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 implement 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 data is written, 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 the data to be written is written into the target memory block; when reading data, sending a read request to the server, so that the server determines a target memory block according to target read data specified by the read request and the available space of the sliding window, and copying the target read data to the target memory block; and after the target read data is read from the target memory block, reducing the available space of the sliding window.
For the introduction of the device provided in the present application, please refer to the above method embodiment, which is not described herein again.
The present application further 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 data is written, 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 the data to be written is written into the target memory block; when reading data, sending a read request to the server, so that the server determines a target memory block according to target read data specified by the read request and the available space of the sliding window, and copying the target read data to the target memory block; and after the target read data is read from the target memory block, reducing the available space of the sliding window.
The computer-readable storage medium may include: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
For the introduction of the computer-readable storage medium provided in the present application, please refer to the above method embodiments, which are not described herein again.
The embodiments are described in a progressive manner in the specification, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device, the apparatus and the computer-readable storage medium disclosed by the embodiments correspond to the method disclosed by the embodiments, so that the description is simple, and the relevant points can be referred to the description of the method.
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 components and steps have been described above generally in terms of their functionality in order to clearly illustrate this 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 implementation. 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. A software module may reside 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 direct access to remote memory provided by the present application are described in detail above. The principles and embodiments of the present application are explained herein using specific examples, which are provided only to help understand the method and the core idea of the present application. It should be noted that, for those skilled in the art, it is possible to make several improvements and modifications to the present application without departing from the principle of the present application, and such improvements and modifications also fall within the scope of the claims of the present application.

Claims (10)

1. A method for controlling direct access to a remote memory, comprising:
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 data is written, 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 the data to be written is written into the target memory block;
when reading data, sending a read request to the server, so that the server determines a target memory block according to target read data specified by the read request and the available space of the sliding window, and copying the target read data to the target memory block; and after the target read data is read from the target memory block, reducing the available space of the sliding window.
2. The control method of claim 1, wherein the sliding window is a circularly linked list.
3. The control method of claim 2, wherein said narrowing the available space of the sliding window comprises:
and moving the tail part of the circular linked list forward by X units, wherein X is equal to the number of the idle memory blocks reduced in the memory pool.
4. The method according to claim 1, wherein the determining a 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 block in the memory pool, and rounding the ratio upwards;
comparing the upward rounding result with the size of the available space, and selecting the minimum value of the upward rounding result and the available space to obtain the number of the target memory blocks;
and taking the idle memory blocks with the number as target memory blocks.
5. The control method according to claim 1, characterized by further comprising:
when data is written, 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, so that the server increases the available space of the sliding window according to the Ack message.
6. The control method of claim 5, 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.
7. The control method according to claim 6, wherein the sending the Ack packet to the server comprises:
and sending an Ack message to the server according to a Nagle algorithm.
8. A control apparatus for direct remote memory access, comprising:
the creating 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 data to be written and the available space of the sliding window when data is written, and reducing the available space of the sliding window after the data to be written is written into the target memory block;
the data reading module is used for sending a read request to the server when data is read, so that the server determines a target memory block according to target read data specified by the read request and the available space of the sliding window, and copies the target read data to the target memory block; and after the target read data is read from the target memory block, reducing the available space of the sliding window.
9. A control apparatus for direct remote memory access, comprising:
a memory for storing a computer program;
a processor for implementing the steps of the method of controlling direct access to remote memory as claimed in any one of claims 1 to 7 when executing said computer program.
10. A computer-readable storage medium, having stored thereon a computer program which, when being executed by a processor, carries out the steps of the method of controlling direct remote memory access according to any one of claims 1 to 7.
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 true CN113608686A (en) 2021-11-05
CN113608686B 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 (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1505330A (en) * 2002-12-02 2004-06-16 深圳市中兴通讯股份有限公司上海第二 A internal memory management method
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
CN102255794A (en) * 2010-05-17 2011-11-23 塔塔咨询服务有限公司 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
CN104484295A (en) * 2014-12-16 2015-04-01 中国人民解放军国防科学技术大学 Receiver sliding window-based data transmission method in parallel computer system
US20150154004A1 (en) * 2013-12-04 2015-06-04 Oracle International Corporation System and method for supporting efficient buffer usage with a single external memory interface
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
CN109918203A (en) * 2019-03-18 2019-06-21 深圳市网心科技有限公司 Access server memory management optimization method, access server and communication system

Patent Citations (9)

* 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
CN1505330A (en) * 2002-12-02 2004-06-16 深圳市中兴通讯股份有限公司上海第二 A internal memory management method
CN102255794A (en) * 2010-05-17 2011-11-23 塔塔咨询服务有限公司 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
US20150154004A1 (en) * 2013-12-04 2015-06-04 Oracle International Corporation System and method for supporting efficient buffer usage with a single external memory interface
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
CN109918203A (en) * 2019-03-18 2019-06-21 深圳市网心科技有限公司 Access server memory management optimization method, access server and communication system

Also Published As

Publication number Publication date
CN113608686B (en) 2023-05-26

Similar Documents

Publication Publication Date Title
US10891253B2 (en) Multicast apparatuses and methods for distributing data to multiple receivers in high-performance computing and cloud-based networks
US20070041383A1 (en) Third party node initiated remote direct memory access
CN106603692B (en) Data storage method and device in distributed storage system
EP3826267B1 (en) File sending method, file receiving method and file transceiving apparatus
CN111339192A (en) Distributed edge computing data storage system
CN107608632B (en) Communication method, device and system of distributed storage cluster
EP3690630A1 (en) Data reading and writing method and apparatus, and storage server
CN113709131B (en) Network data transmission method, device, computer equipment and readable medium
CN111857602B (en) Data processing method, data processing device, data node and storage medium
JP2016529575A (en) Hard disk and data processing method
WO2021104383A1 (en) Data backup method and apparatus, device, and storage medium
US6826622B2 (en) Method of transferring data between memories of computers
CN116069262B (en) Distributed storage unloading method and device, electronic equipment and storage medium
CN113608686B (en) Remote memory direct access method and related device
CN110798366B (en) Task logic processing method, device and equipment
CN114827017B (en) Communication method and device of Kafka cluster, electronic equipment and storage medium
CN111274176B (en) Information processing method, electronic equipment, system and storage medium
CN113204517B (en) Inter-core sharing method of Ethernet controller special for electric power
CN111611068B (en) Data writing method in distributed system, server and client
JP4123712B2 (en) Communication processing method and recording medium on which communication processing program is recorded
CN112003860B (en) Memory management method, system and medium suitable for remote direct memory access
CN112527561A (en) Data backup method and device based on Internet of things cloud storage
CN116149575B (en) Server-oriented non-perception computing disk redundant array writing method and system
CN111405313A (en) Method and system for storing streaming media data
JP2007018195A (en) Information processing method and information processor

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