Distributed storage offload method and apparatus, electronic device, and nonvolatile readable storage medium
By exchanging memory index information with the peer node and using the DPU to perform RDMA unilateral operations, the information to be sent is written to the peer's memory address, which solves the problem of insufficient RDMA unilateral operation performance and improves data processing efficiency and distribution. Storage performance.
Patent Information
- Application Number
- PCT/CN2024/079091
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-03-06
- Filing Date
- 2024-02-28
- Publication Date
- 2024-09-12
AI Technical Summary
In distributed storage scenarios, the performance of RDMA unilateral operations cannot be fully utilized, resulting in low data processing efficiency and overall performance.
By establishing a connection with the peer node, exchanging memory index information, determining the target peer memory index, and using the local smart network card DPU for remote direct data access, the RDMA unilateral operation mode is implemented to write the information to be sent into the peer memory address. , reduce the number of sending times and improve data processing efficiency.
It achieves performance improvement of RDMA unilateral operation, improves data processing efficiency and overall performance of distributed storage, reduces CPU participation, reduces ack messages in message transmission, and improves IO processing speed and network transmission efficiency.
Smart Images

Figure CN2024079091_12092024_PF_FP_ABST
Abstract
Description
Distributed storage offloading method, device, electronic device and non-volatile readable storage medium
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application claims priority to the Chinese patent application filed with the China Patent Office on March 6, 2023, with application number 2023102028640, and application name “A distributed storage unloading method, device, electronic device and storage medium”, all contents of which are incorporated by reference into this application. Technical Field
[0003] Embodiments of the present application relate to the field of distributed storage technology, and in particular to a distributed storage offloading method, device, electronic device, and non-volatile readable storage medium. Background Art
[0004] With the rapid development of computer technology, hardware devices have evolved from traditional tapes to physical hard disks and then to the current SSDs (Solid State Drives), NVME (Non-Volatile Memory express) disks and even PMem (Persistent Memory) and DRAM computer memory. The performance of hardware is getting better and better. In the HCI (Hyper Converged Infrastructure) scenario, network performance has become a performance bottleneck for distributed storage. How to maximize the performance of HCI has become a topic in the field of distributed storage. Today, network transmission has evolved from the past TCP (Transmission Control Protocol) network to the current RDMA (Remote Direct Memory) Remote Direct Data Access (RDMA) networks are fully offloaded to the DPU (Smart Network Interface Card) to maximize and improve the performance of the entire network. RDMA is divided into unilateral and bilateral operations. RDMA multi-channel send / recv (i.e., send / receive) interactions require bilateral participation (as shown in Figure 1). Traditional RDMA unilateral operations are shown in Figure 2, where the thick solid line represents the content processed by the network card, which still requires two sends. Therefore, how to better maximize the performance of RDMA unilateral operations and improve the performance of distributed storage offload has become a problem that technicians in this field need to solve.
[0005] Summary of the Invention
[0006] The purpose of the embodiments of the present application is to provide a distributed storage offloading method, device, electronic device and non-volatile readable storage medium, which can better exert the performance of RDMA unilateral operation during use, improve data processing efficiency and overall distributed storage performance.
[0007] To solve the above technical problems, an embodiment of the present application provides a distributed storage offloading method, including:
[0008] Establish a connection with the peer node;
[0009] Exchange memory index information with peer nodes to obtain each peer's memory index;
[0010] Determine a target peer memory index from each peer memory index;
[0011] The local smart network card DPU uses remote direct data access (RDMA) unilateral operation to write the information to be sent to the peer memory address corresponding to the target peer memory index.
[0012] Optionally, before establishing a connection with the peer node, the following steps are also included:
[0013] For each node, establish a local memory pool;
[0014] A local memory index corresponding to each local memory address of the local memory pool is established.
[0015] Optionally, exchange memory index information with the peer node to obtain each peer's memory index, including:
[0016] Send multiple local memory indexes to the peer node;
[0017] A plurality of peer memory indexes sent by a peer node are received, where the peer memory indexes correspond to corresponding peer memory addresses of a peer memory pool.
[0018] Optionally, sending the multiple local memory indexes to the peer node includes: sending the multiple local memory indexes corresponding to the peer node to the peer node, so that the peer node stores each received local memory index;
[0019] Receiving multiple peer memory indexes sent by the peer node includes: receiving multiple peer memory indexes sent by the peer node and corresponding to the local node, and storing the multiple peer memory indexes.
[0020] Optionally, after establishing the local memory indexes corresponding to the local memory addresses of the local memory pool, the method further includes:
[0021] Allocate multiple local memory indexes to other nodes respectively;
[0022] Then, multiple local memory indexes are sent to the peer node, including:
[0023] A plurality of local memory indexes corresponding to the peer node are sent to the peer node.
[0024] Optionally, after establishing the local memory pool, also include:
[0025] Register each local memory pool with the local DPU.
[0026] Optionally, determining a target peer memory index from each peer memory index includes:
[0027] Poll each peer memory index in the index information to determine the target peer memory index.
[0028] Optionally, polling each peer memory index in the index information to determine the target peer memory index includes:
[0029] Poll each peer memory index in the index information to find the peer memory index whose status is marked as idle;
[0030] The peer memory index whose state is marked as idle is determined as the target peer memory index.
[0031] Optionally, after writing the information to be sent to the peer end memory address corresponding to the target peer end memory index, the method further includes:
[0032] The state flags of the locally stored target peer memory index and the corresponding original peer memory index of the peer node are changed to a written state.
[0033] Optionally, also include:
[0034] Traverse each local memory index to determine the target local memory index whose status is marked as written;
[0035] Perform IO processing on the information in the local memory address corresponding to the target local memory index.
[0036] Optionally, performing IO processing on the information in the local memory address corresponding to the target local memory index includes:
[0037] Directly send the data in the local memory address corresponding to the target local memory index to the physical disk.
[0038] Optionally, after performing IO processing on the information in the local memory address corresponding to the target local memory index, the method further includes:
[0039] Change the state flag of the target local memory index to idle.
[0040] Optionally, after performing IO processing on the information in the local memory address corresponding to the target local memory index, the method further includes:
[0041] Generate local return information, which includes the index header of the target local memory index;
[0042] Determine the current target peer memory index from each peer memory index;
[0043] The local DPU uses RDMA unilateral operation to write the local return information into the peer memory address corresponding to the current target peer memory index.
[0044] Optionally, also include:
[0045] When the information in the local memory address corresponding to the target local memory index is returned by the peer, the state identifier of the corresponding peer memory index is changed to an idle state based on the index header in the returned information by the peer.
[0046] Optionally, the local memory index includes the local memory address, key, and data header information corresponding to the local memory block;
[0047] The peer memory index includes the peer memory address, key, and data header information corresponding to the peer memory block.
[0048] Optionally, also include:
[0049] When the target peer memory index is not determined from each peer memory index, a request to reread index information is sent to the peer node;
[0050] Receive the latest memory index of each peer node sent by the peer node.
[0051] Optionally, also include:
[0052] In the case that the target peer memory index is not determined based on the latest peer memory indexes, an index expansion request is sent to the peer node.
[0053] Optionally, determining a target peer memory index from each peer memory index includes:
[0054] Based on the number of messages to be sent, determining a plurality of target peer memory indexes from each peer memory index;
[0055] Then, the information to be sent is written to the peer memory address corresponding to the target peer memory index, including:
[0056] Each message to be sent is written into the peer end memory address corresponding to each target peer end index.
[0057] The embodiment of the present application further provides a distributed storage offloading device, including:
[0058] A connection module is configured to establish a connection with a peer node;
[0059] The interaction module is configured to exchange memory index information with the peer node and obtain the memory index of each peer node;
[0060] The determination module is configured to determine a target peer memory index from each peer memory index;
[0061] The operation module is configured to write the information to be sent into the peer memory address corresponding to the target peer memory index by adopting the remote direct data access RDMA unilateral operation method through the local smart network card DPU.
[0062] Optionally, also include:
[0063] The first establishment module is configured to establish a local memory pool for each node;
[0064] The second establishing module is configured to establish local memory indexes corresponding to respective local memory addresses of the local memory pool.
[0065] Optional, interactive modules, including:
[0066] A first sending module is configured to send a plurality of local memory indexes to a peer node;
[0067] The first receiving module is configured to receive a plurality of peer memory indexes sent by a peer node, where the peer memory indexes correspond to corresponding peer memory addresses of a peer memory pool.
[0068] Optionally, also include:
[0069] The allocation module is configured to allocate multiple local memory indexes to other nodes respectively;
[0070] Then, the first sending module is configured to send multiple local memory indexes corresponding to the opposite node to the opposite node.
[0071] Optionally, also include:
[0072] The registration module is configured to register each local memory pool with the local DPU.
[0073] Optionally, the determination module is configured to poll each peer memory index in the index information to determine the target peer memory index.
[0074] Optionally, determine the modules, including:
[0075] The polling unit is configured to poll each peer memory index in the index information to find the peer memory index whose status is marked as idle;
[0076] The determining unit is configured to determine the peer memory index whose state is identified as an idle state as the target peer memory index.
[0077] Optionally, also include:
[0078] The first changing module is configured to change the state identifiers of the locally stored target peer memory index and the original peer memory index corresponding to the peer node to a written state.
[0079] Optionally, also include:
[0080] The traversal module is configured to traverse each local memory index and determine a target local memory index whose status is marked as a written state;
[0081] The processing module is configured to perform IO processing on information in a local memory address corresponding to a target local memory index.
[0082] Optionally, the processing module is configured to directly send the data in the local memory address corresponding to the target local memory index to the physical disk.
[0083] Optionally, also include:
[0084] The second changing module is configured to change the state flag of the target local memory index to an idle state.
[0085] Optionally, also include:
[0086] A generation module is configured to generate local return information, the local return information including an index header of a target local memory index;
[0087] The determination module is further configured to determine a current target peer memory index from each peer memory index;
[0088] The operation module is further configured to write the local return information into the peer memory address corresponding to the current target peer memory index by using the RDMA unilateral operation method through the local DPU.
[0089] Optionally, also include:
[0090] The third changing module is configured to change the state identifier of the corresponding peer memory index to an idle state based on the index header in the peer return information when the information in the local memory address corresponding to the target local memory index is the peer return information.
[0091] Optionally, also include:
[0092] The second sending module is configured to send a request to the peer node to reread the index information when the target peer node memory index is not determined from the peer node memory indexes;
[0093] The second receiving module is configured to receive the latest memory index of each opposite end sent by the opposite end node.
[0094] Optionally, also include:
[0095] The third sending module is configured to send an index expansion request to the opposite node when the target opposite memory index is not determined based on the latest opposite memory indexes.
[0096] Optionally, the determination module is configured to determine a plurality of target peer memory indexes from each peer memory index based on the amount of information to be sent;
[0097] Then, the operation module is configured to write each piece of information to be sent into the peer end memory address corresponding to each target peer end index.
[0098] An embodiment of the present application further provides an electronic device, including:
[0099] memory for storing computer programs;
[0100] A processor is used to implement the steps of the above-mentioned distributed storage offloading method when executing a computer program.
[0101] An embodiment of the present application also provides a non-volatile readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned distributed storage unloading method are implemented.
[0102] An embodiment of the present application provides a distributed storage offloading method, device, electronic device and non-volatile readable storage medium, the method comprising: establishing a connection with a peer node; exchanging memory index information with the peer node to obtain each peer memory index; determining a target peer memory index from each peer memory index; and writing the information to be sent to the peer memory address corresponding to the target peer memory index by using a remote direct data access (RDMA) unilateral operation through a local smart network card (DPU).
[0103] It can be seen that in the embodiment of the present application, after the connection is established with the peer node, each peer memory index is obtained by exchanging memory index information with the peer node. Then, when interacting with the peer, the target peer memory index can be determined from the obtained peer memory indexes. Then, the local DPU adopts the RDMA unilateral operation to write the information to be sent to the peer memory address corresponding to the target peer memory index in the peer node; the unilateral operation in the embodiment of the present application only requires one transmission to realize data writing, which can better exert the performance of RDMA unilateral operation, improve data processing efficiency and the overall performance of distributed storage. BRIEF DESCRIPTION OF THE DRAWINGS
[0104] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the relevant technologies and the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0105] FIG1 is a schematic diagram of an existing RDMA multi-channel method for send / recv;
[0106] FIG2 is a schematic diagram of existing RDMA communication;
[0107] FIG3 is a schematic diagram of a flow chart of a distributed storage offloading method provided in an embodiment of the present application;
[0108] FIG4 is a flow chart of another distributed storage offloading method provided in an embodiment of the present application;
[0109] FIG5 is a schematic diagram of a multi-node memory index mapping method provided in an embodiment of the present application;
[0110] FIG6 is a schematic diagram of an RDMA single-transmission full-process unilateral operation according to an embodiment of the present application;
[0111] FIG7 is a schematic structural diagram of a distributed storage unloading device provided in an embodiment of the present application;
[0112] FIG8 is a schematic structural diagram of an electronic device provided in an embodiment of the present application;
[0113] FIG9 is a schematic structural diagram of a non-volatile readable storage medium provided in an embodiment of the present application. DETAILED DESCRIPTION
[0114] The embodiments of the present application provide a distributed storage offloading method, device, electronic device and non-volatile readable storage medium, which can better exert the performance of RDMA unilateral operation during use, improve data processing efficiency and overall distributed storage performance.
[0115] To make the purpose, technical solutions, and advantages of the embodiments of this application more clear, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0116] Please refer to Figure 3, which is a flow chart of a distributed storage offloading method provided by an embodiment of the present application. The method includes:
[0117] S110: Establish a connection with the peer node;
[0118] It should be noted that in a distributed system, multiple memory addresses can be allocated to each node in advance, each memory address corresponds to a memory index, and then when a local node needs to interact with a peer node for memory information, a connection corresponding to the peer node can be established.
[0119] S120: Exchange memory index information with the peer node to obtain each peer node's memory index;
[0120] Optionally, after establishing a connection with the peer node, memory index information is exchanged with the peer node, and the local memory index is optionally sent to the peer node so that the peer node stores it after receiving the local memory index. The peer node will also send the peer memory index to the local node, and the local node stores it after receiving the peer memory index, so that the local node has the memory read and write permissions of the peer node.
[0121] S130: Determine a target peer memory index from each peer memory index;
[0122] Optionally, after the exchange of memory indexes, when the local node needs to send or receive information to the peer end, it can determine the target peer end memory index from the stored peer end memory indexes, randomly determine a usable peer end memory index from multiple peer end memory indexes as the target peer end memory index, or poll each peer end memory index one by one in a preset order to find a usable peer end memory index as the target peer end memory index.
[0123] S140: Using the remote direct data access (RDMA) unilateral operation method through the local smart network card (DPU), the information to be sent is written into the peer memory address corresponding to the target peer memory index.
[0124] It is understandable that after determining the target peer memory index, the information to be sent can be sent to the peer through the local DPU using RDMA unilateral operation, and the corresponding peer memory address can be determined from each peer memory address of the peer according to the target peer memory index, and then the information to be sent can be written into the peer memory address, thereby realizing the writing of the message and completing the network offloading.
[0125] That is, all IO (Input / Output) in the embodiments of the present application can be operated unilaterally in the reas / write mode, reducing the ack messages in the message transmission and reducing the participation of the CPU (Central Processing Unit / Processor) on the other side, allowing the CPU to do separate things without participating in message transmission, thereby speeding up IO processing and message transmission.
[0126] It can be seen that in the embodiment of the present application, after the connection is established with the peer node, each peer memory index is obtained by exchanging memory index information with the peer node. Then, when interacting with the peer, the target peer memory index can be determined from the obtained peer memory indexes. Then, the local DPU adopts the RDMA unilateral operation to write the information to be sent to the peer memory address corresponding to the target peer memory index in the peer node; the unilateral operation in the embodiment of the present application only requires one transmission to realize data writing, which can better exert the performance of RDMA unilateral operation, improve data processing efficiency and the overall performance of distributed storage.
[0127] Based on the above embodiment, this embodiment further optimizes and explains the technical solution as follows:
[0128] Referring to FIG. 4 , the distributed storage offloading method provided in the embodiment of the present application includes:
[0129] S210: For each node, establish a local memory pool;
[0130] Optionally, in actual applications, a local memory pool corresponding to each node in the distributed system may be established in advance, and the local memory pool corresponding to the local node may be applied for when the local node is initialized.
[0131] S220: Register each local memory pool with the local DPU;
[0132] Optionally, in the embodiment of the present application, for each node, after establishing its own local memory pool, the local memory pool is registered in its own local DPU so that network offloading can be performed subsequently through the DPU.
[0133] S230: Creating local memory indexes corresponding to respective local memory addresses of the local memory pool;
[0134] It can be understood that the embodiments of the present application are explained in detail using a node as an example. After establishing respective local memory pools, corresponding local memory indexes can be established for each local memory pool address in the local memory pool. That is, one local memory address corresponds to one local memory index, and the local memory index includes the local memory address, key key and data header information hdr corresponding to the corresponding local memory block, so that the local memory address of the corresponding local memory block and the corresponding data header can be accurately located according to the local memory index.
[0135] It should be noted that the above S210 to S230 may be pre-executed once when the node is initialized, and the local node may not repeat the process when subsequently establishing memory interaction with the peer node.
[0136] S240: Establishing a connection with the peer node;
[0137] It should be noted that after a local memory pool and a local memory index corresponding to each local memory address are established for each node, when the local node needs to exchange memory information with a peer node, the local node can establish a connection corresponding to the peer node.
[0138] S250: Send multiple local memory indexes to the peer node;
[0139] It should be noted that after establishing a connection with the peer node, the local node exchanges memory index information with the peer node. The local node can send multiple local memory indexes to the peer node so that the peer node stores each local memory index after receiving the multiple local memory indexes sent by the local node.
[0140] Optionally, multiple local memory indexes can be actively sent to the peer node after the connection is established, or multiple local memory indexes can be sent to the peer node when a request to read the local memory index sent by the peer node is received. The implementation method is not specifically limited in the embodiments of the present application, and it is sufficient to achieve the purpose of the embodiments of the present application.
[0141] In addition, the local node can directly distinguish and use the index by reading the memory index of each peer node in one go, without having to interact with the peer node multiple times to obtain the memory information sent by the message. In addition, through the memory index method, all the index information (local memory address, key and data header information hdr) are loaded into the CPU cache, which is conducive to speeding up the memory judgment during subsequent polling and improving the overall performance.
[0142] It should also be noted that all message memory interactions in the embodiments of this application use large page memory. Large page memory reduces memory page fault interrupts, reduces kernel switching terminals, reduces the time delay in the entire IO process, and improves IO processing speed. In addition, the used memory is registered with the DPU, all memory is zero-copy, and when a message needs to be sent, it is directly unloaded through the DPU, and the DPU is responsible for the entire message forwarding. Among them, a part of the large page memory is used as the index part.
[0143] Furthermore, after establishing local memory indexes corresponding to the local memory addresses of the local memory pool, the method further includes:
[0144] Allocate multiple local memory indexes to other nodes respectively;
[0145] Then, the above sends multiple local memory indexes to the peer node, including:
[0146] A plurality of local memory indexes corresponding to the peer node are sent to the peer node.
[0147] In practical applications, in order to avoid the loss of memory data caused by multiple nodes writing to the same memory block at the same time, in an embodiment of the present application, after establishing local memory indexes corresponding to the local memory addresses of the local memory pool for each node, multiple local memory indexes can be pre-assigned to other nodes. As shown in the multi-node memory index mapping diagram of FIG5 , multiple memory indexes are divided out from each memory index corresponding to each memory pool and assigned to each node. After the local node establishes a connection with the peer node, the local memory indexes corresponding to the peer node are sent to the peer node.
[0148] S260: Receive multiple peer memory indexes sent by the peer node, where the peer memory indexes correspond to corresponding peer memory addresses of the peer memory pool;
[0149] Of course, in actual applications, the peer node will also send multiple peer memory indexes to the local node. Multiple peer memory indexes corresponding to the local node can be sent to the local node. After receiving the multiple peer memory indexes, the local node stores the multiple peer memory indexes.
[0150] S270: Determine a target peer memory index from each peer memory index;
[0151] Optionally, after exchanging memory indexes, when the local node needs to send or receive information to the peer, it can determine the target peer memory index from the stored peer memory indexes and poll the peer memory indexes in the peer index information to determine the target peer memory index. That is, by polling multiple peer memory indexes, a usable peer memory index is found as the target peer memory index.
[0152] Optionally, for each node, a corresponding status identifier can be set for each local memory index corresponding to the node. When the memory index is not selected, the status identifier of the memory index is an idle state; when the memory index is selected, the status identifier of the memory index is a write state.
[0153] Therefore, the process of polling each peer memory index in the index information to determine the target peer memory index may include:
[0154] Poll each peer memory index in the index information to find the peer memory index whose status is marked as idle;
[0155] The peer memory index whose state is marked as idle is determined as the target peer memory index.
[0156] It is understandable that in actual applications, when polling the peer memory indexes, a peer memory index with an idle state identifier may be found from the peer memory indexes and determined as the target peer memory index.
[0157] S280: The local DPU uses RDMA unilateral operation to write the information to be sent to the peer memory address corresponding to the target peer memory index.
[0158] Optionally, after determining the target peer memory index, the local DPU can use RDMA unilateral operation to send the information to the peer, and determine the corresponding peer memory address from each peer memory address of the peer based on the target peer memory index, and then write the information to the peer memory address, thereby writing the message and completing the network offload. Among them, a schematic diagram of RDMA single transmission (unilateral operation) in an embodiment of the present application is shown in Figure 6.
[0159] It should be noted that when writing the information to be sent to the peer memory address corresponding to the target peer memory index, the data segment can be written to the corresponding peer memory address first, and finally the data header hdr information can be written to the corresponding peer memory index. The peer node can directly use the memory information through the corresponding memory index, and realize the order preservation of data and hdr through the order preservation in the RDMA message, thereby achieving memory consistency.
[0160] Furthermore, the process of determining the target peer memory index from the peer memory indexes in S270 may include:
[0161] Based on the number of messages to be sent, determining a plurality of target peer memory indexes from each peer memory index;
[0162] Then, the process of writing the information to be sent into the peer end memory address corresponding to the target peer end memory index in S208 may include:
[0163] Each message to be sent is written into the peer end memory address corresponding to each target peer end index.
[0164] It should be noted that, for any local node, multiple target peer memory indexes can be determined from the stored peer memory indexes according to the number of pending messages to be sent, that is, multiple target peer memory indexes with status marks of idle state can be obtained at one time, and unilateral message sending can be performed directly, that is, each pending message is written into the peer memory address corresponding to each target peer memory index, so as to realize one-time reading of multiple target peer memory indexes and then participate in multiple IO interactions, which can reduce message communication during the interaction process and help improve IO efficiency and overall performance.
[0165] Furthermore, after writing the information to be sent into the peer memory address corresponding to the target peer memory index, the method may further include:
[0166] The state flags of the locally stored target peer memory index and the corresponding original peer memory index of the peer node are changed to a written state.
[0167] That is, after writing the corresponding data to the peer memory address corresponding to the target peer memory index in the peer node, it indicates that the target peer memory index has been used and the corresponding peer memory address has been written. At this time, the status flag of the locally stored target peer memory index is changed to the written state, and the status flag of the corresponding original peer memory index on the peer node can also be changed to the written state. It can be seen that in the embodiment of the present application, after the write is successful, the status flags of the corresponding target peer memory index and the corresponding original peer memory index can be directly changed to the written state, without the need for interactive operations, thereby reducing the message transmission during the process.
[0168] Furthermore, the method may further include:
[0169] Traverse each local memory index to determine the target local memory index whose status is marked as written;
[0170] Perform IO processing on the information in the local memory address corresponding to the target local memory index.
[0171] It should be noted that after the peer node writes data to a local memory address of the local node, the status flag of the corresponding local memory address will be changed to the written state. Therefore, the local node can traverse each local memory index to find the target local memory index with the status flag of the written state, and then perform IO processing on the information in the local memory address corresponding to the target local memory index.
[0172] It can be understood that if there are multiple target local memory indexes during the traversal process, the information in the target memory address corresponding to each target memory index can be obtained at one time based on multiple target memory indexes, without the need for multiple readings, which is conducive to improving IO speed and overall performance.
[0173] Furthermore, the process of performing IO processing on the information in the local memory address corresponding to the target local memory index may include:
[0174] Directly send the data in the local memory address corresponding to the target local memory index to the physical disk.
[0175] It should be noted that the data in the local memory address can be directly sent to the physical disk. For example, the index memory and data memory composition request can be directly sent to the physical disk. The full name does not need to be copied. The memory is directly sent to the data disk, which speeds up the IO processing speed and thus improves the IO speed in the entire HCI environment.
[0176] Furthermore, after performing the IO processing on the information in the local memory address corresponding to the target local memory index, the method may further include:
[0177] Change the state flag of the target local memory index to idle.
[0178] Optionally, after processing the data in the target local memory address corresponding to the target local memory index is completed, the status identifier of the target local memory index can be changed to an idle state, that is, the index is released, so that when the subsequent peer node sends data, the target local memory index can be determined from all idle local memory indexes.
[0179] Furthermore, after performing the IO processing on the information in the local memory address corresponding to the target local memory index, the method may further include:
[0180] Generate local return information, which includes the index header of the target local memory index;
[0181] Determine the current target peer memory index from each peer memory index;
[0182] The local DPU uses RDMA unilateral operation to write the local return information into the peer memory address corresponding to the current target peer memory index.
[0183] It should be noted that in actual applications, after the IO processing of the information in the local memory address corresponding to the target local memory index is completed, local return information including the index header of the target local memory index can be generated, and the local return information can be used as the information to be sent, and then a target peer memory index is determined from each peer memory index, and then the local DPU uses RDMA unilateral operation to write the local return information to the peer memory address corresponding to the target peer memory index, so that after the peer node processes the information in the peer memory address, the status identifier of the memory index corresponding to the index header stored by the peer node is changed to an idle state.
[0184] Furthermore, the method may further include:
[0185] When the information in the local memory address corresponding to the target local memory index is returned by the peer, the state identifier of the corresponding peer memory index is changed to an idle state based on the index header in the returned information by the peer.
[0186] It should be noted that when IO processing is performed on the information in the local memory address corresponding to the target local memory index, when it is determined that the information in the local memory address is the peer return information returned by the peer node, it means that the data written by the local node to the peer memory address corresponding to the target peer memory index has been processed. At this time, the corresponding peer memory index can be determined from each peer memory index stored in the local node according to the index header in the peer return information, and then the status identifier of the peer memory index can be changed to an idle state, which can be used for subsequent data interaction.
[0187] It should be noted that in actual applications, the local memory index in the embodiment of the present application includes the local memory address, key and data header information corresponding to the local memory block; the peer memory index includes the peer memory address, key and data header information corresponding to the peer memory block.
[0188] Furthermore, the method may further include:
[0189] When the target peer memory index is not determined from each peer memory index, a request to reread index information is sent to the peer node;
[0190] Receive the latest memory index of each peer node sent by the peer node.
[0191] It should be noted that when there is no peer memory index with a status mark of idle state among the peer memory indexes stored in the local node, a request to re-acquire index information can be sent to the peer node so that the peer node can return the current latest memory indexes to the local node, thereby performing a one-time update of the index information to reduce interaction. After the local node receives the latest peer memory indexes sent by the peer node, it determines the peer memory index with a status mark of idle state from the latest peer memory indexes as the target peer memory index for writing data.
[0192] Furthermore, the method may further include:
[0193] In the case that the target peer memory index is not determined based on the latest peer memory indexes, an index expansion request is sent to the peer node.
[0194] It should also be noted that if the local node still fails to find the peer memory index with the status marked as idle after obtaining the latest peer local index of the peer node, it means that the memory index allocated by the peer node to the local node is insufficient. Therefore, an index expansion request can be sent to the peer node, requesting the peer node to expand the allocated memory index, thereby avoiding the problem of insufficient memory under high pressure.
[0195] It can be understood that in the embodiment of the present application, the memory index is polled in a polling manner, which speeds up the polling bandwidth and retrieval polling time, reduces the kernel event notification in the message communication, can directly process the message, and at the same time, all user-mode requests do not require kernel switching, thereby reducing the CPU overhead in the entire message and IO process, speeding up data processing speed, and reducing data processing delay, thereby improving the IO speed and reducing IO delay in the entire HCI environment, while giving full play to the bandwidth performance of the entire DPU and reducing bandwidth waste.
[0196] In other words, in distributed scenarios, due to the existence of multiple copies, a single data item is sent to multiple nodes. In traditional communication models, dual-copy data transmission requires 10 TCP message transmissions and two event notifications. This solution only requires four TCP message transmissions without event notifications. This greatly reduces network TCP message interactions in copy forwarding scenarios, improves network transmission efficiency, reduces event notifications, and speeds up event processing. It also reduces network TPS consumption by 60% and improves communication performance by more than 50%, thereby increasing the cluster's read and write IOPS and reducing the latency of a single IO, improving the competitiveness of the entire distributed storage.
[0197] Based on the above embodiment, the present application embodiment further provides a distributed storage unloading device, as shown in FIG7 . The device comprises:
[0198] A connection module 11 is configured to establish a connection with a peer node;
[0199] Interaction module 12, used to exchange memory index information with peer nodes and obtain each peer node's memory index;
[0200] A determination module 13 is configured to determine a target peer memory index from each peer memory index;
[0201] The operation module 14 is configured to write the information to be sent into the peer memory address corresponding to the target peer memory index by adopting a remote direct data access (RDMA) unilateral operation method through the local intelligent network card (DPU).
[0202] Furthermore, it also includes:
[0203] The first establishment module is configured to establish a local memory pool for each node;
[0204] The second establishing module is configured to establish local memory indexes corresponding to respective local memory addresses of the local memory pool.
[0205] Furthermore, the interaction module 12 includes:
[0206] A first sending module is configured to send a plurality of local memory indexes to a peer node;
[0207] The first receiving module is configured to receive a plurality of peer memory indexes sent by a peer node, where the peer memory indexes correspond to corresponding peer memory addresses of a peer memory pool.
[0208] Furthermore, it also includes:
[0209] The allocation module is configured to allocate multiple local memory indexes to other nodes respectively;
[0210] Then, the first sending module is configured to send multiple local memory indexes corresponding to the opposite node to the opposite node.
[0211] Furthermore, it also includes:
[0212] The registration module is configured to register each local memory pool with the local DPU.
[0213] Furthermore, the determination module 13 is configured to poll each peer memory index in the index information to determine a target peer memory index.
[0214] Furthermore, the determination module 13 includes:
[0215] The polling unit is configured to poll each peer memory index in the index information to find the peer memory index whose status is marked as idle;
[0216] The determining unit is configured to determine the peer memory index whose state is identified as an idle state as the target peer memory index.
[0217] Furthermore, it also includes:
[0218] The first changing module is configured to change the state identifiers of the locally stored target peer memory index and the original peer memory index corresponding to the peer node to a written state.
[0219] Furthermore, it also includes:
[0220] The traversal module is configured to traverse each local memory index and determine a target local memory index whose status is marked as a written state;
[0221] The processing module is configured to perform IO processing on information in a local memory address corresponding to a target local memory index.
[0222] Furthermore, the processing module is configured to directly send the data in the local memory address corresponding to the target local memory index to the physical disk.
[0223] Furthermore, it also includes:
[0224] The second changing module is configured to change the state flag of the target local memory index to an idle state.
[0225] Furthermore, it also includes:
[0226] A generation module is configured to generate local return information, the local return information including an index header of a target local memory index;
[0227] The determination module 13 is further configured to determine the current target peer memory index from each peer memory index;
[0228] The operation module 14 is further configured to write the local return information into the peer memory address corresponding to the current target peer memory index by using the RDMA unilateral operation method through the local DPU.
[0229] Furthermore, it also includes:
[0230] The third changing module is configured to change the state identifier of the corresponding peer memory index to an idle state based on the index header in the peer return information when the information in the local memory address corresponding to the target local memory index is the peer return information.
[0231] Furthermore, it also includes:
[0232] The second sending module is configured to send a request to the peer node to reread the index information when the target peer node memory index is not determined from the peer node memory indexes;
[0233] The second receiving module is configured to receive the latest memory index of each opposite end sent by the opposite end node.
[0234] Furthermore, it also includes:
[0235] The third sending module is configured to send an index expansion request to the opposite node when the target opposite memory index is not determined based on the latest opposite memory indexes.
[0236] Furthermore, the determination module 13 is configured to determine a plurality of target peer memory indexes from each peer memory index based on the amount of information to be sent;
[0237] Then, the operating module 14 is configured to write each to-be-sent message into a peer end memory address corresponding to each target peer end index.
[0238] It should be noted that the distributed storage unloading device provided in the embodiment of the present application has the same beneficial effects as the distributed storage unloading method provided in the above embodiment, and for the introduction of the distributed storage unloading method involved in the embodiment of the present application, please refer to the above embodiment, and this application will not go into details here.
[0239] As shown in FIG8 , based on the above embodiment, an embodiment of the present application further provides an electronic device, including:
[0240] A memory 20 configured to store computer programs;
[0241] The processor 21 is configured to implement the steps of the above-mentioned distributed storage offloading method when executing a computer program.
[0242] The electronic device provided in this embodiment may include but is not limited to a smart phone, a tablet computer, a laptop computer, or a desktop computer.
[0243] Among them, the processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 can be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 21 may also include a main processor and a coprocessor. The main processor is a processor configured to process data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor configured to process data in the standby state. In some embodiments, the processor 21 may be integrated with a GPU (Graphics Processing Unit), and the GPU is configured to be responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 21 may also include an AI (Artificial Intelligence) processor, which is configured to process computing operations related to machine learning.
[0244] The memory 20 may include one or more non-volatile readable storage media, which may be non-transitory. The memory 20 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 20 is at least configured to store the following computer program 201, wherein, after the computer program is loaded and executed by the processor 21, it can implement the relevant steps of the distributed storage unloading method disclosed in any of the aforementioned embodiments. In addition, the resources stored in the memory 20 may also include an operating system 202 and data 203, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 202 may include Windows, Unix, Linux, etc. The data 203 may include but is not limited to a set offset, etc.
[0245] In some embodiments, the electronic device may further include a display screen 22 , an input / output interface 23 , a communication interface 24 , a power supply 25 , and a communication bus 26 .
[0246] Those skilled in the art will appreciate that the structure shown in FIG8 does not limit the electronic device and may include more or fewer components than shown in the figure.
[0247] It is understandable that if the distributed storage unloading method in the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a non-volatile readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the relevant technology or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a non-volatile readable storage medium to execute all or part of the steps of the various embodiments of the present application. The aforementioned non-volatile readable storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), electrically erasable programmable ROM, register, hard disk, removable disk, CD-ROM, magnetic disk or optical disk, etc. Various media that can store program code.
[0248] Based on this, as shown in Figure 9, an embodiment of the present application also provides a non-volatile readable storage medium, on which a computer program 31 is stored. When the computer program 31 is executed by the processor, the steps of the above-mentioned distributed storage unloading method are implemented.
[0249] It should be noted that the electronic device and non-volatile readable storage medium provided in the embodiments of the present application have the same beneficial effects as the distributed storage unloading method provided in the above embodiments, and for the introduction of the distributed storage unloading method involved in the embodiments of the present application, please refer to the above embodiments, and this application will not go into details here.
[0250] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Reference can be made to the common and similar parts between the various embodiments. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the method description.
[0251] It should also be noted that, in this specification, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus comprising the element.
[0252] Professionals can also appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0253] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, a hard disk, a removable disk, a CD-ROM, or any other form of non-volatile readable storage medium known in the art.
[0254] The above description of the disclosed embodiments is intended to enable one skilled in the art to implement or use the present application. Various modifications to these embodiments will be readily apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application is not limited to the embodiments shown herein, but is intended to conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A distributed storage unloading method, characterized in that: include: Establish a connection with the peer node; Exchange memory index information with the peer node to obtain each peer node's memory index; Determine a target peer memory index from each of the peer memory indexes; The information to be sent is written into the peer memory address corresponding to the target peer memory index by using the remote direct data access RDMA unilateral operation method through the local intelligent network card DPU.
2. The distributed storage unloading method according to claim 1, characterized in that: Before establishing a connection with the opposite node, the method further includes: For each node, establish a local memory pool; Local memory indexes corresponding to the local memory addresses of the local memory pool are established.
3. The distributed storage unloading method according to claim 2, characterized in that: The exchanging memory index information with the peer node to obtain each peer memory index includes: Sending the plurality of local memory indexes to the peer node; A plurality of peer memory indexes sent by the peer node are received, wherein the peer memory indexes correspond to corresponding peer memory addresses of a peer memory pool.
4. The distributed storage unloading method according to claim 3, characterized in that: The sending of the plurality of local memory indexes to the opposite node comprises: sending the plurality of local memory indexes corresponding to the opposite node to the opposite node, so that the opposite node stores each of the received local memory indexes; The receiving a plurality of peer memory indexes sent by the peer node includes: receiving a plurality of peer memory indexes sent by the peer node and corresponding to the local node, and storing the plurality of peer memory indexes.
5. The distributed storage unloading method according to claim 3, characterized in that: After the local memory indexes corresponding to the local memory addresses of the local memory pool are established, the method further includes: Allocate multiple local memory indexes to other nodes respectively; Then, sending the plurality of local memory indexes to the peer node includes: Send the multiple local memory indexes corresponding to the counterpart node to the counterpart node.
6. The distributed storage unloading method according to claim 2, characterized in that: After the local memory pool is established, the method further includes: Each of the local memory pools is registered in the local DPU.
7. The distributed storage unloading method according to claim 2, characterized in that: The step of determining a target peer memory index from each of the peer memory indexes includes: Poll each peer memory index in the index information to determine the target peer memory index.
8. The distributed storage unloading method according to claim 7, characterized in that: The step of polling each peer memory index in the index information to determine a target peer memory index includes: Poll each peer memory index in the index information to find out the peer memory index whose status is marked as idle; The peer memory index whose state is identified as an idle state is determined as the target peer memory index.
9. The distributed storage unloading method according to claim 2, characterized in that: After writing the information to be sent into the peer memory address corresponding to the target peer memory index, the method further includes: The state identifier of the locally stored target peer memory index and the original peer memory index corresponding to the peer node is changed to a written state.
10. The distributed storage unloading method according to claim 2, characterized in that: Also includes: Traverse each local memory index to determine the target local memory index whose status is marked as written; Perform IO processing on information in the local memory address corresponding to the target local memory index.
11. The distributed storage unloading method according to claim 10, characterized in that: The performing IO processing on the information in the local memory address corresponding to the target local memory index includes: The data in the local memory address corresponding to the target local memory index is directly sent to the physical disk.
12. The distributed storage unloading method according to claim 10, characterized in that: After performing IO processing on the information in the local memory address corresponding to the target local memory index, the method further includes: The state flag of the target local memory index is changed to an idle state.
13. The distributed storage unloading method according to claim 10, characterized in that: After performing IO processing on the information in the local memory address corresponding to the target local memory index, the method further includes: Generate local return information, the local return information including the index header of the target local memory index; Determine a current target peer memory index from each of the peer memory indexes; The local DPU adopts RDMA unilateral operation to write the local return information into the peer memory address corresponding to the current target peer memory index.
14. The distributed storage unloading method according to claim 10, characterized in that: Also includes: When the information in the local memory address corresponding to the target local memory index is the peer return information, the state identifier of the corresponding peer memory index is changed to an idle state based on the index header in the peer return information.
15. The distributed storage unloading method according to claim 2, characterized in that: The local memory index includes a local memory address, a key and data header information corresponding to the local memory block; The peer memory index includes a peer memory address, a key and data header information corresponding to the peer memory block.
16. The distributed storage unloading method according to any one of claims 1 to 15, characterized in that: Also includes: When the target peer memory index is not determined from each of the peer memory indexes, sending a request to re-read the index information to the peer node; Receive the latest memory index of each peer node sent by the peer node.
17. The distributed storage unloading method according to claim 16, characterized in that: Also includes: In the case that the target peer memory index is not determined based on the latest peer memory indexes, an index expansion request is sent to the peer node.
18. The distributed storage unloading method according to any one of claims 1 to 15, characterized in that: The step of determining a target peer memory index from each of the peer memory indexes includes: Based on the amount of information to be sent, determining a plurality of target peer memory indexes from each of the peer memory indexes; Then, writing the information to be sent to the peer memory address corresponding to the target peer memory index includes: Each of the to-be-sent information is written into a peer end memory address corresponding to each of the target peer end indexes.
19. A distributed storage unloading device, characterized in that: include: A connection module, configured to establish a connection with a peer node; An interaction module is configured to exchange memory index information with the peer node to obtain each peer node's memory index; The determination module is configured to determine a target peer memory index from each of the peer memory indexes; The operation module is configured to write the information to be sent into the peer memory address corresponding to the target peer memory index by using the remote direct data access RDMA unilateral operation method through the local intelligent network card DPU.
20. An electronic device, characterized in that: include: a memory arranged to store a computer program; A processor is configured to implement the steps of the distributed storage unloading method as claimed in any one of claims 1 to 18 when executing the computer program.
21. A non-volatile readable storage medium, characterized in that: The non-volatile readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the distributed storage unloading method according to any one of claims 1 to 18 are implemented.
Citation Information
Patent Citations
RDMA communication address exchange method for distributed file system
CN112565326A
Far-end memory sharing method and device, electronic equipment and storage medium
CN112948149A
Array structure suitable for pure user mode far-end direct memory access and optimization method
CN113448897A
Remote memory direct access method and related device
CN113608686A
Data access method, management equipment, address management device and storage system
CN115470154A
