CXL shared memory access control method, computing device and computing system
By allocating memory for computing devices in the CXL shared memory pool to store lock status messages, the problem of poor lock reliability in distributed systems is solved, achieving more efficient lock operations and more reliable shared data.
Patent Information
- Application Number
- CN202510902601.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-30
- Publication Date
- 2025-11-14
AI Technical Summary
In distributed systems, high network latency leads to poor lock reliability, which in turn affects the reliability of shared data.
By allocating first and second memory to computing devices in the CXL shared memory pool, respectively for storing messages indicating the lock status, the management device sends memory addresses to implement lock operations, avoiding the need to request locks over the network.
This improves the reliability of the lock, thereby improving the reliability of shared data and increasing memory utilization.
Smart Images

Figure CN120950273A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computing technology, and in particular to a CXL shared memory access control method, computing device, and computing system. Background Technology
[0002] Locks in a distributed system can be used to control the order in which multiple computing devices write to shared data. Specifically, a computing device can acquire a lock and, after successfully acquiring it, can perform a write operation on the shared data. While one computing device is writing to the shared data, other computing devices cannot perform write operations on the shared data, thus ensuring the consistency of the shared data.
[0003] Currently, computing devices can request locks over a network. However, the high latency of networks leads to poor lock reliability. Summary of the Invention
[0004] This application provides a CXL shared memory access control method, computing device, and computing system, which can improve the reliability of locks and thus improve the reliability of shared data.
[0005] In a first aspect, embodiments of this application provide a CXL shared memory access control method, applied to a management device, the method comprising:
[0006] Allocate first memory for storing a first message to a first computing device; wherein the first message is used to indicate the lock status of the first computing device on the target memory; the target memory is memory bound to the first computing device;
[0007] Receive access requests from the second computing device to the target memory;
[0008] Allocate second memory for the second computing device to store a second message; wherein the second message is used to indicate the lock status of the second computing device on the target memory;
[0009] The address of the first memory and the address of the second memory are sent to the second computing device so that the second computing device can determine the lock state of the target memory based on the address of the first memory and set the lock state of the target memory based on the address of the second memory.
[0010] In the above scheme, the management device can allocate first memory to the first computing device to store the first message, receive access requests from the second computing device to the target memory, allocate second memory to the second computing device to store the second message, and send the addresses of the first and second memory to the second computing device. In this scheme, the target memory can be locked and unlocked using the first and second memory, which can be memory within a shared memory pool. That is, locking operations can be implemented using memory within the shared memory pool. This improves the reliability of the lock, and consequently, the reliability of the shared data.
[0011] One possible implementation method also includes:
[0012] Send the address of the first memory and the address of the second memory to the first computing device, so that the first computing device can determine the lock state of the target memory based on the address of the second memory, and set the lock state of the target memory based on the address of the first memory.
[0013] In the above scheme, the address of the first memory and the address of the second memory can be sent to the second computing device so that the second computing device can determine the locking state of the target memory and set the locking state of the target memory.
[0014] In one possible implementation, after allocating second memory for storing the second message to the second computing device, the method further includes:
[0015] Configure the second computing device to write to the second memory, and configure the first computing device to write to the first memory.
[0016] In the above scheme, write permissions for the first memory and the second memory can be configured so that the second computing device can perform write operations on the second memory and the first computing device can perform write operations on the first memory.
[0017] One possible implementation method also includes:
[0018] Receive a first release request from a first computing device and / or a second release request from a second computing device; the first release request and the second release request are used to request the deletion of the first message and the second message;
[0019] In response to the first release request and / or the second release request, delete the first message and the second message.
[0020] In the above scheme, the first and second messages can be deleted to facilitate the reallocation of the first and second memory, resulting in higher memory utilization.
[0021] In one possible implementation, after receiving the access request for the target memory from the second computing device, the method further includes:
[0022] Bind the second computing device to the target memory.
[0023] In the above scheme, a second computing device can be bound to the target memory, so that the second computing device has the ability to perform write and read operations on the target memory.
[0024] Secondly, embodiments of this application provide a CXL shared memory access control method, applied to a target computing device, the method comprising:
[0025] Send an access request to the target memory to the management device; wherein the target memory is the memory bound to the first computing device;
[0026] The system receives the addresses of the first memory and the second memory sent by the management device; wherein the first memory is the memory corresponding to the first computing device, the first memory is used to store the first message, the first message is used to indicate the locking status of the first computing device on the target memory, and the second memory is the memory corresponding to the target computing device, the second memory is used to store the second message, the second message is used to indicate the locking status of the target computing device on the target memory;
[0027] The lock status of the target memory is determined based on the address of the first memory location;
[0028] While the target memory is unlocked, a second message is written to the second memory, and the target memory is accessed.
[0029] In the above scheme, the target computing device can send an access request to the management device for the target memory, receive the addresses of the first and second memory from the management device, obtain a first message based on the address of the first memory, and determine the locking status of the target memory based on the first message. When the target memory is unlocked, the target computing device can write a second message to the second memory and access the target memory. In this scheme, the lock can be implemented using shared memory in a shared memory pool. This eliminates the need for the target computing device to request a lock over the network or perform locking operations, improving the reliability of the lock and consequently the reliability of the shared data.
[0030] In one possible implementation, determining the lock state of the target memory based on the address of the first memory includes:
[0031] The first message is obtained based on the address of the first memory.
[0032] The lock status of the target memory is determined based on the first status message.
[0033] In the above scheme, the target computing device can determine the lock status of the target memory based on the first message, thus achieving the purpose of determining the lock status of the target memory.
[0034] One possible implementation method includes:
[0035] Upon confirmation of business completion with the first computing device, a second release request is sent to the management device; the second release request is used to request the deletion of the first message and the second message.
[0036] In the above scheme, the target computing device can request the deletion of the first message and the second message in order to reclaim and reuse the first memory and the second memory, thereby increasing the utilization rate of the first memory and the second memory.
[0037] Thirdly, embodiments of this application provide a CXL shared memory access control device, applied to a management device. The device includes an allocation module, a receiving module, and a sending module, wherein...
[0038] The allocation module is used to allocate first memory to the first computing device for storing a first message; wherein the first message is used to indicate the locking status of the first computing device on the target memory; the target memory is memory bound to the first computing device;
[0039] The receiving module is used to receive access requests from the second computing device to the target memory;
[0040] The allocation module is also used to allocate second memory for storing second messages to the second computing device; wherein the second messages are used to indicate the lock status of the second computing device on the target memory;
[0041] The sending module is used to send the address of the first memory and the address of the second memory to the second computing device, so that the second computing device can determine the lock state of the target memory based on the address of the first memory and set the lock state of the target memory based on the address of the second memory.
[0042] In the above scheme, the management device can allocate first memory for storing the first message to the first computing device, receive access requests from the second computing device for the target memory, allocate second memory for storing the second message to the second computing device, and send the addresses of the first and second memory to the second computing device. In this scheme, a lock can be implemented using the first and second memory, which can be memory within a shared memory pool. That is, a lock can be implemented using memory within a shared memory pool. This eliminates the need for the computing device to request a lock over the network or perform locking operations, improving the reliability of the lock and consequently, the reliability of the shared data.
[0043] In one possible implementation, the sending module is also used to,
[0044] Send the address of the first memory and the address of the second memory to the first computing device, so that the first computing device can determine the lock state of the target memory based on the address of the second memory, and set the lock state of the target memory based on the address of the first memory.
[0045] In the above scheme, the address of the first memory and the address of the second memory can be sent to the first computing device so that the first computing device can determine the locking state of the target memory and set the locking state of the target memory.
[0046] In one possible implementation, after allocating a second memory column for storing the second message to the second computing device, the allocation module is further configured to:
[0047] Configure the second computing device to write to the second memory, and configure the first computing device to write to the first memory.
[0048] In the above scheme, write permissions for the first memory and the second memory can be configured so that the first computing device can perform write operations on the first memory and the second computing device can perform write operations on the second memory.
[0049] In one possible implementation, the apparatus further includes a deletion module, which is used to,
[0050] Receive a first release request from a first computing device and / or a second release request from a second computing device; the first release request and the second release request are used to request the deletion of the first message and the second message;
[0051] In response to the first release request and / or the second release request, delete the first message and the second message.
[0052] In the above scheme, the first and second messages can be deleted to facilitate the reallocation of the first and second memory, resulting in higher memory utilization.
[0053] In one possible implementation, the apparatus further includes a binding module, which is used to bind the second computing device to the target memory after receiving an access request from the second computing device to the target memory.
[0054] In the above scheme, a second computing device can be bound to the target memory, so that the second computing device has the ability to perform write and read operations on the target memory.
[0055] Fourthly, embodiments of this application provide a CXL shared memory access control device applied to a target computing device. The device includes a sending module, a receiving module, a determining module, and an access module, wherein...
[0056] The sending module is used to send an access request to the target memory to the management device; wherein the target memory is the memory bound to the first computing device;
[0057] The receiving module is used to receive the address of the first memory and the address of the second memory sent by the management device; wherein, the first memory is the memory corresponding to the first computing device, the first memory is used to store the first message, the first message is used to indicate the locking status of the first computing device on the target memory, and the second memory is the memory corresponding to the target computing device, the second memory is used to store the second message, the second message is used to indicate the locking status of the target computing device on the target memory;
[0058] The determination module is used to determine the lock status of the target memory based on the address of the first memory;
[0059] The access module is used to write a second message to the second memory and access the target memory while the target memory is unlocked.
[0060] In the above scheme, an access request for the target memory can be sent to the management device. The management device can also receive the address of the first memory and the address of the second memory corresponding to the second message queue. The lock status of the target memory can be determined based on the address of the first memory. If the target memory is unlocked, a second message can be written to the second memory, and the target memory can be accessed. In this scheme, the lock can be implemented using shared memory in a shared memory pool. This eliminates the need for the target computing device to request a lock over the network or perform locking operations, improving the reliability of the lock and consequently the reliability of the shared data.
[0061] In one possible implementation, the module is specifically used for,
[0062] The first message is obtained based on the address of the first memory.
[0063] The lock status of the target memory is determined based on the first message.
[0064] In the above scheme, the locking status of the target memory can be determined based on the first message, thus achieving the purpose of determining the locking status of the target memory.
[0065] In one possible implementation, the sending module is also used to,
[0066] Upon confirmation of business completion with the first computing device, a second release request is sent to the management device; the second release request is used to request the deletion of the first message and the second message.
[0067] In the above scheme, the first message and the second message can be requested to be deleted so that the first memory and the second memory can be recycled and reused, resulting in higher utilization of the first memory and the second memory.
[0068] Fifthly, embodiments of this application provide a computing device, which includes a memory and a processor;
[0069] Memory and processor are coupled;
[0070] Memory is used to store program instructions;
[0071] The processor is used to invoke program instructions to cause the computing device to perform the first aspect and / or various possible implementations of the first aspect as described above.
[0072] Sixthly, embodiments of this application provide a computing device, which includes a memory and a processor;
[0073] Memory and processor are coupled;
[0074] Memory is used to store program instructions;
[0075] The processor is used to invoke program instructions to cause the computing device to perform the second aspect and / or various possible implementations of the second aspect as described above.
[0076] In a seventh aspect, embodiments of this application provide a computing system, which includes a management device, a first computing device, and a second computing device; wherein,
[0077] The management device is coupled to the first computing device and the second computing device respectively; the management device is the computing device of the fifth aspect, and the management device is used to execute any one of the methods of the first aspect;
[0078] The first computing device is the computing device of the sixth aspect, and the first computing device is used to execute any of the methods of the second aspect.
[0079] Eighthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the first aspect and / or various possible implementations of the first aspect.
[0080] Ninthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the second aspect and / or various possible implementations of the second aspect.
[0081] In a tenth aspect, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the first aspect and / or various possible implementations of the first aspect.
[0082] Eleventhly, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the second aspect and / or various possible implementations of the second aspect as described above. Attached Figure Description
[0083] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the 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 embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0084] Figure 1 A schematic diagram of a distributed system architecture provided in an embodiment of this application;
[0085] Figure 2 A schematic diagram of the architecture of a computing system provided in an embodiment of this application;
[0086] Figure 3 A flowchart illustrating a CXL shared memory access control method provided in an embodiment of this application;
[0087] Figure 4 This is a schematic diagram of a shared memory pool provided in an embodiment of this application;
[0088] Figure 5 A flowchart illustrating another CXL shared memory access control method provided in an embodiment of this application;
[0089] Figure 6 A flowchart illustrating another CXL shared memory access control method provided in this application embodiment;
[0090] Figure 7 A flowchart illustrating another CXL shared memory access control method provided in this application embodiment;
[0091] Figure 8 A schematic diagram of the structure of a CXL shared memory access control device provided in an embodiment of this application;
[0092] Figure 9 A schematic diagram of another CXL shared memory access control device provided in this application embodiment;
[0093] Figure 10 A schematic diagram of another CXL shared memory access control device provided in the embodiments of this application;
[0094] Figure 11 This is a schematic diagram of the structure of a computing device provided in an embodiment of this application. Detailed Implementation
[0095] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with those of this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of the embodiments of this application as detailed in the appended claims.
[0096] To facilitate understanding, the technical terms involved in the embodiments of this application will be explained first.
[0097] Compute Express Link (CXL) technology: an open standard for high-speed, high-capacity central processing unit (CPU) to device and CPU to memory connections. CXL technology is designed specifically for high-performance data center computers.
[0098] Fabric Manager (FM): A standalone module used for unified identification and management of CXL shared memory pools in the cluster. FM can allocate memory space for CXL shared memory pools, and provides functions such as modifying the ownership and permissions of CXL shared memory pool memory space.
[0099] Locks are mechanisms used in distributed systems to coordinate mutual exclusion access to shared resources by multiple processes / threads. They resolve data inconsistencies that can occur when multiple nodes access shared resources simultaneously in a distributed environment.
[0100] The following is combined with Figure 1 The application scenarios involved in the embodiments of this application will be described.
[0101] Figure 1 This is a schematic diagram of a distributed system architecture provided for an embodiment of this application. Figure 1 As shown, a distributed system may include computing device 1, computing device 2, a database, and locks.
[0102] Computing devices can be electronic devices capable of data read and write operations. For example, computing devices can be servers, laptops, desktop computers, tablets, microcontrollers, or artificial intelligence devices. Servers can be, for example, graphics processing unit (GPU) servers or AI servers. It should be noted that distributed systems can include devices with higher performance than... Figure 1 More computing devices are shown. Figure 1The example of a distributed system comprising two computing devices is used for illustration only and does not constitute a limitation on the technical solutions provided in the embodiments of this application.
[0103] A database can be a shared database among multiple computing devices in a distributed system, used to store shared data across these devices. Once a computing device has write permissions to the database, it can perform write operations on it.
[0104] Locks can be implemented using memory variables in any computing device within the cluster, where the value of the memory variable represents the lock's state. For example, assuming the lock's length is 1 bit, a value of 1 bit indicates that the lock is in a locked state, while a value of 0 bit indicates that the lock is in an unlocked state.
[0105] In a distributed system, any computing device must acquire a lock before performing a write operation on the database. Upon successful acquisition, the lock is in a locked state. While the lock is locked, only the successfully acquired computing device has write access to the database. After completing the write operation, the successfully acquired computing device can release the lock. After releasing the lock, it becomes unlocked, and other computing devices can then initiate a new round of lock acquisition competition.
[0106] like Figure 1 As shown, both computing device 1 and computing device 2 can request a lock. Assume computing device 1 successfully requests the lock while computing device 2 fails. After successfully requesting the lock, computing device 1 can perform write operations on the database. After completing the write operation, computing device 1 can release the lock. After computing device 1 releases the lock, computing device 2 can re-request the lock.
[0107] Currently, computing devices can perform locking operations over a network. For example, a lock can be set on any computing device in a distributed system, and other computing devices can communicate with that device over the network to perform locking or unlocking operations. However, the high latency and low reliability of networks lead to poor lock reliability, which in turn results in low reliability of shared data.
[0108] In view of this, embodiments of this application provide a CXL shared memory access control method to solve the technical problem of poor lock performance.
[0109] Below, in conjunction with Figure 2 The architecture of the computing system provided in the embodiments of this application will be described.
[0110] Figure 2 This is a schematic diagram of the architecture of a computing system provided in an embodiment of this application. Please refer to [link / reference]. Figure 2The computing system may include clusters and management devices. A cluster may include multiple computing devices and a CXL shared memory pool, and the multiple computing devices may be coupled together. For example, the cluster may be an Artificial Intelligence (AI) training cluster or a high-performance computing cluster, and the multiple computing devices may be computing device 1, computing device 2, and computing device 3, etc.
[0111] Each computing device in the cluster can connect to the CXL shared memory pool. The CXL shared memory pool can provide shared memory for the computing devices in the cluster.
[0112] The management device can connect to the CXL memory pool, and it can also communicate with various computing devices in the cluster (not shown in the figure).
[0113] The management device can be an electronic device running an FM. For example, the management device may include an ARM (Advanced RISC (Reduced Instruction Set Computer) machine) processor, a baseboard management controller (BMC), or other processor on which the FM runs.
[0114] It should be noted that the management device can be an electronic device independent of the cluster, or it can be an electronic device within the cluster that is independent of each computing device, or it can be any computing device in the cluster. This application does not limit the specific operating location of FM in its embodiments. Figure 2 The description of the management equipment is merely illustrative and does not constitute a limitation on the management equipment.
[0115] In the aforementioned memory operating system, the management device can allocate lock space and data space for multiple computing devices in the cluster within the CXL shared memory pool. The data space can be used to store shared data from multiple computing devices, and the lock space can be used to implement distributed locks. In other words, locks can be implemented through shared memory in the CXL shared memory pool. Computing devices can perform locking or unlocking operations by accessing the shared memory. Compared to locking operations via the network, the solution in this embodiment of the application results in faster locking operations, improving lock performance and thus increasing the efficiency of accessing shared data.
[0116] The technical solutions of the embodiments of this application will be described in detail below with specific examples. These specific examples can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.
[0117] Figure 3This is a flowchart illustrating a CXL shared memory access control method provided in an embodiment of this application. The execution entity of this method can be a management device; specifically, the execution entity is a processing chip located within the management device. The management device can be, for example, a... Figure 2 The diagram shows a management device in a computing system. The following explanation uses the management device as the executing entity as an example. Please refer to [link to relevant documentation]. Figure 3 The method may include:
[0118] S301. Allocate first memory for storing the first message to the first computing device.
[0119] The first computing device can be any computing device in the computing system. For example, the computing system can be... Figure 2 The computing system shown.
[0120] The first message indicates the lock status of the first computing device on the target memory. The lock status can be locked or unlocked.
[0121] The target memory is the memory bound to the first computing device. Specifically, the first computing device can perform read operations on the target memory, or the first computing device can perform write operations on the target memory.
[0122] It should be noted that if the first computing device locks the target memory, other computing devices cannot perform write operations on the target computing device; if the first computing device unlocks the target memory, other computing devices can perform write operations on the target computing device. These other computing devices can be any computing device other than the first computing device that has the permission to perform write operations on the target memory.
[0123] In this embodiment, the target memory can be the data memory allocated by the management device to the first computing device in a shared memory pool. The first computing device can read data from the target memory via read operations, or it can write data to the target memory via write operations. For example, the shared memory pool can be a CXL shared memory pool.
[0124] It should be noted that the management device can also store the correspondence between the first memory and the target memory, so as to indicate the locking status of the first computing device to the target memory through the first message stored in the first memory.
[0125] In some embodiments, the management device can allocate first memory to the first computing device at the same time as allocating target memory to the first computing device.
[0126] In other embodiments, the management device may allocate first memory to the first computing device after allocating target memory to the first computing device.
[0127] S302, Receive the second computing device's access request to the target memory.
[0128] The second computing device can be any computing device in the computing system other than the first computing device.
[0129] It should be noted that after receiving an access request from the second computing device to the target memory, the management device can bind the second computing device to the target memory. Specifically, after receiving the access request from the second computing device to the target memory, the management device can set the target memory as shared memory for the first and second computing devices. The target memory can be used to store shared data between the first and second computing devices.
[0130] Access requests can be used to request read or write operations on the target memory.
[0131] S303: Allocate second memory for the second computing device to store the second message.
[0132] The second message is used to indicate the lock status of the second computing device on the target memory.
[0133] It should be noted that if the second computing device locks the target memory, other computing devices cannot perform write operations on the target computing device; if the second computing device unlocks the target memory, other computing devices can perform write operations on the target computing device. These other computing devices can be any computing device other than the second computing device that has the permission to perform write operations on the target memory.
[0134] It should be noted that the management device can also store the correspondence between the second memory and the target memory, so as to indicate the locking status of the second computing device to the target memory through the second message stored in the second memory.
[0135] The following is combined with Figure 4 The target memory, the first memory, and the second memory are described.
[0136] Figure 4 This is a schematic diagram of a shared memory pool provided in an embodiment of this application. Please refer to... Figure 4 The shared memory pool may include a target memory, a first memory, and a second memory. The first memory may include a first message, and the second memory may include a second message.
[0137] The target memory can be used to store shared data between the first computing device and the second computing device. A first message indicates the lock status of the target memory held by the first computing device. A second message indicates the lock status of the target memory held by the second computing device.
[0138] S304. Send the address of the first memory and the address of the second memory to the second computing device.
[0139] In this embodiment, after the second computing device receives the address of the first memory and the address of the second memory, it can determine the locking state of the target memory based on the address of the first memory and set the locking state of the target memory based on the address of the second memory.
[0140] In this embodiment, the management device can also send the address of the first memory and the address of the second memory to the first computing device, so that the first computing device can determine the locking state of the target memory based on the address of the second memory, and set the locking state of the target memory based on the address of the first memory.
[0141] It should be noted that the management device can also configure write permissions for the first computing device to the first memory, and configure write permissions for the second computing device to the second memory. Specifically, the management device can store configuration information for the first memory and configuration information for the second memory. The management device can record in the configuration information for the first memory that the first computing device has write permissions to the first memory, and it can record in the configuration information for the second memory that the second computing device has write permissions to the second memory.
[0142] Specifically, regarding the first memory, the first computing device has read and write permissions to the first memory, and the second computing device has read permissions to the first memory. Regarding the second memory, the second computing device has read and write permissions to the second memory, and the first computing device has read permissions to the second memory.
[0143] Specifically, the first computing device can read the second message based on the address of the second memory, and determine the locking state of the second computing device on the target memory based on the second message; the first computing device can also write the locking state of the first computing device on the target memory into the first memory based on the address of the first memory. The second computing device can read the first message based on the address of the first memory, and determine the locking state of the first computing device on the target memory based on the first message; the second computing device can also write the locking state of the second computing device on the target memory into the second memory based on the address of the second memory.
[0144] In the CXL shared memory access control method provided in this embodiment, the management device can allocate first memory for storing first messages to the first computing device, receive access requests from the second computing device for target memory, allocate second memory for storing second messages to the second computing device, and send the addresses of the first and second memory to the second computing device. In this method, a lock can be implemented using the first and second memory, which can be memory within a shared memory pool. That is, a lock can be implemented using memory within a shared memory pool. This eliminates the need for the computing device to request locks over the network or perform locking operations, improving the reliability of the lock and consequently enhancing the reliability of shared data.
[0145] Based on any of the above embodiments, the following is combined with Figure 5 The CXL shared memory access control method implemented by the management device is further explained.
[0146] Figure 5 This is a flowchart illustrating another CXL shared memory access control method provided in an embodiment of this application. The executing entity of this method can be a management device; specifically, the executing entity can also be a processing chip located within the management device. The management device can be, for example, a... Figure 2 The diagram shows a management device in a computing system. The following explanation uses the management device as the executing entity as an example. Please refer to [link to relevant documentation]. Figure 5 The method may include:
[0147] S501, Allocate first memory for the first computing device to store the first message.
[0148] S502, Receive the second computing device's access request to the target memory.
[0149] S503: Allocate second memory for the second computing device to store the second message.
[0150] S504. Configure the second computing device to write to the second memory, and configure the first computing device to write to the first memory.
[0151] S505: Send the address of the first memory and the address of the second memory to the second computing device.
[0152] S506: Send the address of the first memory and the address of the second memory to the first computing device.
[0153] It should be noted that the specific implementation methods of S501-S506 can be found in S301-S304, and will not be repeated here. In addition, S505 can be executed before S506, or after S506, or S505 can be executed simultaneously with S506. This embodiment does not limit this.
[0154] S507, Receive a first release request from the first computing device and / or a second release request from the second computing device.
[0155] The first release request is used to request the deletion of the first and second messages.
[0156] The second release request is used to request the deletion of the first and second messages.
[0157] In some embodiments, the management device may receive a first release request from the first computing device.
[0158] In other embodiments, the management device may receive a second release request from the second computing device.
[0159] In some other embodiments, the management device may receive a first release request from a first computing device and a second release request from a second computing device.
[0160] In this embodiment, when the first computing device and the second computing device no longer need to store shared data through the target memory, the first computing device may send a first release request to the management device after negotiation with the second computing device; or, the second computing device may send a second release request to the management device after negotiation with the first computing device and the second computing device; or, the first computing device may send a first release request to the management device and the second computing device may send a second release request to the management device.
[0161] S508. In response to the first release request and / or the second release request, delete the first message and the second message.
[0162] After receiving the first release request and / or the second release request, the management device can delete the correspondence between the first memory and the target memory, and can also delete the correspondence between the second memory and the target memory, so as to achieve the purpose of deleting the first message and the second message.
[0163] It should be noted that after the management device deletes the first and second messages, it can reallocate the first and second memory, resulting in higher memory utilization.
[0164] In the CXL shared memory access control method provided in this embodiment, the management device can allocate first memory for storing first messages to the first computing device, receive access requests from the second computing device to the target memory, allocate second memory for storing second messages to the second computing device, configure write permissions for the second computing device to the second memory and for the first computing device to the first memory, send the addresses of the first and second memory to the second computing device, send the addresses of the first and second memory to the first computing device, receive a first release request from the first computing device and / or a second release request from the second computing device, and delete the first and second messages in response to the first and / or second release requests. In the above method, locks can be implemented using shared memory in the shared memory pool, improving the reliability of the locks and thus the reliability of the shared data. Furthermore, locks can be deleted when the first and second computing devices no longer need them, resulting in higher utilization of shared memory.
[0165] Based on any of the above embodiments, the method for a target computing device to access target memory will be described below. The target computing device may also be referred to as a second computing device.
[0166] Figure 6 This is a flowchart illustrating another CXL shared memory access control method provided in an embodiment of this application. The execution entity of this method can be a target computing device or a processing chip located within the target computing device. The target computing device can be, for example, a... Figure 3 The second computing device shown in the embodiment. The following description uses only the target computing device as the execution subject as an example. Please refer to... Figure 6 The method may include:
[0167] S601, Send an access request to the target memory to the management device.
[0168] The target memory is the memory bound to the first computing device. Specifically, the first computing device can read data from the target memory through a read operation, or it can write data to the target memory through a write operation.
[0169] Access requests can be used to request read or write operations on the target memory.
[0170] S602, Receive the address of the first memory and the address of the second memory sent by the management device.
[0171] In this embodiment, after the target computing device sends an access request to the management device, it can receive the address of the first memory and the address of the second memory sent by the management device.
[0172] S603. Determine the lock status of the target memory based on the address of the first memory.
[0173] In this embodiment, the target computing device can obtain the first message based on the address of the first memory, and can determine the locking status of the target memory based on the first message.
[0174] The first message can be used to indicate the locking status of the first computing device on the target memory. Specifically, the first message can indicate that the first computing device's locking status on the target memory is locked, or the first message can indicate that the first computing device's locking status on the target memory is unlocked.
[0175] Optionally, the first message can be "0" or "1". When the first message can be "1", it can indicate that the first computing device is locking the target memory. When the first message can be "0", it can indicate that the first computing device is unlocking the target memory.
[0176] S604. While the target memory is unlocked, write the second message to the second memory and access the target memory.
[0177] The second message is used to indicate the lock status of the target memory by the target computing device. In this embodiment, before performing a write operation on the target memory, the target computing device can write a second message in the second memory to indicate that the target memory is in a locked state.
[0178] For example, assuming that "1" can represent that the target memory is locked, then the second message can be "1".
[0179] In the CXL shared memory access control method provided in this embodiment, the target computing device can send an access request to the management device for the target memory, receive the addresses of the first and second memory from the management device, and determine the locking status of the target memory based on the address of the first memory. When the target memory is unlocked, the target computing device can write a second message to the second memory and access the target memory. In the above method, the lock can be implemented through shared memory in the shared memory pool. This eliminates the need for the target computing device to request a lock over the network or perform locking operations, improving the reliability of the lock and thus enhancing the reliability of the shared data.
[0180] Based on the above embodiments, the target computing device can also request the deletion of the first message and the second message. The CXL shared memory access control method executed by the target computing device will be further described below.
[0181] Figure 7This is a flowchart illustrating another CXL shared memory access control method provided in an embodiment of this application. The execution entity of this method can be a target computing device or a processing chip located within the target computing device. The target computing device can be, for example, a... Figure 3 The second computing device shown in the embodiment. The following description uses only the target computing device as the execution subject as an example. Please refer to... Figure 7 The method may include:
[0182] S701, Send an access request to the target memory to the management device.
[0183] S702, Receive the address of the first memory and the address of the second memory sent by the management device.
[0184] S703. Determine the lock status of the target memory based on the address of the first memory.
[0185] S704. When the target memory is unlocked, write the second message to the second memory and access the target memory.
[0186] It should be noted that the specific implementation methods of S701-S704 can be found in S601-S604, and will not be repeated here. In addition, the methods shown in S703-S704 can be executed once or multiple times, and this embodiment does not limit this.
[0187] S705. Upon confirming the completion of the service with the first computing device, a second release request is sent to the management device.
[0188] The second release request is used to request the deletion of the first and second messages.
[0189] The business can be completed when the first and second computing devices no longer need to share data through the target memory storage.
[0190] In the CXL shared memory access control method provided in this embodiment, locks can be implemented using shared memory in a shared memory pool, improving the reliability of the locks and thus the reliability of shared data. Furthermore, the shared memory corresponding to the lock can be reused, resulting in higher utilization of shared memory.
[0191] Figure 8 This is a schematic diagram of a CXL shared memory access control device provided in an embodiment of this application. The CXL shared memory access control device can be applied to management devices. Please refer to... Figure 8 The CXL shared memory access control device 10 may include an allocation module 11, a receiving module 12, and a sending module 13, wherein...
[0192] The allocation module 11 is used to allocate first memory for storing a first message to the first computing device; wherein the first message is used to indicate the locking status of the first computing device on the target memory; the target memory is memory bound to the first computing device;
[0193] The receiving module 12 is used to receive the access request from the second computing device to the target memory;
[0194] The allocation module 11 is further configured to allocate second memory for storing second messages to the second computing device; wherein the second messages are used to indicate the lock status of the second computing device on the target memory;
[0195] The sending module 13 is used to send the address of the first memory and the address of the second memory to the second computing device, so that the second computing device can determine the locking state of the target memory based on the address of the first memory and set the locking state of the target memory based on the address of the second memory.
[0196] In one possible implementation, the sending module 13 is further configured to,
[0197] The address of the first memory and the address of the second memory are sent to the first computing device so that the first computing device can determine the lock state of the target memory based on the address of the second memory, and set the lock state of the target memory based on the address of the first memory.
[0198] In one possible implementation, after allocating second memory for storing the second message to the second computing device, the allocation module 11 is further configured to,
[0199] Configure the second computing device to write permissions to the second memory, and configure the first computing device to write permissions to the first memory.
[0200] Figure 9 This is a schematic diagram of another CXL shared memory access control device provided in an embodiment of this application. Figure 8 Based on this, the CXL shared memory access control device 10 further includes a deletion module 14 and a binding module 15, wherein the deletion module 14 is used for,
[0201] Receive a first release request from the first computing device and / or a second release request from the second computing device; the first release request and the second release request are used to request the deletion of the first message and the second message;
[0202] In response to the first release request and / or the second release request, delete the first message and the second message.
[0203] In one possible implementation, the binding module 15 is used to bind the second computing device to the target memory after receiving the access request from the second computing device to the target memory.
[0204] The CXL shared memory access control device 10 provided in this embodiment can execute the technical solution executed by the management device in any of the above method embodiments. Its implementation principle and beneficial effects are similar, and will not be described again here.
[0205] Figure 10 This is a schematic diagram illustrating the structure of another CXL shared memory access control device provided in this application embodiment. The CXL shared memory access control device can be applied to the target computing device. Please refer to... Figure 10 The CXL shared memory access control device 20 may include a sending module 21, a receiving module 22, a determining module 23, and an access module 24, wherein...
[0206] The sending module 21 is used to send an access request to the target memory to the management device; wherein the target memory is the memory bound to the first computing device;
[0207] The receiving module 22 is used to receive the address of the first memory and the address of the second memory sent by the management device; wherein, the first memory is the memory corresponding to the first computing device, the first memory is used to store a first message, the first message is used to indicate the locking status of the first computing device on the target memory, the second memory is the memory corresponding to the second computing device, the second memory is used to store a second message, the second message is used to indicate the locking status of the target computing device on the target memory;
[0208] The determining module 23 is used to determine the locking state of the target memory based on the first memory.
[0209] The access module 24 is used to write a second message into the second memory and access the target memory when the target memory is unlocked.
[0210] In one possible implementation, the determining module 23 is specifically used for,
[0211] The first message is obtained based on the address of the first memory;
[0212] The lock status of the target memory is determined based on the first message.
[0213] In one possible implementation, the sending module 21 is further configured to,
[0214] Upon confirming the completion of the service with the first computing device, a second release request is sent to the management device; the second release request is used to request the deletion of the first message and the second message.
[0215] The CXL shared memory access control device 20 provided in this embodiment can execute the technical solution executed by the first computing device in any of the above method embodiments. Its implementation principle and beneficial effects are similar, and will not be described again here.
[0216] Figure 11 This is a schematic diagram of the structure of a computing device provided in an embodiment of this application. Figure 11 As shown, the computing device 30 may include a processor 31 and a memory 32, wherein the processor 31 and the memory 32 can communicate; for example, the processor 31 and the memory 32 communicate via a communication bus 33, the memory 32 is used to store program instructions, and the processor 31 is used to call the program instructions in the memory to execute the method shown in any of the above method embodiments.
[0217] Optionally, the computing device 30 may also include a communication interface, which may include a transmitter and / or a receiver.
[0218] The computing device 30 can be the management device or the first computing device shown in any of the above method embodiments, and can execute the methods shown in any of the above method embodiments.
[0219] Optionally, the aforementioned processor can be a CPU, or it can be a GPU, a Baseboard Management Controller (BMC), other general-purpose processors, a Digital Signal Processor (DSP), or an Application Specific Integrated Circuit (ASIC), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of this application can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules in the processor.
[0220] This application provides a computing system, which includes a management device, a first computing device, and a second computing device; wherein the management device is coupled to both the first computing device and the second computing device; the management device can be... Figure 11 The computing device shown is used to execute the method performed by the management device in the above method embodiments; the first computing device may also be... Figure 11 The computing device shown is a first computing device used to execute the method executed by the first computing device in the above method embodiment.
[0221] This application provides a computer-readable storage medium storing computer-executable instructions; the computer-executable instructions are used to implement the CXL shared memory access control method as described in any of the above embodiments.
[0222] This application provides a computer program product, which includes a computer program that, when executed, causes a computer to perform the CXL shared memory access control method described above.
[0223] All or part of the steps in the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a readable memory. When the program is executed, it performs the steps of the above method embodiments; and the aforementioned memory (storage medium) includes: read-only memory (ROM), RAM, flash memory, hard disk, solid-state drive, magnetic tape, floppy disk, optical disk, and any combination thereof.
[0224] This application describes embodiments with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processing unit of a general-purpose computer, special-purpose computer, embedded processor, or other programmable terminal device to produce a machine, such that the instructions, which execute via the processing unit of the computer or other programmable terminal device, generate instructions for implementing the flowchart. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0225] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable terminal device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0226] These computer program instructions can also be loaded onto a computer or other programmable terminal device, causing a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable device for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0227] Obviously, those skilled in the art can make various modifications and variations to the embodiments of this application without departing from the spirit and scope of the embodiments of this application. Therefore, if these modifications and variations to the embodiments of this application fall within the scope of the claims of this application and their equivalents, the embodiments of this application are also intended to include these modifications and variations.
[0228] In the embodiments of this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. The term "or" and its variations can mean "and / or." In the embodiments of this application, the terms "first," "second," etc., are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. In the embodiments of this application, "multiple" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, and B alone. The character " / " generally indicates that the preceding and following related objects have an "or" relationship.
[0229] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the invention disclosed in the specification and in practice. The embodiments of this application are intended to cover any variations, uses, or adaptations of the embodiments of this application that follow the general principles of the embodiments of this application and include common knowledge or customary technical means in the art not disclosed in the embodiments of this application.
Claims
1. A fast computation linking (CXL) shared memory access control method, applied to management devices, characterized in that, The method includes: Allocate first memory for storing a first message to a first computing device; wherein the first message is used to indicate the lock status of the first computing device on the target memory; the target memory is memory bound to the first computing device; Receive a request from a second computing device to access the target memory; Allocate second memory to the second computing device for storing a second message; wherein the second message is used to indicate the lock status of the second computing device on the target memory; The address of the first memory and the address of the second memory are sent to the second computing device so that the second computing device can determine the lock state of the target memory based on the address of the first memory and set the lock state of the target memory based on the address of the second memory.
2. The method according to claim 1, characterized in that, The method further includes: The address of the first memory and the address of the second memory are sent to the first computing device so that the first computing device can determine the lock state of the target memory based on the address of the second memory, and set the lock state of the target memory based on the address of the first memory.
3. The method according to claim 1 or 2, characterized in that, After allocating second memory for storing the second message to the second computing device, the method further includes: Configure the second computing device to write permissions to the second memory, and configure the first computing device to write permissions to the first memory.
4. The method according to any one of claims 1-3, characterized in that, The method further includes: Receive a first release request from the first computing device and / or a second release request from the second computing device; the first release request and the second release request are used to request the deletion of the first message and the second message; In response to the first release request and / or the second release request, delete the first message and the second message.
5. The method according to any one of claims 1-4, characterized in that, After receiving the access request from the second computing device to the target memory, the method further includes: Bind the second computing device to the target memory.
6. A fast computation linking (CXL) shared memory access control method, applied to a target computing device, characterized in that, The method includes: Send an access request to the target memory to the management device; wherein the target memory is the memory bound to the first computing device; The system receives the addresses of a first memory and a second memory sent by the management device; wherein the first memory is the memory corresponding to the first computing device, the first memory is used to store a first message, the first message is used to indicate the locking status of the first computing device on the target memory, and the second memory is the memory corresponding to the target computing device, the second memory is used to store a second message, the second message is used to indicate the locking status of the target computing device on the target memory; The lock state of the target memory is determined based on the address of the first memory. While the target memory is unlocked, a second message is written to the second memory, and the target memory is accessed.
7. The method according to claim 6, characterized in that, Determining the lock state of the target memory based on the address of the first memory includes: The first message is obtained based on the address of the first memory; The lock status of the target memory is determined based on the first message.
8. The method according to claim 6 or 7, characterized in that, The method includes: Upon confirming the completion of the service with the first computing device, a second release request is sent to the management device; the second release request is used to request the deletion of the first message and the second message.
9. A computing device, characterized in that, The computing device includes a memory and a processor; The memory and the processor are coupled; The memory is used to store program instructions; The processor is used to invoke the program instructions to cause the computing device to perform the method as described in any one of claims 1-5 or 6-8.
10. A computing system, characterized in that, The computing system includes a management device, a first computing device, and a second computing device; wherein... The management device is coupled to the first computing device and the second computing device respectively; the management device is the computing device as described in claim 9, and the management device is used to execute the method as described in any one of claims 1-5; The first computing device is the computing device as described in claim 9, and the first computing device is used to perform the method as described in any one of claims 6-8.