Distributed transaction processing method and apparatus
By locking and updating cache state information for memory addresses, the performance degradation caused by cross-host cache consistency is resolved, and efficient distributed transaction processing is achieved.
Patent Information
- Application Number
- CN202310411153.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-10
- Publication Date
- 2026-11-24
- Estimated Expiration
- 2043-04-10
AI Technical Summary
Cross-host cache consistency leads to decreased processing performance in distributed transaction processing systems, and existing technologies suffer from inefficiency due to the replication of redundant memory data over the network.
By locking the memory address in the response, updating the cache state information, and sending the updated cache state to the host to unlock, cross-host cache consistency is achieved, avoiding redundant data copying.
It improves the processing efficiency of distributed transactions, ensures cache consistency, and reduces processing overhead.
Smart Images

Figure CN116450303B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of Internet technology, and more specifically, to a distributed transaction processing method and apparatus. Background Technology
[0002] Cross-host cache consistency is crucial for effectively implementing high-performance distributed transaction processing systems. Currently, cross-host cache consistency is achieved based on network technology. When one of multiple hosts sharing memory modifies cached data, a cache consistency request needs to be sent to other hosts over the network to ensure that the data remains consistent across the caches of multiple hosts. Currently, PCIe (Peripheral Component Interconnect Express) links are used as the remote memory access protocol, which requires copying redundant memory data between the memory of different hosts over the network, resulting in a significant degrade in the processing performance of distributed transactions. Summary of the Invention
[0003] In view of this, the present disclosure provides a distributed transaction processing method and apparatus, which aims to improve the processing performance of distributed transactions.
[0004] According to a first aspect of this disclosure, a distributed transaction processing method is provided, comprising:
[0005] Receive a first request sent by a first host, wherein the first request is used to request access to a first address of shared memory, the shared memory being shared by multiple hosts;
[0006] Lock the response of the first address to each host request, update the cache status information of the first address according to the first request, and send the updated cache status of the data copy corresponding to the first address to the first host. The cache status information of the memory address is used to indicate the cache status of each host for the data copy corresponding to the memory address.
[0007] Release the lock on the responses of the first address to requests from each host, and execute the first request from the first host.
[0008] Optionally, the cache state information of the memory address is a multi-dimensional vector;
[0009] The dimension of the multidimensional vector is equal to the number of the plurality of hosts, and the elements of the multidimensional vector indicate the caching status of the host corresponding to the element for the data copy corresponding to the memory address;
[0010] Furthermore, the cached state of the host for the data copy corresponding to the memory address includes the following types: invalid state, shared state, exclusive state, and modified state.
[0011] Optionally, the memory address is also configured with locking information, which is used to indicate whether the memory address is in a locked state when responding to requests from various hosts;
[0012] Locking the response of the first address to each host request includes setting the locking information of the first address as first data;
[0013] Releasing the lock on the first address for each host request includes setting the lock information of the first address as the second data.
[0014] Optionally, the cache state of at least one of the multiple hosts for the data copy corresponding to the first address is changed due to the first request;
[0015] After updating the cache state information of the first address according to the first request and before releasing the lock on the response of the first address to each host request, the method further includes: sending the updated cache state of the data copy corresponding to the first address to the second host.
[0016] Optionally, sending the updated cache state of the data copy corresponding to the first address to the second host includes:
[0017] The updated cache state of the data copy corresponding to the first address is sent to the second host in the form of a data packet, wherein the source address in the header of the data packet is the device executing the distributed transaction processing method and the destination address is the second host.
[0018] According to a second aspect of this disclosure, a memory control device is provided, comprising:
[0019] A receiving unit is configured to receive a first request sent by a first host, wherein the first request is for requesting access to a first address of shared memory, the shared memory being shared by multiple hosts;
[0020] The processing unit is configured to lock the response of the first address to each host request and update the cache status information of the first address according to the first request, wherein the cache status information of the memory address is used to indicate the cache status of each host for the data copy corresponding to the memory address.
[0021] The sending unit is used to send the updated cache state of the data copy corresponding to the first address to the first host.
[0022] The processing unit is further configured to release the response lock of the first address to each host request and execute the first request of the first host.
[0023] Optionally, the cache state of at least one of the multiple hosts for the data copy corresponding to the first address is changed due to the first request;
[0024] The sending unit is further configured to send the updated cache status of the data copy corresponding to the first address to the second host after updating the cache status information of the first address according to the first request and before releasing the response lock of the first address to each host request.
[0025] Optionally, the sending unit sends the updated cache status of the data copy corresponding to the first address to the second host in the form of a data packet, wherein the source address in the header of the data packet is the memory control device and the destination address is the second host.
[0026] According to a third aspect of this disclosure, a distributed transaction processing system is provided, comprising: a switch, multiple hosts, at least one dynamic random access memory, and at least one memory control device as described in the second aspect, wherein...
[0027] The switch is connected to the plurality of hosts and the at least one memory control device respectively via a compute-fast link;
[0028] The memory control device is connected to at least one of the dynamic random access memories, and the at least one dynamic random access memory constitutes a shared memory shared by the plurality of hosts;
[0029] The switch is used to transmit interactive data between the host and the memory control device.
[0030] According to a fourth aspect of this disclosure, a computing device is provided, comprising:
[0031] Memory, used to store executable code in a computer;
[0032] A processor for executing the computer-executable code to implement the steps of any of the distributed transaction processing methods described in the first aspect.
[0033] According to a fifth aspect of this disclosure, a computer-readable storage medium is provided that stores computer-executable code, which, when executed by a processor, implements the steps of any of the distributed transaction processing methods described in the first aspect.
[0034] The distributed transaction processing method provided in this disclosure, upon receiving a first request from a first host to access a first address of shared memory, first locks the responses of the first address to the requests from each host, then updates the cache state information of the first address according to the first request, and sends the updated cache state of the first host for the data copy corresponding to the first address to the first host. Afterwards, it releases the lock on the responses of the first address to the requests from each host and executes the first request. The cache state information of the memory address is used to indicate the cache state of the data copy corresponding to that memory address from each host. Therefore, updating the cache state information of the first address and sending the updated cache state of the first host for the data copy corresponding to the first address to the first host achieves cross-host cache consistency. This cross-host cache consistency does not require multiple hosts to copy redundant memory data for the first request, thus effectively improving the processing efficiency of distributed transactions. Attached Figure Description
[0035] The above and other objects, features, and advantages of this disclosure will become clearer from the following description of embodiments with reference to the accompanying drawings, in which:
[0036] Figure 1 A flowchart illustrating a distributed transaction processing method according to an embodiment of the present disclosure is shown;
[0037] Figures 2(a), 2(b) and 2(c) illustrate an exemplary distributed transaction processing method according to an embodiment of the present disclosure;
[0038] Figure 3 This diagram shows a structural block diagram of a memory control device according to an embodiment of the present disclosure;
[0039] Figure 4 This diagram illustrates the architecture of a distributed transaction processing system according to an embodiment of the present disclosure.
[0040] Figure 5 A partial structural diagram of an exemplary distributed transaction processing system according to an embodiment of the present disclosure is shown;
[0041] Figure 6 A schematic diagram of the structure of a computing device according to an embodiment of the present disclosure is shown. Detailed Implementation
[0042] The present disclosure is described below based on embodiments, but it is not limited to these embodiments. In the detailed description of the present disclosure below, certain specific details are described in detail. Those skilled in the art will fully understand the present disclosure even without these details. To avoid obscuring the substance of the present disclosure, well-known methods, processes, and procedures are not described in detail. Furthermore, the accompanying drawings are not necessarily drawn to scale.
[0043] Some of the terms or terms that appear in the description of the embodiments of this disclosure are to be interpreted as follows.
[0044] Host: A host is a device capable of accessing dynamic random access memory (RAM). Hosts include processors such as the Central Processing Unit (CPU), Graphics Processing Unit (GPU), Data Processing Unit (DPU), and Intelligence Processing Unit (IPU). Processors include multiple levels of cache (L1, L2, and L3). When reading data, the processor sequentially searches for the required data in the L1, L2, and L3 caches. If the required data is not found in these caches, it reads the data from RAM and loads it into the L3 cache, and then loads the data into the L1 and L2 caches.
[0045] Shared memory: Memory, also known as main memory, is used to temporarily store data processed by the processor and to exchange data with external storage devices such as hard drives. Shared memory is memory shared by multiple hosts, and all hosts can read from and write to the shared memory; that is, all hosts can access the shared memory.
[0046] Cache line: When a computer reads data from main memory into the cache, it needs to read a portion of the data near the data to be read into the cache as well. This group of data read at one time is called a cache line. Similarly, when the computer writes data from the cache back to main memory, it also needs to be done in units of cache lines. That is, a cache line is the unit of data reading and writing. Each level of cache can store multiple cache lines.
[0047] A transaction is a unit of program execution that accesses and may update data in a database; it is the basic unit of recovery and concurrency control. In a multi-host distributed transaction processing system, after a user initiates a transaction request on the client, multiple hosts cooperate to respond to the request. Ensuring efficient distributed transaction processing is a key technical consideration; however, current technologies cannot achieve efficient distributed transaction processing. Therefore, this disclosure provides a distributed transaction processing method.
[0048] Figure 1 The diagram shows a flowchart of a distributed transaction processing method provided in an embodiment of this disclosure. (Refer to...) Figure 1 The distributed transaction processing method includes:
[0049] Step S110: Receive a first request sent by the first host, wherein the first request is used to request access to the first address of the shared memory, which is shared by multiple hosts;
[0050] Step S120: Lock the response of the first address to each host request, update the cache status information of the first address according to the first request, and send the updated cache status of the data copy corresponding to the first address to the first host. The cache status information of the memory address is used to indicate the cache status of each host for the data copy corresponding to the memory address.
[0051] Step S130: Release the response lock of the first address to each host request and execute the first request of the first host.
[0052] The steps of the distributed transaction processing method provided in the embodiments of this disclosure will be described in detail below.
[0053] In one optional embodiment, the cached state information of the memory address is a multi-dimensional vector; the dimension of the multi-dimensional vector is equal to the number of multiple hosts sharing the shared memory, and the elements of the multi-dimensional vector indicate the cached state of the host corresponding to the data copy of the memory address; the cached state of the host for the data copy of the memory address includes the following: Invalidated (I), Shared (S), Exclusive (E), and Modified (M).
[0054] Specifically, the cached state of the host for the data copy corresponding to the memory address is invalid, meaning that the host has not cached the data copy corresponding to the memory address; the cached state of the host for the data copy corresponding to the memory address is shared, meaning that the host and at least one other host have cached the data copy corresponding to the memory address; the cached state of the host for the data copy corresponding to the memory address is exclusive, meaning that only the host has cached the data copy corresponding to the memory address; the cached state of the host for the data copy corresponding to the memory address is modified, meaning that only the host has cached the data copy corresponding to the memory address, and the host has modified the cached data copy.
[0055] Taking three hosts (host 1, host 2, and host 3) as an example, the cache state information for any memory address is represented as a three-dimensional vector. The first dimension corresponds to host 1, showing the cache state of host 1 for the data copy corresponding to that memory address; the second dimension corresponds to host 2, showing the cache state of host 2 for the data copy corresponding to that memory address; and the third dimension corresponds to host 3, showing the cache state of host 3 for the data copy corresponding to that memory address. In one example, the cache state information for a memory address is [S, S, I]. Based on this cache state information, it can be determined that host 1 and host 2 cache the data copy corresponding to that memory address, while host 3 does not cache the data copy corresponding to that memory address. In another example, the cache state information for a memory address is [E, I, I]. Based on this cache state information, it can be determined that host 1 exclusively uses the data copy corresponding to that memory address, while host 2 and host 3 do not cache the data copy corresponding to that memory address.
[0056] In step S120, the cache state information of the first address is updated according to the first request. That is, it is determined which hosts' cache state of the data copy corresponding to the first address will change due to the execution of the first request, and the cache state information of the first address is updated according to these changes. Again, multiple hosts are illustrated using the three hosts mentioned above as an example. In one example, the cache state information of the first address is [M, I, I], meaning that host 1 caches the data copy corresponding to the first address and modifies the cached data copy, while hosts 2 and 3 do not cache the data copy corresponding to the first address. Then, host 1 sends the first request, which is for host 1 to write the modified data copy corresponding to the first address locally back to the first address in shared memory. After the first request is executed, host 1's cache state of the data copy corresponding to the first address becomes "exclusive," while the cache states of hosts 2 and 3 remain unchanged. Thus, according to the first request, the cache state information of the first address needs to be updated from [M, I, I] to [E, I, I].
[0057] The updated cache state information for the first address indicates the cache state of each host for the data copy corresponding to the first address. Therefore, in achieving cache consistency, each host does not need to cache the data corresponding to the first address that has changed due to the first request in a timely manner. Instead, when using the data corresponding to the first address, the host only needs to determine whether to read the local copy of the data or cache the data from the shared memory's first address based on the current cache state information for the first address. This avoids hosts continuously copying redundant memory data, effectively improving the processing performance of distributed transactions. The cache state information for memory addresses, represented by a multi-dimensional vector, is relatively small in size and easy to update, effectively promoting the achievement of cache consistency.
[0058] It should be noted that since the host reads or writes data back to shared memory in units of cache lines, the first address mentioned in step S110 can be the address of a cache line. For example, a cache line is a 512-bit data block, so each 512 bits of data in shared memory has a cache state information.
[0059] In another optional embodiment, the memory address is further configured with locking information, which is used to indicate whether the memory address is in a locked state when responding to requests from each host; locking the response of the first address to requests from each host in step S120 includes setting the locking information of the first address to first data; unlocking the response of the first address to requests from each host in step S130 includes setting the locking information of the first address to second data.
[0060] It should be noted that if a memory address is locked when responding to requests from various hosts, then that memory address will only respond to the requests for which the lock applies. In step S120, the lock applies to the first request; that is, after locking the first address's responses to requests from various hosts in step S120, the first address will only respond to the first request until the lock on the first address's responses to requests from various hosts is released in step S130. Conversely, if a memory address is not locked when responding to requests from various hosts, then that memory address can respond to requests from all hosts.
[0061] Setting the memory address lock information as the first data indicates that the memory address is in a locked state when responding to requests from various hosts; setting the memory address lock information as the second data indicates that the memory address is not in a locked state when responding to requests from various hosts. The second data is different from the first data, and the two can be represented by one bit of binary data respectively. For example, the first data can be set to a high level to indicate binary data "1", and the second data can be set to a low level to indicate binary data "0".
[0062] In another optional embodiment, the cache state of at least one second host among the multiple hosts for the data copy corresponding to the first address is changed due to the first request. Again, the multiple hosts are illustrated by the three hosts described above. In one example, the cache state information for the first address is [S, S, I], meaning that both host 1 and host 2 cache the data copy corresponding to the first address, while host 3 does not cache the data copy corresponding to the first address. Then, host 1 sends a first request to modify the cached data copy of the first address. After the first request is executed, the cache state of host 1 for the data copy corresponding to the first address becomes "M", the cache state of host 2 for the data copy corresponding to the first address becomes "I", and the cache state of host 3 for the data copy corresponding to the first address remains unchanged. Therefore, among the multiple hosts, host 2 is a second host whose cache state for the data copy corresponding to the first address is changed due to the first request. In another example, the cache state information for the first address is [I, I, E], meaning that neither host 1 nor host 2 caches the data copy corresponding to the first address, only host 3 caches the data copy corresponding to the first address. Then host 1 sends the first request, which is host 1 performing a read operation on the first address of shared memory. After the first request is executed, the cache state of host 1 for the data copy corresponding to the first address changes to "S", the cache state of host 2 for the data copy corresponding to the first address remains unchanged, and the cache state of host 3 for the data copy corresponding to the first address also changes to "S". Therefore, among the multiple hosts, there is a second host, host 3, whose cache state for the data copy corresponding to the first address changes due to the first request.
[0063] Regarding the aforementioned change in the cache state of the data copy corresponding to the first address by the second host, after updating the cache state information of the first address according to the first request in step S120 and before releasing the response lock of the first address to each host request in step S130, the distributed transaction processing method further includes: sending the updated cache state of the data copy corresponding to the first address by the second host to the second host.
[0064] Specifically, since the updated cache state information for the first address indicates the updated cache state of each host for the data copy corresponding to the first address, the updated cache state of the second host for the data copy corresponding to the first address sent to the second host can be determined based on the updated cache state information for the first address. Similarly, the updated cache state of the first host for the data copy corresponding to the first address sent to the first host in step S120 can also be determined based on the updated cache state information for the first address.
[0065] In this embodiment, the updated cache state of the data copy corresponding to the first address is sent to the second host. This allows the second host to promptly obtain its own cache state for the data copy corresponding to the first address, ensuring that the cache states of the data copies corresponding to the first address obtained by multiple hosts are updated consistently, thus achieving cache consistency. Furthermore, just as the updated cache state of the first host for the data copy corresponding to the first address is sent to the first host, the updated cache state of the second host for the data copy corresponding to the first address is also sent to the second host after updating the cache state information of the first address according to the first request in step S120 and before releasing the lock on the response of the first address to the requests from each host in step S130. This is to ensure the atomicity of the distributed transaction.
[0066] Furthermore, the updated cache state of the data copy corresponding to the first address can be sent to the second host in the form of a data packet. The source address of the data packet header is the device executing the distributed transaction processing method, and the destination address is the second host. In this way, from the perspective of the second host, the change of its cache state of the data copy corresponding to the first address is controlled by the device executing the distributed transaction processing method. The second host is unaware that the above change was caused by the first request sent by the first host, thereby ensuring that the first request sent by the first host is isolated from the second host.
[0067] Figures 2(a), 2(b), and 2(c) illustrate an exemplary distributed transaction processing method according to an embodiment of the present disclosure. The memory control device 131 is an apparatus for executing the distributed transaction processing method. H1 identifies host 121, H2 identifies host 122, and H3 identifies host 123. As shown in Figure 2(a), the cache state information for the first address X is [S, S, I], meaning that both host 121 and host 122 cache a copy of the data corresponding to the first address X, while host 123 does not cache a copy of the data corresponding to the first address X. In this case, host 121 sends a first request, which is "Read_Exlusive[X]" as shown in the figure, i.e., a request for exclusive reading of the first address X in the shared memory. Then, as shown in Figure 2(b), the locking information of the first address X is set to "1", that is, the response of the first address X of the shared memory to the requests of each host is locked; then the cache status information of the first address X is updated, specifically, the cache status information of host 121 to the data copy is updated from shared state to exclusive state, and the cache status information of host 122 to the data copy is updated to invalid state, that is, the cache status information of the data copy corresponding to the first address of the shared memory is updated to [E, I, I]. Next, as shown in Figure 2(c), the locking information of the first address X is set to "0", that is, the lock of the first address X to the requests of each host is released. In addition, Figure 2(b) also shows sending "Invalidate[X]" to host 122, that is, sending the updated cache status "invalidated" of the data copy corresponding to the first address X to host 122; and Figure 2(c) also shows sending "Goto E&Response Data" to host 121, that is, executing the first request and sending the data of the first address requested by the first request to host 121.
[0068] The distributed transaction processing method described above focuses on distributed transactions executed across multiple hosts. Each host can perform concurrent control over its internal distributed transactions through Hardware Transactional Memory (HTM). Specifically, the host uses a multi-core processor, and each core tracks the read / write set of the transactions it processes based on the hardware transactional memory and detects transaction conflicts through a consistency protocol based on the hardware transactional memory. Only when there are no conflicts will the transaction be committed. The detailed process is based on the existing working principle of hardware transactional memory and will not be elaborated here. Compared to some concurrency management strategies that rely on software to maintain the atomicity, consistency, and isolation of transactions, the host's execution of concurrent control over its internal distributed transactions through hardware transactional memory has the advantage of less machine cycle (i.e., CPU cycle) consumption, thereby effectively reducing the performance overhead of each distributed transaction within the distributed transaction processing system.
[0069] In accordance with the distributed transaction processing method provided above, this disclosure also provides a memory control device. Figure 3 The diagram shown is a schematic of the memory control device. (Refer to...) Figure 3 The memory control device 13i includes a receiving unit 13i1, a processing unit 13i2, and a sending unit 13i3. The receiving unit 13i1 receives a first request sent by a first host, wherein the first request requests access to a first address of shared memory, which is shared by multiple hosts. The processing unit 13i2 locks the responses of the first address to the requests from each host and updates the cache state information of the first address according to the first request, wherein the cache state information of the memory address indicates the cache state of the data copy corresponding to the memory address by each host. The sending unit 13i3 sends the updated cache state of the data copy corresponding to the first address to the first host. Furthermore, the processing unit 13i2 also unlocks the responses of the first address to the requests from each host and executes the first request from the first host.
[0070] In an optional embodiment, if the cache state of at least one second host for the data copy corresponding to the first address changes due to the first request, the sending unit 13i3 is further configured to send the updated cache state of the second host for the data copy corresponding to the first address to the second host after the processing unit 13i2 updates the cache state information of the first address according to the first request and before the first address is unlocked from responding to the requests of each host.
[0071] In an optional embodiment, the sending unit 13i3 sends the updated cache status of the data copy corresponding to the first address to the second host in the form of a data packet. The source address of the data packet header is the memory control device 13i and the destination address is the second host.
[0072] Since the implementation details of the above-mentioned device have already been described in the detailed description of the embodiments of the distributed transaction processing method, they will not be repeated here for the sake of saving space.
[0073] Corresponding to the memory control device provided above, this disclosure also provides a distributed transaction processing system. Figure 4 The diagram shown is a schematic representation of one structure of this distributed transaction processing system. (Refer to...) Figure 4The distributed transaction processing system 100 includes a switch 110, hosts 121-12n, memory controllers 131-13m, and at least one dynamic random access memory (DRAM), where n is the number of hosts 121-12n and m is the number of memory controllers 131-13m. The switch 110 is connected to both hosts 121-12n and memory controllers 131-13m via high-speed computing links. Each memory controller 131-13m is connected to at least one DRAM, and all DRAMs connected to the memory controllers 131-13m constitute a shared memory shared by hosts 121-12n. This shared memory can be accessed by each of hosts 121-12n when the distributed transaction processing system 100 starts. Each memory controller 131-13m is as described in the above embodiment. The switch 110 is used to transmit interactive data between hosts 121-12n and memory controllers 131-13m.
[0074] Based on the above, it should be understood that, although Figure 4 The illustration shows a memory control device connected to two dynamic random access memories; however, the embodiments disclosed herein are not limited thereto.
[0075] A memory control device and a dynamic random access memory connected to it constitute a transaction support device in a distributed transaction processing system. Each transaction support device acts as a non-uniform memory access (NUMA) node in the distributed transaction processing system 100, and plays a role in supporting data sharing among multiple hosts.
[0076] Each of the hosts 121-12n can have a module on its own processor to support communication with the switch 110 via the relevant protocols of the compute fast link. The relevant protocols of the compute fast link include the CXL.cache sub-protocol, CXL.io sub-protocol, and CXL.men sub-protocol, which support the reuse of compute fast link on PCIe 5.0. The module is a hardware module in the processor as a CXL 2.0 home agent (HA).
[0077] The memory control devices 131-13m can use a field-programmable gate array (FPGA) to implement the basic functions of the CXL 2.0 device, including implementing the CXL.cache sub-protocol, CXL.io sub-protocol, and CXL.men sub-protocol executed on the CXL 2.0 device. Thus, each of the memory control devices 131-13m supports communication with the switch 110 via a compute-fast link.
[0078] Switch 110 can route data packets from any of the hosts 121-12n to one of the memory controllers 131-13m, and vice versa. Switch 110 can be connected to each of the hosts 121-12n and each of the memory controllers 131-13m via a Fast Peripheral Component Interconnect (FPCI) link. Since the Fast Peripheral Component Interconnect is compatible with the Fast Peripheral Component Interconnect protocol, communication involved in distributed transaction processing can be performed directly on this existing link without protocol conversion, thus achieving low-latency communication and effectively improving the processing performance of distributed transactions. The aforementioned Fast Peripheral Component Interconnect link can adopt a ×16 mode, enabling bidirectional bandwidth communication of up to 128GB / s between switch 110 and the hosts 121-12n, and between switch 110 and the memory controllers 131-13m, further improving the processing performance of distributed transactions.
[0079] It should be noted that in the distributed transaction processing system 100, although multiple hosts are connected to the switch 110, the multiple hosts are not visible to each other. That is, the switch 110 does not support sending data packets received from one host directly to another host. Thus, the requests sent by one host have good isolation from other hosts. In other words, the requests sent by one host will not be known to other hosts, including the data operations contained in the request and the data operated on. This avoids the interference of transactions generated by other hosts on one host.
[0080] The aforementioned CXL.io, CXL.cache, and CXL.mem sub-protocols are defined as protocols in the compute fast link. The CXL.io sub-protocol is an enhanced version of the PCIe 5.0 protocol, used for initialization, linking, and discovery of memory controllers 131-13m, providing a non-consistent load / store interface for memory controllers 131-13m. The CXL.cache sub-protocol defines the interaction between hosts 121-12n and memory controllers 131-13m, allowing memory controllers 131-13m to efficiently cache the memory of hosts 121-12n with extremely low latency using request and response methods. The CXL.mem sub-protocol allows the respective processors of hosts 121-12n to access the memory of memory controllers 131-13m using load and store commands. These protocols combined provide an extremely low-latency path for memory access and consistent caching between hosts 121-12n and memory controllers 131-13m, thus expanding the capacity for fast data access by each host through the memory controller. The aforementioned distributed transaction processing system provides a feasible low-latency solution for transaction processing in distributed database / distributed computing frameworks. This system can also be used as a multi-host server in a data center, enabling servers to handle large volumes of rapidly accessible data.
[0081] Furthermore, each of the memory controllers 131-13m can be equipped with at least one Dual Inline Memory Module (DIMM), which is used as dynamic random access memory. For each of the memory controllers 131-13m, the field-programmable gate array and the DIMM can be integrated on a single circuit board, appearing as a single card. Therefore, a transaction support device consisting of a memory controller and its connected DIMM is also called a transaction support card (TSC).
[0082] It should be noted that for the distributed transaction processing system 100, the number of hosts 121-12n and the number of memory controllers 131-13m are limited by the number of ports on the switch 110. Specifically, the number of hosts 121-12n cannot exceed the number of uplink ports on the switch 110, and the number of memory controllers 131-13m cannot exceed the number of downlink ports on the switch 110. For example, if the switch 110 has 8 uplink ports, the distributed transaction processing system 100 can be configured with a maximum of 8 hosts; if the switch 110 has 8 downlink ports, the distributed transaction processing system 100 can be configured with a maximum of 8 memory controllers. Of course, for a switch 110 with 8 uplink ports and 8 downlink ports, the distributed transaction processing system 100 can also... Figure 5 The setup shown includes 3 hosts (host 121, host 122, and host 123) and 4 memory control devices (memory control device 131, memory control device 132, memory control device 133, and memory control device 4). In this case, n = 3 and m = 4. Since the number of hosts in the distributed transaction processing system 100 is greater than 1, the value of n must be greater than 1, but the value of m can be equal to 1 if a transaction support device has sufficient storage space.
[0083] For the distributed transaction processing methods shown in Figures 2(a), 2(b), and 2(c), Figure 5 The illustration depicts the interaction between multiple hosts and the memory control device 131. Since the focus is on illustrating the interaction between multiple hosts and the memory control device, Figure 5 Only a portion of the distributed transaction system is shown; specifically, the dynamic random access memory (DRAM) included in the distributed transaction system is not illustrated. It should be noted that... Figure 5 The memory controller 131 is connected to a dynamic random access memory with a first address, therefore, among the multiple memory controllers connected to the switch 110, only memory controller 131 interacts with the host. (Refer to...) Figure 5 For the distributed transaction processing method shown in Figures 2(a), 2(b) and 2(c), firstly, host 121 sends a first request to memory control device 131 by executing step S1. Then, memory control device 131 updates the cache status information of the first address by executing step S2. Then, memory control device 131 sends the updated cache status information corresponding to host 122 to host 122 by executing step S3. The interactions involved in steps S1 and S3 are all implemented by transmitting the corresponding interaction data through switch 110.
[0084] According to an embodiment of the present disclosure, a distributed transaction processing method can be provided by... Figure 6 The computing device 800 shown is implemented. See below for reference. Figure 6To describe a computing device 800 according to an embodiment of the present disclosure. Figure 6 The computing device 800 shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments disclosed herein.
[0085] like Figure 6 As shown, the computing device 800 is presented in the form of a general-purpose computing device. The components of the computing device 800 may include, but are not limited to: at least one processor 810, at least one storage unit 820, and a bus 830 connecting different system components (including storage unit 820 and processor 810).
[0086] The storage unit 820 stores computer-executable code that can be executed by the processor 810, causing the processor 810 to perform the steps of the various exemplary embodiments of this disclosure described in the description of the exemplary methods above. For example, the processor 810 can perform actions such as... Figure 3 The steps shown are as follows.
[0087] Storage unit 820 may include a computer-readable storage medium in the form of a volatile storage unit, such as random access memory (RAM) 8201 and / or cache memory 8202, and may further include read-only memory (ROM) 8203.
[0088] The storage unit 820 may also include a program / utility 8204 having a set (at least one) of program modules 8205, including but not limited to: an operating system, one or more application programs, other program modules, and program data, each or some combination of these examples may include an implementation of a network environment.
[0089] Bus 830 can represent one or more of several types of bus structures, including a memory cell bus or memory cell controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus using any of the various bus structures.
[0090] The computing device 800 can also communicate with one or more external devices 700 (e.g., keyboard, pointing device, Bluetooth device, etc.), one or more devices that enable a user to interact with the computing device 800, and / or any device that enables the computing device 800 to communicate with one or more other computing devices (e.g., router, modem, etc.). This communication can be performed via input / output (I / O) interface 850. Furthermore, the computing device 800 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 860. As shown, network adapter 860 communicates with other modules of the computing device 800 via bus 830. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with the computing device 800, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0091] It should be understood that the above description is merely a preferred embodiment of this disclosure and is not intended to limit this disclosure. For those skilled in the art, there are many variations of the embodiments in this specification. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this disclosure should be included within the protection scope of this disclosure.
[0092] It should be understood that the various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on describing the differences from other embodiments.
[0093] It should be understood that the foregoing describes specific embodiments of this specification. Other embodiments are within the scope of the claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0094] It should be understood that the use of a singular form to describe an element or to show only one element in the accompanying drawings does not imply that the number of such element is limited to one. Furthermore, modules or elements described or shown as separate herein may be combined into a single module or element, and modules or elements described or shown as single herein may be broken down into multiple modules or elements.
[0095] It should also be understood that the terminology and expressions used herein are for descriptive purposes only, and one or more embodiments described herein should not be limited to these terms and expressions. The use of these terms and expressions does not exclude any illustrative and descriptive equivalent features (or parts thereof), and it should be recognized that various modifications that may exist should also be included within the scope of the claims. Other modifications, variations, and substitutions may also exist. Accordingly, the claims should be considered to cover all such equivalents.
[0096] The user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation portals are provided for users to choose to authorize or refuse.
Claims
1. A distributed transaction processing method, comprising: Receive a first request sent by a first host, wherein the first request is used to request access to a first address of shared memory, the shared memory being shared by multiple hosts; Lock the response of the first address to each host request, update the cache status information of the first address according to the first request, and send the updated cache status of the data copy corresponding to the first address to the first host. The cache status information of the memory address is used to indicate the cache status of each host for the data copy corresponding to the memory address. Release the lock on the responses of the first address to requests from each host, and execute the first request of the first host; Among the plurality of hosts, the cache state of at least one second host for the data copy corresponding to the first address is changed due to the first request; After updating the cache state information of the first address according to the first request and before releasing the lock on the response of the first address to each host request, the method further includes: sending the updated cache state of the data copy corresponding to the first address to the second host.
2. The distributed transaction processing method according to claim 1, wherein, The cached state information of memory addresses is a multi-dimensional vector; The dimension of the multidimensional vector is equal to the number of the plurality of hosts, and the elements of the multidimensional vector indicate the caching status of the host corresponding to the element for the data copy corresponding to the memory address; Furthermore, the cached state of the host for the data copy corresponding to the memory address includes the following types: invalid state, shared state, exclusive state, and modified state.
3. The distributed transaction processing method according to claim 1, wherein, The memory address is also configured with locking information, which indicates whether the memory address is in a locked state when responding to requests from various hosts. Lock the responses from the first address to requests from each host. This includes setting the locking information of the first address as the first data; Releasing the lock on the first address for each host request includes setting the lock information of the first address as the second data.
4. The distributed transaction processing method of claim 1, wherein, Sending the updated cache state of the data copy corresponding to the first address to the second host includes: The updated cache state of the data copy corresponding to the first address is sent to the second host in the form of a data packet, wherein the source address in the header of the data packet is the device executing the distributed transaction processing method and the destination address is the second host.
5. A memory control device, comprising: A receiving unit is configured to receive a first request sent by a first host, wherein the first request is for requesting access to a first address of shared memory, the shared memory being shared by multiple hosts; The processing unit is configured to lock the response of the first address to each host request and update the cache status information of the first address according to the first request, wherein the cache status information of the memory address is used to indicate the cache status of each host for the data copy corresponding to the memory address. The sending unit is used to send the updated cache state of the data copy corresponding to the first address to the first host. The processing unit is further configured to release the response lock of the first address to each host request and execute the first request of the first host; Among the plurality of hosts, the cache state of at least one second host for the data copy corresponding to the first address is changed due to the first request; The sending unit is further configured to send the updated cache status of the data copy corresponding to the first address to the second host after updating the cache status information of the first address according to the first request and before releasing the response lock of the first address to each host request.
6. The memory control device of claim 5, wherein, The sending unit sends the updated cache status of the data copy corresponding to the first address to the second host in the form of a data packet. The source address of the data packet is the memory control device and the destination address is the second host.
7. A distributed transaction processing system comprising: A switch, multiple hosts, at least one dynamic random access memory, and at least one memory control device according to any one of claims 5-6, wherein, The switch is connected to the plurality of hosts and at least one of the memory control devices respectively via a computing fast link; The memory control device is connected to at least one of the dynamic random access memories, and the at least one dynamic random access memory constitutes a shared memory shared by the plurality of hosts; The switch is used to transmit interactive data between the host and the memory control device.
8. A computing device, comprising: Memory, used to store executable code in a computer; A processor for executing the computer-executable code to implement the steps of the distributed transaction processing method according to any one of claims 1-4.
9. A computer-readable storage medium storing computer-executable code, which, when executed by a processor, implements the steps of the distributed transaction processing method according to any one of claims 1-4.
Citation Information
Patent Citations
Methods, equipment and system for realizing memory sharing in aggregation virtualization
CN103858111A
Distributed memory management method based on network and page granularity management
CN111273860A
