Random direct memory access network interface controller

By creating atomic sector and counter arrays in the RDMA network interface controller, and using atomic comparison and exchange operations and DMA technology, the problem of difficult realization of sector atomicity functions in high-speed distributed storage systems is solved, and the read and write performance is improved and Reduced latency and CPU involvement.

CN118715512APending Publication Date: 2024-09-27HUAWEI CLOUD COMPUTING TECHNOLOGIES CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202380014044.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-01-26
Publication Date
2024-09-27

AI Technical Summary

Technical Problem

In high-speed distributed storage systems based on persistent memory and RDMA, it is difficult for existing technologies to effectively implement sector atomicity, resulting in low performance and high complexity of read and write operations, and requiring multiple network round-trips and server CPU participation, affecting performance. .

Method used

Direct remote access to sector atomic memory regions, avoiding the server CPU, by creating predefined sized atomic sector and counter arrays in the RDMA Network Interface Controller (RNIC) using atomic compare and swap operations and direct memory access (DMA) technology and multiple network round-trips.

Benefits of technology

It achieves direct remote access to sector atomic memory areas, improves read and write performance, reduces network latency and CPU involvement, reduces write amplification, and improves system performance and efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118715512A
    Figure CN118715512A
Patent Text Reader

Abstract

In order to control Random Direct Memory Access (RDMA) to atomic data sectors, a sector atomic memory area (102) is defined, where the sector atomic memory area (102) includes atomic sectors (106A to 106N) of a predefined size for which an RDMA Network Interface Controller (RNIC) (100, 200, 300) is configured, and where the RDMA Network Interface Controller (RNIC) (100, 200, 300, 400) is configured to control the random Direct Memory Access (RDMA) to the atomic data sectors (106A to 106N) of the atomic sectors (106A to 106N) of the atomic sectors (106A to 106N) of the atomic sectors (106A to 106N) of the atomic sectors (106A to 106N) of the atomic sectors (106A to 106N). 202) provides only access to RDMA requests for atomic sectors that are aligned in sector size and span one or more of the sectors. An array of counters is created for each atomic sector in the sector atomic memory region that includes several bits of counters. Each counter has a bit 0 configured as a write lock bit and a further bit configured as a read counter bit to indicate an ongoing operation with an associated atomic sector. The RNIC then processes an RDMA request for an atomic sector by a client using the counter for the atomic sector.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention generally relates to cloud storage, persistent memory, random direct memory access (RDMA) networking, and distributed systems. More specifically, the present invention relates to a method for controlling random direct memory access (RDMA) to atomic data sectors and a random direct memory access (RDMA) network interface controller (RNIC). Background Art

[0002] Persistent Memory (PM) and Random Direct Memory Access (RDMA) networking are widely used in enterprise and cloud distributed storage to provide high-performance access. PM is a memory technology that provides store or load access like regular memory, without power consumption, but the data is persistent. The performance characteristics of PM may depend on the implementation and are close to volatile memory in magnitude. RDMA provides one-sided operations including read or write to access remote memory without involving the central processing unit (CPU) of the responder (i.e., client). In addition, access control is managed by memory regions (MRs), which can be registered with the RDMA network card (RNIC) and invalidated when access is no longer allowed. Accessing an invalid MR may trigger severe network errors and close the RDMA connection between the client and the server.

[0003] The storage scheme provides a sector atomicity feature that provides a read or write request to a sector on the storage device to be executed atomically. A read or write request to a sector can typically be between 512 bytes and 4096 bytes. If the read and write requests are executed in parallel, the storage scheme will not provide partially old data and partially new data. For example, a sector includes AB values. Process P1 is reading the sector and process P2 is writing CD values ​​to the sector in parallel. The read result of P1 may be AB or CD instead of CB or AD. This feature is very important to simplify software implementation and most existing software includes this feature.

[0004] PM and RDMA do not include sector atomicity functionality themselves, but mainly provide words with 8-byte atomicity or cache lines with 64-byte atomicity. In addition, high-speed distributed storage systems based on PM and RDMA should implement sector atomicity functionality as part of the proprietary storage protocol.

[0005] Currently, there are two strategies for implementing read access in high-speed distributed storage systems based on PM and RDMA. One strategy includes portal access to sectors on the storage-side data nodes and coordinating read and write access. Each read and write may not be performed directly to the remote PM media using RDMA, but instead includes a server software stack for coordinating reads and writes to the same sector to provide atomicity. Another strategy includes structuring the storage data as a log, rather than writing the data in place. Structuring the storage data as a log requires maintaining metadata information about the location of the new data. Client reads may need to check the sector location in the metadata to read that location.

[0006] But both strategies may affect the performance and complexity of the solution. Instead of performing an RDMA read directly from the PM to access data, the client may send a request to the server software, which involves processing by the operating system (OS) and central processing unit (CPU) on the server side, thus seriously affecting performance. A read request may take about 4 microseconds and require multiple round trips over the network. Reading metadata is another round trip over the network and includes worse latency than a direct in-place read. Write amplification determines how many sectors need to be written to represent the user data. In a log model, write amplification may be considered high and affect RIO of expensive PM media.

[0007] Therefore, there is a need to address the above technical issues / shortcomings in the RDMA protocol and network cards to achieve sector atomicity for providing read and write operations. Summary of the invention

[0008] An object of the present invention is to provide a method for controlling random direct memory access (RDMA) to atomic data sectors and a random direct memory access (RDMA) network interface controller (RNIC) while avoiding one or more disadvantages of the prior art methods.

[0009] This object is achieved by the features of the independent claim. Further implementations are apparent from the dependent claims, the description and the drawings.

[0010] The present invention provides a method for controlling random direct memory access (RDMA) to an atomic data sector and a random direct memory access (RDMA) network interface controller (RNIC).

[0011] According to a first aspect, a method for controlling random direct memory access (RDMA) to atomic data sectors is provided. The method includes: defining a sector atomic memory area, wherein the sector atomic memory area includes one or more atomic sectors of a predefined size, and for the one or more atomic sectors, an RDMA network interface controller (RNIC) only provides access to RDMA requests for atomic sectors that are aligned to the sector size and span one or more of the sectors. The method includes: creating a counter array including several counters for each atomic sector in the sector atomic memory area. Each counter has a bit 0 configured as a write lock bit and one or more additional bits configured as read counter bits to indicate an ongoing operation with the associated atomic sector. The method includes: in response to receiving an RDMA read request for an atomic sector from a client, the RNIC uses the counter of the atomic sector to process the RDMA read request. The method includes: in response to receiving an RDMA write request for an atomic sector from a client, the RNIC issues an atomic compare and exchange operation to modify the value of the counter of the atomic sector from 0 to 1, and processes the RDMA write request according to the result of the atomic compare and exchange operation.

[0012] This method provides a best-practice approach to directly access sector atomic memory regions remotely without multiple round trips. This method does not involve the server central processing unit (CPU) and write amplification. This method modifies the read algorithm to use two atomic operations without restriction in the RDMA network.

[0013] Optionally, the processing of the RDMA read request using the counter of the atomic sector includes: incrementing the counter. If the write lock bit of the counter is set, the processing of the RDMA read request using the counter of the atomic sector includes: sending a Responder Not Ready (RNR) reply to the client. Otherwise, issuing a Direct Memory Access (DMA) read request for data of the atomic sector and sending a data reply to the client. The processing of the RDMA read request using the counter of the atomic sector includes: decrementing the counter.

[0014] Optionally, the processing of the RDMA read request using the counter of the atomic sector includes: reading the counter. If the write lock bit of the counter is set or the counter value reaches a read threshold, the processing of the RDMA read request using the counter of the atomic sector includes: sending the RNR reply to the client. The processing of the RDMA read request using the counter of the atomic sector includes: updating the counter to an incremented value of the counter using an atomic compare and swap operation. If the atomic compare and swap operation fails, returning the read of the counter. Otherwise, the processing of the RDMA read request using the counter of the atomic sector includes: issuing a DMA read request for the data of the atomic sector, decrementing the counter, and sending a data reply to the client.

[0015] Optionally, if the counter value reaches the read threshold, the method further comprises: polling the counter one or more times to check whether the counter value drops below the read threshold.

[0016] Optionally, the processing of the RDMA write request according to the result of the atomic compare and swap operation includes: if the atomic compare and swap operation is successful, issuing a DMA write request, unsetting the write lock bit of the counter, and sending a write reply to the client. Otherwise: if the write lock bit of the counter is cleared, the RNIC processing of the RDMA write request according to the result of the atomic compare and swap operation includes: setting the write lock bit of the counter, polling the counter until all read counter bits of the counter are cleared, issuing a DMA write request, unsetting the write lock bit of the counter, and sending a write reply to the client. If the write lock bit of the counter is set, the processing of the RDMA write request according to the result of the atomic compare and swap operation includes: sending the RNR reply to the client.

[0017] Optionally, limiting the sector atomic memory area includes: the RNIC limiting the sector atomic memory area within a logical memory range on a host server to which the RNIC provides access.

[0018] Optionally, creating the counter array includes: the RNIC allocating a volatile memory range for the counter array.

[0019] Optionally, the counter array comprises 8-bit counters. Each 8-bit counter has bit 1 to bit 7 configured to read the counter bit.

[0020] According to a second aspect, a remote direct memory access (RDMA) network interface controller (RNIC) is provided. The RNIC is used to define a sector atomic memory area, wherein the sector atomic memory area includes one or more atomic sectors of a predefined size, and for the one or more atomic sectors, the RNIC only provides access to RDMA requests for atomic sectors that are aligned with the sector size and span one or more sectors in the sector. The RNIC is used to create a counter array including several counters for each atomic sector in the sector atomic memory area. Each counter has a bit 0 configured as a write lock bit and one or more other bits configured as read counter bits to indicate an ongoing operation with the associated atomic sector. In response to receiving an RDMA read request for an atomic sector from a client, the RDMA read request is processed using the counter of the atomic sector. In response to receiving an RDMA write request for an atomic sector from a client, an atomic compare and swap operation is issued to modify the value of the counter of the atomic sector from 0 to 1, and the RDMA write request is processed according to the result of the atomic compare and swap operation.

[0021] RNIC provides a best-in-class solution for direct remote access to sector atomic memory regions without multiple round trips. RNIC does not involve the server central processing unit (CPU) and write amplification. RNIC modifies the read algorithm to use two atomic operations without restriction in the RDMA network.

[0022] Optionally, the RNIC is used to process the RDMA read request using the counter of the atomic sector by incrementing the counter. If the write lock bit of the counter is set, the RNIC is used to send a Responder Not Ready (RNR) reply to the client. Otherwise, the RNIC is used to issue a Direct Memory Access (DMA) read request for data of the atomic sector and send a data reply to the client. The RNIC is used to decrement the counter.

[0023] Optionally, the RNIC is used to process the RDMA read request using the counter of the atomic sector by reading the counter. If the write lock bit of the counter is set or the counter value reaches a read threshold, the RNIC is used to send the RNR reply to the client. The RNIC is used to update the counter to an incremented value of the counter using an atomic compare and swap operation. If the atomic compare and swap operation fails, the read of the counter is returned. Otherwise, the RNIC is used to process the RDMA read request using the counter of the atomic sector, including: issuing a DMA read request for data of the atomic sector, decrementing the counter, and sending a data reply to the client.

[0024] Optionally, if the counter value reaches the read threshold, the RNIC is further configured to poll the counter one or more times to check whether the counter value decreases below the read threshold.

[0025] Optionally, the RNIC is used to process the RDMA write request according to the result of the atomic compare and exchange operation in the following manner: if the atomic compare and exchange operation is successful, a DMA write request is issued, the write lock bit of the counter is unset, and a write reply is sent to the client. Otherwise, if the write lock bit of the counter is cleared, the RNIC is used to process the RDMA write request according to the result of the atomic compare and exchange operation, including: setting the write lock bit of the counter, polling the counter until all read counter bits of the counter are cleared, issuing a DMA write request, unsetting the write lock bit of the counter, and sending a write reply to the client. If the write lock bit of the counter is set, the RNIC is used to process the RDMA write request according to the result of the atomic compare and exchange operation, including: sending the RNR reply to the client.

[0026] Optionally, the RNIC is used to define the sector atomic memory area within a logical memory range on a host server to which the RNIC provides access.

[0027] Optionally, the RNIC is used to allocate a volatile memory range for the counter array.

[0028] Optionally, the counter array comprises 8-bit counters. Each 8-bit counter has bit 1 to bit 7 configured to read the counter bit.

[0029] Therefore, unlike the prior art, according to a method for controlling random direct memory access (RDMA) to atomic data sectors and a random direct memory access (RDMA) network interface controller (RNIC), direct remote access to sector atomic memory areas is provided without the need for multiple round trips.

[0030] These and other aspects of the invention are apparent from the implementations described below. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] The following is a description of the implementation of the present invention by way of example only in conjunction with the accompanying drawings, in which:

[0032] Figure 1 A system view of a Remote Direct Memory Access (RDMA) Network Interface Controller (RNIC) according to an implementation of the present invention;

[0033] Figure 2 is an exemplary system view of a Remote Direct Memory Access (RDMA) Network Interface Controller (RNIC) according to an implementation of the present invention;

[0034] Figure 3 is an exemplary timing diagram for providing direct remote access to memory for one or more clients according to one implementation of the present invention;

[0035] Figure 4A and Figure 4BA flow chart of a method for controlling remote direct memory access (RDMA) to an atomic data sector according to an implementation of the present invention is shown;

[0036] Figure 5 A computer system (eg, a client device or a Remote Direct Memory Access (RDMA) Network Interface Controller (RNIC)) is shown in which various architectures and functions of various previous implementations may be implemented. DETAILED DESCRIPTION

[0037] Various implementations of the present invention provide a method for controlling remote direct memory access (RDMA) to an atomic data sector and a remote direct memory access (RDMA) network interface controller (RNIC).

[0038] In order to make it easier for those skilled in the art to understand the solutions of the present invention, the following implementations of the present invention are described in conjunction with the accompanying drawings.

[0039] The terms "first", "second", "third" and "fourth" (if any) in the present invention content, claims and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the terms used in this way are interchangeable where appropriate, so that the various implementations of the invention described herein (for example) can be implemented in an order other than the order shown or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to the steps or units explicitly listed, but may include other steps or units that are not explicitly listed or inherent to such a process, method, product or device.

[0040] Mechanisms used:

[0041] The Remote Direct Memory Access (RDMA) protocol uses Responder Not Ready (RNR) replies to client requests to limit access under high load. The client RDMA Network Interface Controller (RNIC) retransmits the request after a short "cooling" period to process the reply.

[0042] The RNIC memory size includes more on-card memory and host memory. The RNIC can allocate memory on the host device (i.e., server) and access the memory on the host device through Direct Memory Access (DMA) on the Peripheral Component Interconnect (PCI) bus.

[0043] A memory region (MR) is a range of logical memory (i.e., PM or volatile) on a host server that an RNIC provides access to. MRs include features such as access rights (i.e., read-only or read-write) and other protection functions.

[0044] Figure 1 It is a system view of a remote direct memory access (RDMA) network interface controller (RNIC) 100 according to an implementation of the present invention. The RNIC 100 is used to define a sector atomic memory region 102, wherein the sector atomic memory region 102 includes one or more atomic sectors 104A to 104N of a predefined size, and for the one or more atomic sectors 104A to 104N, the RNIC 100 only provides access to RDMA requests for atomic sectors that are aligned to the sector size and span one or more sectors in the sector. The RNIC 100 is used to create a counter array including several counters for each atomic sector in the sector atomic memory region 102. Each counter has a bit 0 configured as a write lock bit and one or more additional bits configured as read counter bits to indicate an ongoing operation with the associated atomic sector. In response to receiving an RDMA read request for an atomic sector from a client, the RNIC 100 is used to process the RDMA read request using the counter of the atomic sector. In response to receiving an RDMA write request for an atomic sector from a client, the RNIC 100 is configured to issue an atomic compare and swap operation to modify the value of the atomic sector counter from 0 to 1, and process the RDMA write request according to the result of the atomic compare and swap operation.

[0045] RNIC 100 provides an optimal solution for directly accessing sector atomic memory regions 102 remotely without multiple round trips. RNIC 100 does not involve server central processing units (CPUs) and write amplification. RNIC 100 modifies the read algorithm to use two atomic operations without restriction in the RDMA network.

[0046] When a sector size aligned request is provided, RDMA accesses the sector atomic memory region 102. The request requirement may be to start at a sector boundary and span one or more complete sectors. If the request does not match the requirement, the RNIC 100 is used to reply an error to the client. Optionally, the sector size is consistent with the storage protocol.

[0047] When configuring the sector atomic memory region 102 on the RNIC 100, the RNIC 100 is used to allocate a volatile memory range to create an atomic counter array for each sector in the sector atomic memory region 102, creating one counter for each sector, and each counter has 8 bits. For example, if the memory range of the sector atomic memory region 102 is 1GB, the sector size is 4K, and each counter has 8 bits, an array of 1GB / 4K*16=2MB needs to be created in the card memory or the host memory.

[0048] Optionally, the RNIC 100 is used to process the RDMA read request using the counter of the atomic sector by incrementing the counter. If the write lock bit of the counter is set, the RNIC 100 is used to send a Responder Not Ready (RNR) reply to the client. Otherwise, the RNIC 100 is used to issue a Direct Memory Access (DMA) read request for the data of the atomic sector and send a data reply to the client. The RNIC 100 is used to decrement the counter.

[0049] Optionally, the RNIC 100 is used to process the RDMA read request using the counter of the atomic sector by reading the counter. If the write lock bit of the counter is set or the counter value reaches the read threshold, the RNIC 100 is used to send an RNR reply to the client. The RNIC 100 is used to update the counter to the incremented value of the counter using an atomic compare and swap operation. If the atomic compare and swap operation fails, the reading of the counter is returned. Otherwise, the RNIC 100 is used to process the RDMA read request using the counter of the atomic sector, including: issuing a DMA read request for the data of the atomic sector, decrementing the counter, and sending a data reply to the client.

[0050] Optionally, if the counter value reaches the read threshold, the RNIC 100 is further configured to poll the counter one or more times to check whether the counter value drops below the read threshold.

[0051] Optionally, the RNIC 100 is used to process the RDMA write request according to the result of the atomic compare and exchange operation in the following manner: if the atomic compare and exchange operation is successful, a DMA write request is issued, the write lock bit of the counter is unset, and a write reply is sent to the client. Otherwise, if the write lock bit of the counter is cleared, the RNIC 100 is used to process the RDMA write request according to the result of the atomic compare and exchange operation, including: setting the write lock bit of the counter, polling the counter until all read counter bits of the counter are cleared, issuing a DMA write request, unsetting the write lock bit of the counter, and sending a write reply to the client. If the write lock bit of the counter is set, the RNIC 100 is used to process the RDMA write request according to the result of the atomic compare and exchange operation, including: sending an RNR reply to the client.

[0052] Optionally, the RNIC 100 is configured to define a sector atomic memory region 102 within a logical memory range on a host server to which the RNIC 100 provides access.

[0053] Optionally, the RNIC 100 is configured to allocate a volatile memory range for the counter array.

[0054] Optionally, the counter array includes 8-bit counters. Each 8-bit counter has bits 1 to 7 configured as read counter bits. Optionally, the structure of the counter includes bit 0: a write lock bit for a write operation, and bits 1 to 7: read counter bits for a read operation.

[0055] Figure 22 is an exemplary system view 200 of a Remote Direct Memory Access (RDMA) Network Interface Controller (RNIC) 202 according to an implementation of the present invention. The system view 200 includes the RNIC 202, a memory region 204, a logical memory 206, and sector metadata 208. The RNIC 202 is configured to receive a Remote Direct Memory Access (RDMA) read request for the sector metadata 208, which automatically increments a matching counter in the sector metadata 208. The RDMA read request can be received on the memory region 204, enabling communication with the sector metadata 208 to increment the counter. Optionally, the algorithm for the increment in the matching counter includes (atomic_fetch_inc). If the counter value including bit 0 is set to the "write lock bit", the RNIC 202 performs a write operation. If bit 0 is cleared, a DMA read of the data is issued and a data reply is sent back. When the DMA read is completed, the atomic counter is decremented back to indicate that the read is complete. Optionally, the algorithm for decrementing the match counter includes (atomic_fetch_dec). The RNIC 202 is used to send a Responder NotReady (RNR) reply to the client. The logical memory 206 can access the RNIC 202 for read and write operations.

[0056] The read algorithm used by the RNIC 202 to read the sector metadata 208 is as follows:

[0057]

[0058] RNIC 202 is used to receive an RDMA write request for sector metadata 208, and RNIC 202 issues an atomic compare and exchange operation to the matching counter to modify the value from 0 to 1. Optionally, the atomic compare and exchange operation is performed by (atomic_cas). Value 0 may not include a reader / writer, and value 1 may include a write lock. If the atomic compare and exchange operation is successful, the sector metadata 208 is locked, the atomic compare and exchange operation continues, and enables RNIC 202 to issue a direct memory access (DMA) write, unset bit 0 after the atomic compare and exchange operation is completed, and send a reply to the client. If the atomic compare and exchange operation fails, RNIC 202 is used to automatically set bit 0 to indicate that the write request is suspended, and poll the counter until all reads are completed, that is, clear the read counter bit. The suspended write request can prevent the read operation and enable RNIC 202 to continue the write operation after clearing the read counter bit. If the RNIC 202 has set bit 0, and a write operation is pending, the RNIC 202 is operable to reply an RNR to the client.

[0059] The write algorithm for RNIC 202 to write sector metadata 208 is as follows:

[0060]

[0061]

[0062] Figure 3 300 is an exemplary timing diagram for providing direct remote access to memory for one or more clients 302A and 302B according to an implementation of the present invention. The timing diagram 300 includes one or more clients 302A and 302B and a memory server 304 associated with the memory. The one or more clients include a first client 302A and a second client 302B. The memory server 304 associated with the memory can be a logical memory or a volatile memory. The timing diagram 300 provides direct remote access to the memory server 304 as a storage medium with sector atomicity. The read algorithm can be modified to modify the counter using two atomic operations. The two atomic operations can be reading the counter and checking for overflow conditions, and updating the counter using an atomic compare and swap operation. Optionally, the atomic compare and swap operation is an atomic compare and swap operation.

[0063] In step 306, the second client 302B sends a first RDMA Read Sector X to the memory server 304. In step 308, the memory server 304 sends an acknowledgment of the old data of the first RDMA Read Sector X. In step 310, the first client 302A sends an RDMA Write Sector X to the memory server 304. In step 312, the second client 302B sends an RDMA Read Sector X to the memory server 304. In step 314, when the write request from the first client 302A is pending, the memory server 304 sends a Responder Not Ready (RNR) to the second client 302B. In step 316, the memory server 304 sends a write acknowledgment of the RDMA Write Sector X to the first client 302A. In step 318, the second client 302B sends an RDMA Read Offset X to the memory server 304. In step 320, the memory server 304 sends an acknowledgment of the new data of the RDMA Read Offset X.

[0064] The reading algorithm can be as follows:

[0065]

[0066] Optionally, the optimization of direct remote access polls the atomic counter one or more times without sending an RNR if the counter is released.

[0067] Figure 4A and Figure 4BA flowchart of a method for controlling remote direct memory access (RDMA) to atomic data sectors according to an implementation of the present invention is shown. In step 402, a sector atomic memory area is defined, wherein the sector atomic memory area includes one or more atomic sectors of a predefined size, and for the one or more atomic sectors, an RDMA network interface controller (RDMA network interface controller, RNIC) only provides access to RDMA requests for atomic sectors that are aligned to sector size and span one or more sectors in the sector. In step 404, a counter array including several counters is created for each atomic sector in the sector atomic memory area. Each counter has a bit 0 configured as a write lock bit and one or more other bits configured as a read counter bit to indicate an ongoing operation with the associated atomic sector. In step 406, in response to receiving an RDMA read request to an atomic sector from a client, the RNIC uses the counter of the atomic sector to process the RDMA read request. In step 408, in response to receiving an RDMA write request for an atomic sector from the client, the RNIC issues an atomic compare and swap operation to modify the value of the atomic sector's counter from 0 to 1, and processes the RDMA write request according to the result of the atomic compare and swap operation.

[0068] This method provides a best-practice approach to directly access sector atomic memory regions remotely without multiple round trips. This method does not involve the server central processing unit (CPU) and write amplification. This method modifies the read algorithm to use two atomic operations without restriction in the RDMA network.

[0069] Optionally, processing the RDMA read request using the counter of the atomic sector includes: incrementing the counter. If the write lock bit of the counter is set, processing the RDMA read request using the counter of the atomic sector includes: sending a responder not ready (RNR) reply to the client. Otherwise, issuing a direct memory access (DMA) read request for data of the atomic sector and sending a data reply to the client. Processing the RDMA read request using the counter of the atomic sector includes: decrementing the counter.

[0070] Optionally, processing an RDMA read request using a counter of an atomic sector includes: reading a counter. If the write lock bit of the counter is set or the counter value reaches a read threshold, processing an RDMA read request using a counter of an atomic sector includes: sending an RNR reply to a client. Processing an RDMA read request using a counter of an atomic sector includes: updating the counter to an incremented value of the counter using an atomic compare and swap operation. If the atomic compare and swap operation fails, returning the read of the counter. Otherwise, processing an RDMA read request using a counter of an atomic sector includes: issuing a DMA read request for data of the atomic sector, decrementing the counter, and sending a data reply to the client.

[0071] Optionally, if the counter value reaches the read threshold, the method further comprises: polling the counter one or more times to check whether the counter value drops below the read threshold.

[0072] Optionally, processing the RDMA write request according to the result of the atomic compare and swap operation includes: if the atomic compare and swap operation is successful, issuing a DMA write request, unsetting the write lock bit of the counter, and sending a write reply to the client. Otherwise: if the write lock bit of the counter is cleared, the RNIC processes the RDMA write request according to the result of the atomic compare and swap operation, including: setting the write lock bit of the counter, polling the counter until all read counter bits of the counter are cleared, issuing a DMA write request, unsetting the write lock bit of the counter, and sending a write reply to the client. If the write lock bit of the counter is set, processing the RDMA write request according to the result of the atomic compare and swap operation includes: sending an RNR reply to the client.

[0073] Optionally, limiting the sector atomic memory region includes: the RNIC limiting the sector atomic memory region within a logical memory range on a host server to which the RNIC provides access.

[0074] Optionally, creating the counter array includes: the RNIC allocating a volatile memory range for the counter array.

[0075] Optionally, the counter array comprises 8-bit counters. Each 8-bit counter has bit 1 to bit 7 configured to read the counter bit.

[0076] Figure 5A computer system (e.g., a client device or a remote direct memory access (RDMA) network interface controller (RNIC)) is shown in which various architectures and functions of various previous implementations can be implemented. As shown, the computer system 500 includes at least one processor 504 connected to a bus 502, wherein the computer system 500 can be implemented using any suitable protocol, such as Peripheral Component Interconnect (PCI), PCI-Express, Accelerated Graphics Port (AGP), HYPE or any other bus or point-to-point communication protocol. The computer system 500 also includes a memory 506.

[0077] The control logic (software) and data are stored in the memory 506, which may be a random-access memory (RAM). In the present invention, a single semiconductor platform may refer to a unique integrated circuit or chip based on a single semiconductor. It should be noted that the term "single semiconductor platform" may also refer to a multi-chip module with increased connectivity, which simulates the operation of on-chip modules with increased connectivity, achieving significant improvements over the use of traditional central processing units (CPUs) and buses. Of course, various modules may also be added individually or in various combinations of semiconductor platforms according to user needs.

[0078] The computer system 500 may also include an auxiliary memory 510. The auxiliary memory 510 includes a hard disk drive and a removable storage drive, such as a floppy disk drive, a tape drive, a compact disk drive, a digital versatile disk (DVD) drive, a recording device, a universal serial bus (USB) flash memory. The removable storage drive reads from and writes to at least one of the removable storage units in a well-known manner.

[0079] A computer program or computer control logic algorithm may be stored in at least one of the memory 506 and the auxiliary storage 510. When such a computer program is executed, the computer program enables the computer system 500 to perform various functions as described above. The memory 506, the auxiliary storage 510 and any other storage are computer-readable media.

[0080] In one implementation, the architecture and functionality described in the various previous figures may be implemented in the context of a processor 504, a graphics processor coupled to a communication interface 512, an integrated circuit (not shown) capable of having at least a portion of the capabilities of both the processor 504 and the graphics processor, and a chipset (i.e., a group of integrated circuits designed to operate and be sold as a unit that performs related functions, etc.).

[0081] In addition, the architecture and functions described in the various figures described previously can be implemented in the context of a general-purpose computer system, a circuit board system, a gaming system dedicated to entertainment purposes, or an application-specific system. For example, the computer system 500 can take the form of a desktop computer, a laptop computer, a server, a workstation, a gaming machine, or an embedded system.

[0082] Furthermore, the computer system 500 may take the form of various other devices, including but not limited to a personal digital assistant (PDA) device, a mobile phone device, a smart phone, a television, etc. In addition, although not shown, the computer system 500 may be coupled to a network (e.g., a telecommunications network, a local area network (LAN), a wireless network, a wide area network (WAN) such as the Internet, a peer-to-peer network, a wired network, etc.) via an I / O interface 508 for communication purposes.

[0083] It should be understood that the arrangement of components shown in the described figures is exemplary, and other arrangements are possible. It should also be understood that the various system components (and devices) defined by the claims, described below, and shown in the various block diagrams represent components in some systems configured according to the subject matter disclosed herein. For example, one or more of these system components (and devices) can be implemented in whole or in part by at least some of the components shown in the arrangements shown in the described figures.

[0084] Furthermore, while at least one of these components is at least partially implemented as an electronic hardware component and thus constitutes a machine, other components may be implemented in software which, when included in an execution environment, constitutes a machine, hardware, or a combination of software and hardware.

[0085] Although the present invention and its advantages have been described in detail, it should be understood that various changes, substitutions and alterations can be made herein without departing from the spirit and scope of the invention as defined by the appended claims.

Claims

1. A method for controlling remote direct memory access (RDMA) to an atomic data sector, characterized in that: include: defining a sector atomic memory region (102), wherein the sector atomic memory region (102) includes a plurality of atomic sectors (104A to 104N) of a predefined size, for which an RDMA network interface controller (RNIC) (100, 202) only provides access to RDMA requests for atomic sectors that are aligned to the sector size and span one or more of the sectors; Creating a counter array including several counters for each atomic sector in the sector atomic memory region (102), wherein each counter has a bit 0 configured as a write lock bit and one or more additional bits configured as read counter bits to indicate an ongoing operation with the associated atomic sector; In response to receiving an RDMA read request for an atomic sector from a client, the RNIC (100, 202) processes the RDMA read request using a counter of the atomic sector; In response to receiving an RDMA write request for an atomic sector from a client, the RNIC (100, 202) issues an atomic compare and swap operation to modify the value of the atomic sector's counter from 0 to 1, and processes the RDMA write request according to a result of the atomic compare and swap operation.

2. The method according to claim 1, characterized in that: The processing of the RDMA read request using the counter of the atomic sector comprises: incrementing the counter; If the write lock bit of the counter is set, sending a Responder Not Ready (RNR) reply to the client; Otherwise, issuing a direct memory access (DMA) read request for the data of the atomic sector, and sending a data reply to the client; Decrement the counter.

3. The method according to claim 1 or 2, characterized in that: The processing of the RDMA read request using the counter of the atomic sector comprises: reading the counter; If the write lock bit of the counter is set or the counter value reaches a read threshold, sending the RNR reply to the client; updating the counter to the incremented value of the counter using an atomic compare and swap operation; If the atomic compare-and-swap operation fails, returning the read of the counter; Otherwise, a DMA read request for the data of the atomic sector is issued, the counter is decremented, and a data reply is sent to the client.

4. The method according to claim 3, characterized in that If the counter value reaches the read threshold, the method further comprises polling the counter one or more times to check whether the counter value drops below the read threshold.

5. The method according to any one of claims 1 to 4, characterized in that Processing the RDMA write request according to the result of the atomic compare and exchange operation includes: If the atomic compare and swap operation is successful, a DMA write request is issued, the write lock bit of the counter is unset, and a write reply is sent to the client; otherwise: If the write lock bit of the counter is cleared, the RNIC (100, 202) sets the write lock bit of the counter, polls the counter until all read counter bits of the counter are cleared, issues a DMA write request, unsets the write lock bit of the counter, and sends a write reply to the client; If the write lock bit of the counter is set, the RNIC (100, 202) sends the RNR reply to the client.

6. The method according to any one of claims 1 to 5, characterized in that Defining the sector atomic memory region (102) includes: the RNIC (100, 202) defining the sector atomic memory region (102) within a logical memory range on a host server to which the RNIC (100, 202) provides access.

7. The method according to any one of claims 1 to 6, characterized in that The creating of the counter array includes the RNIC (100, 202) allocating a volatile memory range for the counter array.

8. The method according to any one of claims 1 to 7, characterized in that The counter array includes 8-bit counters, wherein each 8-bit counter has bit 1 to bit 7 configured to read the counter bit.

9. A remote direct memory access (RDMA) network interface controller (RNIC) (100, 202), characterized in that: Used for: defining a sector atomic memory region (102), wherein the sector atomic memory region (102) comprises a plurality of atomic sectors of a predefined size, for which the RNIC (100, 202) provides access only to RDMA requests for atomic sectors that are aligned to the sector size and span one or more of the sectors; Creating a counter array including several counters for each atomic sector in the sector atomic memory region (102), wherein each counter has a bit 0 configured as a write lock bit and one or more additional bits configured as read counter bits to indicate an ongoing operation with the associated atomic sector; In response to receiving an RDMA read request for an atomic sector from a client, processing the RDMA read request using a counter of the atomic sector; In response to receiving an RDMA write request for an atomic sector from a client, an atomic compare and swap operation is issued to modify the value of the counter of the atomic sector from 0 to 1, and the RDMA write request is processed according to a result of the atomic compare and swap operation.

10. The RNIC (100, 202) according to claim 9, characterized in that for processing the RDMA read request using the counter of the atomic sector in the following manner: incrementing the counter; If the write lock bit of the counter is set, sending a Responder Not Ready (RNR) reply to the client; Otherwise, issuing a direct memory access (DMA) read request for the data of the atomic sector, and sending a data reply to the client; Decrement the counter.

11. The RNIC (100, 202) according to claim 9 or 10, characterized in that: for processing the RDMA read request using the counter of the atomic sector in the following manner: reading the counter; If the write lock bit of the counter is set or the counter value reaches a read threshold, sending the RNR reply to the client; updating the counter to the incremented value of the counter using an atomic compare and swap operation; If the atomic compare-and-swap operation fails, returning the read of the counter; Otherwise, a DMA read request for the data of the atomic sector is issued, the counter is decremented, and a data reply is sent to the client.

12. The RNIC (100, 202) according to claim 11, characterized in that If the counter value reaches the read threshold, the RNIC (100, 202) is further configured to poll the counter one or more times to check whether the counter value decreases below the read threshold.

13. The RNIC (100, 202) according to any one of claims 9 to 12, characterized in that for processing the RDMA write request according to the result of the atomic comparison and exchange operation in the following manner: If the atomic compare and swap operation is successful, a DMA write request is issued, the write lock bit of the counter is unset, and a write reply is sent to the client; otherwise: If the write lock bit of the counter is cleared, setting the write lock bit of the counter, polling the counter until all read counter bits of the counter are cleared, issuing a DMA write request, unsetting the write lock bit of the counter, and sending a write reply to the client; If the write lock bit of the counter is set, the RNR reply is sent to the client.

14. The RNIC (100, 202) according to any one of claims 9 to 13, characterized in that The sector atomic memory region (102) is used to define the sector atomic memory region (102) within a logical memory range on a host server to which the RNIC (100, 202) provides access.

15. The RNIC (100, 202) according to any one of claims 9 to 14, characterized in that Used to allocate a volatile memory range for the counter array.

16. The RNIC (100, 202) according to any one of claims 9 to 15, characterized in that The counter array includes 8-bit counters, wherein each 8-bit counter has bit 1 to bit 7 configured to read the counter bit.