CXL pooling shared memory-oriented read-write consistency guarantee method

By using CXL pooled shared memory and decentralized read-write hierarchical queue locks, the problem of poor read-write consistency performance in distributed computing systems is solved, resulting in lower latency and higher throughput, and improving the scalability and performance of the system.

CN121116664AActive Publication Date: 2025-12-12TIANJIN UNIV
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202511224279.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-29
Publication Date
2025-12-12
Estimated Expiration
2045-08-29

AI Technical Summary

Technical Problem

Existing distributed computing systems perform poorly in ensuring read-write consistency, suffer from high network communication latency and overhead, and experience frequent contention failures due to pessimistic concurrency control, thus failing to effectively resolve concurrency conflicts.

Method used

By adopting CXL pooled shared memory technology, and through decentralized read/write hierarchical queue locks and shared object management, a high-performance and highly scalable concurrency control method is designed to reduce data synchronization overhead and optimize concurrency control.

Benefits of technology

It achieves faster data synchronization performance and lower concurrency control overhead, reducing the latency of a single pessimistic concurrency control to 200-300 nanoseconds, increasing throughput by 7.9-16.8 times, and significantly improving performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121116664A_ABST
    Figure CN121116664A_ABST
Patent Text Reader

Abstract

The invention discloses a read-write consistency guarantee method for a CXL pooling shared memory, and belongs to the technical field of read-write consistency. According to the invention, CXL memory access is used to replace a network communication mode, and better performance is provided. And meanwhile, message passing is converted into direct reading and writing of the shared data structure, so that additional message passing caused by protocols such as 2PC and the like is avoided. And a decentralized control mode is adopted, so that the performance bottleneck of centralized control is avoided. Optimization of read-write semantics is provided for requests, and a queue lock is designed for optimizing competition among multiple nodes. Meanwhile, in consideration that the time delay of the CXL memory is still higher than the time delay of the local memory, layered perception optimization is added. And a dynamic polling mode is provided for frequent competition failures, so that the problem of high failure overhead is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of read-write consistency technology, specifically to a method for ensuring read-write consistency based on CXL pooled shared memory in a distributed computing system scenario. Background Technology

[0002] To overcome the performance bottleneck of single-machine computing, distributed computing systems emerged. Distributed computing systems leverage horizontal scaling to achieve high performance, high availability, and large capacity that single machines cannot provide. By interconnecting multiple independent computing nodes, they collaboratively complete single or group computing tasks, thus providing higher computing performance. In distributed computing systems, read-write consistency is crucial for ensuring correctness and reliability. Read-write consistency requires that when a distributed computing system handles multiple requests, read operations can retrieve the latest write operation results, ensuring data accuracy and timeliness. The key to ensuring read-write consistency lies in guaranteeing data consistency and resolving concurrency conflicts. Data consistency means that when different nodes access the same data, their access to the data needs to be synchronized according to pre-agreed consistency semantics. Concurrency conflicts, on the other hand, require that when multiple nodes handle multiple concurrent operations that overlap in time or sequence, the system avoids violating expected consistency semantics or generating data errors.

[0003] Existing distributed computing systems perform poorly in ensuring strong consistency semantics. These systems rely on network communication for data synchronization between nodes to guarantee consistency. A single network communication session typically requires a latency of 1-5 milliseconds, while using methods like RDMA can result in latency of 50-200 microseconds. This is 3-5 orders of magnitude higher than the 100 nanosecond latency of single-machine memory access, leading to very high overhead in synchronous data copying between different nodes. Furthermore, data synchronization is highly susceptible to network fluctuations. In complex network environments, such as those with network congestion, network failures, or large physical distances between nodes, data transmission latency increases significantly. Besides the network overhead affecting data consistency, the pessimistic concurrency control used by existing distributed computing systems to ensure strong consistency semantics also incurs high overhead. This relies on software-based synchronization algorithms such as 2PC, Paxos, and Raft, which further increase overhead due to frequent information exchanges between multiple nodes. In addition, because pessimistic concurrency control uses a relatively strict control method, it can lead to a large number of contention failures when multiple nodes handle concurrent conflicts. These failed contention failures also impose additional communication and control burdens on the system, resulting in higher overhead.

[0004] With the emergence of new hardware such as CXL3.0, distributed computing systems are expected to achieve better performance and higher performance ceilings. CXL memory supports direct CPU access via load / store instructions and can provide access latency in the range of 200-400 nanoseconds. CXL3.0 further supports cross-node pooled memory sharing and cache consistency guarantees. It allows data to be shared across nodes and can synchronize data across nodes based on hardware-guaranteed cache consistency. Although data synchronization can be more efficient with CXL3.0's cache consistency, it cannot solve concurrency conflicts and therefore cannot directly provide read-write consistency guarantees.

[0005] To address the aforementioned issues, this invention proposes a read-write consistency guarantee method for CXL pooled shared memory. Summary of the Invention

[0006] The purpose of this invention is to propose a read-write consistency guarantee method for CXL pooled shared memory to solve the problem of high overhead in maintaining read-write consistency in distributed computing systems. This invention provides faster data synchronization performance and lower concurrency control overhead for distributed computing systems through CXL pooled shared memory.

[0007] To achieve the above objectives, the present invention adopts the following technical solution:

[0008] A method for ensuring read-write consistency for CXL pooled shared memory includes the following:

[0009] S1. System Architecture Optimization Design: Design a system architecture for CXL pooled shared memory, reduce the overhead of data synchronization by sharing data through CXL pooled shared memory, and provide a high-performance and highly scalable concurrency control method with a decentralized read-write hierarchical queue lock method;

[0010] S2. Concurrency Control Design: Based on the decentralized read-write hierarchical queue lock described in S1, pessimistic concurrency control is implemented to ensure concurrency control under strong consistency semantics.

[0011] S3. Shared object management design: By providing the cxl_malloc() interface, nodes can explicitly request shared objects.

[0012] Preferably, S1 specifically includes the following:

[0013] The CXL pooled shared memory region is divided into a CXL pooled shared memory allocation region and a CXL pooled shared memory management region; the CXL pooled shared memory allocation region is used to allocate the main area of ​​CXL pooled shared memory, and the CXL pooled shared memory management region is used to store the header information of the management components.

[0014] The CXL pooled shared memory management area includes a pooled shared memory management module and a shared object management module. The pooled shared memory management module is used to manage specific pooled shared memory allocations. The shared object management module is used to maintain relevant management information of objects requesting pooled shared memory. It interacts with the underlying pooled memory management module to request shared memory for each shared object and generate corresponding references.

[0015] CXL pooled shared memory is mapped to local virtual memory through remapping; the decentralized read-write hierarchical queue lock consists of a global read-write queue lock in the CXL pooled shared memory management area and a local read-write queue lock in local memory; the read-write hierarchical queue lock transfers lock ownership according to the principle of write priority, followed by local priority; the global read-write queue lock also interacts with the underlying pooled shared memory management module to request shared memory for shared lock status information.

[0016] Preferably, S2 specifically includes the following:

[0017] The first read request to be processed first requests a local read lock from the local read-write queue lock module, and then requests a global read lock from the global read-write queue lock module. After both requests are successfully obtained, the current read request is processed. Subsequent read requests are executed directly because the local system has already obtained a global read lock.

[0018] When the first write request arrives, it immediately blocks subsequent local and global read requests and creates corresponding local and global queue lock nodes; it waits for the unfinished read requests and the transfer of lock ownership by spinning through the flag bits in the queue lock node.

[0019] After all previous read requests have finished, the last read request is responsible for releasing the global read lock and waking up the first waiting write request. When a write request is being processed or waiting, subsequent write requests will be queued in the queue and write a reference to their own queue lock node to the predecessor node. Then, they will spin to access the flag of their own queue lock node to wait to be woken up.

[0020] After the predecessor node finishes execution, it sets the flag of the successor node to 1 according to the reference to wake up the successor node. When waking up the successor node, it first wakes up local write requests that are waiting, and then wakes up remote write requests. When the successor node reference is null, it releases the write lock and transfers the ownership of the lock back to the read lock.

[0021] When read / write requests are spinning, add dynamic polling to reduce unnecessary memory access requests and optimize failure overhead.

[0022] Preferably, the global queue lock node represents the read / write state of an entire node, which is used to avoid frequent contention and modification of the node state by different threads in the same node.

[0023] Preferably, S3 specifically includes the following:

[0024] The node first calls the cxl_malloc() interface to request the creation of a shared object from the shared object management module. During the creation process, the node provides the name of the shared object, the size to be created, and the creation mode, where the creation mode includes read-only (RO) and read-write (RW). The shared object management module calculates the corresponding hash directory location based on the name of the shared object provided by the node and creates the metadata CXL_HEADER for the shared object reference. Hash collisions are resolved using hash buckets. The metadata includes the offset, size, mode, and reference count information of the shared object in the CXL pooled shared memory.

[0025] Then it interacts with the underlying pooled shared memory management module, calls its interface to request memory of the corresponding size, and records the offset in the reference metadata;

[0026] Finally, a reference CXL_OBJECT is generated and returned to the node. The reference records the name, size, and address of the shared object. CXL pooled shared memory is mapped into the node's virtual address space through remapping.

[0027] The present invention further protects a computer device, the computer device including a processor and a memory, the memory storing at least one instruction, at least one program, code set or instruction set, the instruction, program, code set or instruction set being loaded and executed by the processor to implement the above-mentioned method for ensuring read-write consistency for CXL pooled shared memory.

[0028] The present invention further protects a computer-readable storage medium storing at least one instruction, at least one program, code set, or instruction set, wherein the instruction, program, code set, or instruction set is loaded and executed by a processor to implement the above-mentioned method for ensuring read-write consistency for CXL pooled shared memory.

[0029] Compared with existing technologies, this invention provides a method for ensuring read-write consistency for CXL pooled shared memory, which has the following advantages:

[0030] (1) This invention proposes a read-write consistency guarantee method for CXL pooled shared memory, implementing a pooled shared memory object management scheme that allows nodes to access data across nodes via CXL pooled shared memory. It also implements a decentralized read-write hierarchical queue lock based on cache consistency for concurrent control with strong consistency semantics. Compared to existing work, this invention replaces network communication with CXL memory access, providing better performance. Furthermore, by converting message passing into direct read-write of shared data structures, it avoids the additional message passing required by protocols such as 2PC. The decentralized control method avoids the performance bottleneck of centralized control. Optimizations to read-write semantics are provided for requests, and a queue lock is designed to optimize contention among multiple nodes. Considering that CXL memory latency is still higher than local memory latency, this invention also adds hierarchical awareness optimization. Finally, a dynamic polling method is provided to address frequent contention failures, optimizing for high failure overhead.

[0031] (2) Compared to existing technologies, this invention can reduce the average latency of a single pessimistic concurrency control to about 200-300 nanoseconds while ensuring read-write consistency, achieving an improvement of several orders of magnitude compared to traditional solutions. This invention can increase throughput to three to four million requests per second under the same service level objective. In high-load and high-concurrency scenarios, this invention can provide more than 7.9-16.8 times the throughput of existing work, exhibiting better scalability and higher performance. Attached Figure Description

[0032] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0033] Figure 1 This is an overall architecture diagram of a read-write consistency guarantee method for CXL pooled shared memory proposed in this invention;

[0034] Figure 2 This is a schematic diagram of the concurrency control scheme proposed in this invention;

[0035] Figure 3 This is a schematic diagram of the shared object management scheme proposed in this invention;

[0036] Figure 4 This is a schematic diagram of the pooled shared memory management scheme proposed in this invention. Detailed Implementation

[0037] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments.

[0038] Example 1:

[0039] This invention proposes a read-write consistency guarantee method for CXL pooled shared memory, which specifically includes the following:

[0040] 1. System Architecture

[0041] To overcome the shortcomings of existing solutions and achieve lower read / write consistency overhead in distributed computing scenarios, this invention proposes a read / write consistency guarantee method based on CXL pooled shared memory. The core idea of ​​this invention is to reduce the overhead of data synchronization by sharing data through CXL pooled shared memory, and to provide a high-performance and highly scalable concurrency control method using a decentralized read / write hierarchical queue lock approach.

[0042] Please see Figure 1 , Figure 1 The overall architecture of this invention is illustrated. The CXL pooled shared memory region is divided into two parts: the CXL pooled shared memory allocation region, which is the main area for allocating CXL pooled shared memory, and the CXL pooled shared memory management region, which is mainly used to store the header information of the management components. The pooled shared memory management module is responsible for managing the specific pooled shared memory allocation, while the shared object management module maintains the relevant management information of the objects requesting pooled shared memory. It needs to interact with the underlying pooled memory management module to request shared memory for each shared object and generate corresponding references. CXL pooled shared memory is mapped to local virtual memory through remapping. The decentralized read-write hierarchical queue lock consists of a global read-write queue lock in the CXL pooled shared memory management region and a local read-write queue lock in local memory. The read-write hierarchical queue lock follows the principle of write priority, followed by local priority, to transfer lock ownership. The global read-write queue lock also interacts with the underlying pooled shared memory management module to request shared memory for shared lock state information.

[0043] 2. Concurrency Control Scheme

[0044] This invention uses a decentralized read-write hierarchical queue lock to perform pessimistic concurrency control, ensuring concurrency control under strong consistency semantics. Figure 2The specific flow of the concurrency control scheme is demonstrated. The first read request to be processed first requests a local read lock from the local read-write queue lock module, and then requests a global read lock from the global read-write queue lock module. Only after both requests are successfully acquired can the current read request continue to be processed. Subsequent read requests can be executed directly since the global read lock has already been acquired locally. When the first write request arrives, it immediately blocks subsequent local and global read requests and creates corresponding local and global queue lock nodes. It spins to access the flags in the queue lock nodes to wait for the transfer of ownership of the locks and the preceding unfinished read requests. After all the preceding read requests have finished, the last read request is responsible for releasing the global read lock and waking up the first waiting write request. When a write request is being processed or waiting, subsequent write requests will queue up in the queue and write a reference to their own queue lock node to the predecessor node. Then, they spin to access the flags in their own queue lock nodes to wait to be woken up. After the predecessor node finishes execution, it sets the flag of the successor node to 1 according to the reference to wake up the successor node. When waking up a successor node, local write requests that are currently waiting are woken up first, followed by remote write requests. When the successor node reference is null, the write lock is released, and ownership of the lock is transferred back to the read lock. This invention adds a dynamic polling method to reduce unnecessary memory access requests and optimize failure overhead during read / write request spin-waiting.

[0045] In a global queue lock, each node represents the read / write state of an entire node, preventing frequent contention and modification of the node's state by different threads within the same node. Furthermore, only the last read request is responsible for waking up the first waiting write request, thus avoiding multiple accesses to the states of multiple read requests by write requests and reducing state synchronization overhead. Considering that CXL pooled shared memory has higher access latency and lower bandwidth compared to local memory, this invention also features a layered optimization for the queue lock. Only the read / write state of the node is recorded in the CXL pooled shared memory, while the read / write state between different threads within each node is maintained in the local memory of each node. Only the first and last requests in a read or write request sequence are responsible for interacting with the CXL pooled shared memory. This significantly avoids frequent contention and modification of the CXL pooled shared memory, reduces the overhead of pessimistic concurrency control, and improves the performance and scalability of pessimistic concurrency control.

[0046] 3. Shared Object Management Solution

[0047] This invention allows nodes to explicitly request shared objects by providing interfaces such as cxl_malloc(). Figure 3This demonstrates the specific details and process of the shared object management scheme. The node first calls the `cxl_malloc()` interface to request the creation of a shared object from the shared object management module. This process requires the node to provide the name of the shared object, its size, and its creation mode. Creation modes include read-only (RO) and read-write (RW). The shared object management module calculates the corresponding hash directory location based on the provided name and creates the metadata `CXL_HEADER` for the shared object reference. Hash collisions are resolved using hash buckets. The metadata includes information such as the shared object's offset, size, mode, and reference count within the CXL pooled shared memory. Next, it interacts with the underlying pooled shared memory management module, calling its interface to request memory of the corresponding size and recording the offset in the reference metadata. Finally, a reference `CXL_OBJECT` is generated and returned to the node. A reference records the shared object's name, size, and address. The CXL pooled shared memory is mapped into the node's virtual address space through remapping. The node does not need to worry about the management of underlying offsets and other related information; instead, it can directly read and write to the address through the mapped virtual address. Although nodes explicitly request shared memory objects, they can still be read and written directly by manipulating their addresses, without needing a system-provided read / write interface. Managing shared objects using this remapping and reference method also avoids copying during data synchronization. Different nodes can directly access the same shared data.

[0048] Example 2:

[0049] Based on Embodiment 1, but with a difference, the read-write consistency guarantee method for CXL pooled shared memory proposed in this invention is described below with specific examples. The details are as follows:

[0050] 1. Implementation of read-write hierarchical queue lock

[0051] The specific implementation details of read-write hierarchical queue locks are as follows: Figure 2 As shown. `thread_id` is used for mutually exclusive modification of the local / global lock state. `mode` represents the current local / global read / write state, 0 for read and 1 for write. `global` indicates whether the current node has acquired the global read lock, 0 for not acquired and 1 for acquired. `maxR` represents the total number of local read requests. `nR` represents the number of completed local read requests. `tR` represents the total number of local read requests on the current node when write requests block local read requests. `front` and `tail` maintain pointer references to the head and tail nodes of the queue lock, respectively. `maxH` represents the total number of read nodes. `nH` represents the number of completed read nodes. `tH` represents the total number of read nodes when write requests block global read requests.

[0052] When the first read request acquires both the local and global read locks, it increments `maxR` and `maxH` by 1, respectively. Since `mode` is 0 at this point, the first read request successfully acquires the locks. After acquiring the global read lock, the first read request modifies `global` to 1. Subsequent read requests then spin on the value of `global`; when `global` is 1, subsequent read requests can execute normally. When the first write request arrives, it first sets both the local and global `mode` to 1, indicating that it has entered write mode. Subsequent read requests must wait for the write mode to end and the request to revert to read mode before continuing. The first write request also records that `tR` / `tH` are now `maxR` / `maxH`, creates local and global queue lock nodes, and then spins until the flags of `node-A` and `node-1` both become 1. At this point, both the `front` and `tail` pointers point to `node-1` / `node-A`. When a new local write request arrives, it finds `mode` is 1, indicating that it has entered write mode. Therefore, it directly adds itself to the tail of the queue and the `next` pointer of its predecessor node `node-1`, and maintains and updates the `tail` pointer. Then it spins and waits until node-2's flag becomes 1. Note that at this point, it only adds to the local queue, not the global queue. When node B's write request acquires the global write lock, it finds that the mode in the global lock is 1, so it directly adds its own node to the end of the global queue and spins and waits for node-B's flag to become 1. When a previous read request ends, each read request increments nR by 1. When nR equals tR, it means that this read request is the last one to end in the read request sequence. At this time, this read request will increment nH by 1 and also check if nH equals tH. If they are equal, it sets the flag in node-A pointed to by front to 1 to release the global read lock. At the same time, since it is also the last local read request, it will also set node-1's flag to 1 to release the local read lock.

[0053] After this, the first write request successfully acquires both the global and local write locks and begins processing. When the write request finishes, it detects that the `next` pointer in node-1 is not null. Therefore, it prioritizes transferring ownership of the lock to the next local write request. When the last local write request finishes processing, it finds that the `next` pointer of its own queue lock node-3 is null. At this point, the last write request is responsible for transferring the global write lock to the next node, setting node-B's flag to 1 and its local mode to 0. After node B's first write request spins and detects that node-B's flag is 1, it begins executing the write request normally and transfers the write lock to the next local write request after completion. When the last write request finishes, it finds that node-B's `next` pointer is null, indicating that there are no subsequent write requests waiting in the entire cluster. At this point, it sets the global mode to 0 and also sets the local mode to 0, finally transferring the write lock back to the read lock. Subsequent read requests can acquire the lock and execute normally.

[0054] 2. Pooled Shared Memory Management Scheme

[0055] Using CXL pooled shared memory to share data requires a solution that can manage CXL pooled shared memory across nodes. Figure 4 The diagram illustrates the specific architecture of the management scheme. The CXL pooled shared memory allocation area is divided into three abstract levels, from highest to lowest: segment, slab, and block. The entire allocation area is divided into multiple segments of fixed size, and each segment is further divided into multiple slabs of fixed size. Slab 0 stores the metadata of the segment and other slabs, while the other slabs store the actual shared data blocks. Slab metadata is stored as an array, containing `free` and `local_free` pointers. The `free` pointer points to the first available block in the slab, while the `local_free` pointer points to the first freed block for future recycling. Blocks are organized as linked lists, maintained via `next` pointers. The size of blocks within a slab is allocated based on specific request requirements. The block size within each slab is the same, but the block sizes may differ between different slabs.

[0056] Each thread, when requesting CXL pooled shared memory, generates a CXL thread-private storage in the management module. This storage generates a globally unique `thread_id` based on the MAC address of the node where the thread resides and the thread's tid. `used` is used to maintain reference counting information to mark whether the memory region should be reclaimed. `slab_queue` records the specific slab allocated to the thread, also organized as a linked list. When a thread initially requests memory, it pre-allocates an entire segment space; subsequent memory requests are made from this segment until space is insufficient, at which point a new segment is requested. This avoids frequent synchronization overhead.

[0057] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. For those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A method for ensuring read-write consistency for CXL pooled shared memory, characterized in that, Includes the following: S1. System Architecture Optimization Design: Design a system architecture for CXL pooled shared memory, reduce the overhead of data synchronization by sharing data through CXL pooled shared memory, and provide a high-performance and highly scalable concurrency control method with a decentralized read-write hierarchical queue lock method; S2. Concurrency Control Design: Based on the decentralized read-write hierarchical queue lock described in S1, pessimistic concurrency control is implemented to ensure concurrency control under strong consistency semantics. S3. Shared object management design: By providing the cxl_malloc() interface, nodes can explicitly request shared objects.

2. The method for ensuring read-write consistency for CXL pooled shared memory according to claim 1, characterized in that, S1 specifically includes the following: The CXL pooled shared memory region is divided into a CXL pooled shared memory allocation region and a CXL pooled shared memory management region; the CXL pooled shared memory allocation region is used to allocate the main area of ​​CXL pooled shared memory, and the CXL pooled shared memory management region is used to store the header information of the management components. The CXL pooled shared memory management area includes a pooled shared memory management module and a shared object management module. The pooled shared memory management module is used to manage specific pooled shared memory allocations. The shared object management module is used to maintain relevant management information of objects requesting pooled shared memory. It interacts with the underlying pooled memory management module to request shared memory for each shared object and generate corresponding references. CXL pooled shared memory is mapped to local virtual memory through remapping; the decentralized read-write hierarchical queue lock consists of a global read-write queue lock in the CXL pooled shared memory management area and a local read-write queue lock in local memory; the read-write hierarchical queue lock transfers lock ownership according to the principle of write priority, followed by local priority; the global read-write queue lock also interacts with the underlying pooled shared memory management module to request shared memory for shared lock status information.

3. The method for ensuring read-write consistency for CXL pooled shared memory according to claim 2, characterized in that, S2 specifically includes the following: The first read request to be processed first requests a local read lock from the local read-write queue lock module, and then requests a global read lock from the global read-write queue lock module. After both requests are successfully obtained, the current read request is processed. Subsequent read requests are executed directly because the local system has already obtained a global read lock. When the first write request arrives, it immediately blocks subsequent local and global read requests and creates corresponding local and global queue lock nodes; it waits for the unfinished read requests and the transfer of lock ownership by spinning through the flag bits in the queue lock node. After all previous read requests have finished, the last read request is responsible for releasing the global read lock and waking up the first waiting write request. When a write request is being processed or waiting, subsequent write requests will be queued in the queue and write a reference to their own queue lock node to the predecessor node. Then, they will spin to access the flag of their own queue lock node to wait to be woken up. After the predecessor node finishes execution, it sets the flag of the successor node to 1 according to the reference to wake up the successor node. When waking up the successor node, it first wakes up local write requests that are waiting, and then wakes up remote write requests. When the successor node reference is null, it releases the write lock and transfers the ownership of the lock back to the read lock. When read / write requests are spinning, add dynamic polling to reduce unnecessary memory access requests and optimize failure overhead.

4. The method for ensuring read-write consistency for CXL pooled shared memory according to claim 3, characterized in that, The global queue lock node represents the read / write state of an entire node, and is used to avoid frequent contention and modification of the node state by different threads in the same node.

5. A method for ensuring read-write consistency for CXL pooled shared memory according to claim 4, characterized in that, S3 specifically includes the following: The node first calls the cxl_malloc() interface to request the creation of a shared object from the shared object management module. During the creation process, the node provides the name of the shared object, the size to be created, and the creation mode, where the creation mode includes read-only and read-write. The shared object management module calculates the corresponding hash directory location based on the name of the shared object provided by the node and creates the metadata CXL_HEADER for the shared object reference. Hash collisions are resolved using hash buckets. The metadata includes the offset, size, mode, and reference count information of the shared object in the CXL pooled shared memory. Then it interacts with the underlying pooled shared memory management module, calls its interface to request memory of the corresponding size, and records the offset in the reference metadata; Finally, a reference CXL_OBJECT is generated and returned to the node. The reference records the name, size, and address of the shared object. CXL pooled shared memory is mapped into the node's virtual address space through remapping.

6. A computer device, characterized in that, The computer device includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, code set, or instruction set, and the instruction, program, code set, or instruction set is loaded and executed by the processor to implement a read-write consistency guarantee method for CXL pooled shared memory as described in any one of claims 1-5.

7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one instruction, at least one program, code set, or instruction set, which is loaded and executed by a processor to implement a read-write consistency guarantee method for CXL pooled shared memory as described in any one of claims 1-5.

Citation Information

Patent Citations

  • System deployment method, device and equipment and machine readable storage medium

    CN117311729A

  • Looseness consistency distributed shared memory synchronization method and system based on bounded lock

    CN117493044A

  • Video memory sharing method and device based on CXL protocol and RDMA protocol

    CN120045135A

  • System and Method for Implementing NUMA-Aware Reader-Writer Locks

    US20130290967A1