Memory allocation method and device cluster

By constructing a memory pool and directly transmitting the physical address of the target memory, the latency problem of inter-device memory access in P2P technology is solved, thereby improving the efficiency of memory access and resource utilization in device clusters.

WO2026243068A1PCT designated stage Publication Date: 2026-11-26HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2026/097896
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2025-05-21
Filing Date
2026-05-20
Publication Date
2026-11-26

AI Technical Summary

Technical Problem

In existing P2P technology, memory access between devices requires three address translations, resulting in a complex process and long processing time.

Method used

By controlling the device to build a memory pool, the first physical address of the target memory is directly transmitted, reducing the number of address translations and enabling memory access between devices to require only two translations.

Benefits of technology

It reduces memory access latency between devices in the device cluster and improves the utilization efficiency of memory resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2026097896_26112026_PF_FP_ABST
    Figure CN2026097896_26112026_PF_FP_ABST
Patent Text Reader

Abstract

Provided in the present application are a memory allocation method and a device cluster, which can be applied to the technical field of computers. The method is applied to a device cluster comprising a control device and a plurality of devices. The plurality of devices are connected by means of a peer-to-peer interconnect bus. The control device stores a first physical address of a memory in a memory pool and a capacity thereof. The memory in the memory pool is contributed by the plurality of devices; and the first physical address of the memory is an address of a memory of a device among the plurality of devices that is related to the memory. The method comprises: a control device receiving a memory request of a first device among a plurality of devices, wherein the memory request carries a target capacity; and the control device transmitting a first physical address of a target memory to the first device, wherein a memory pool comprises the target memory, and the total capacity of the target memory is greater than or equal to the target capacity. The method enables a first device to directly use an address of a memory of a device that is related to a target memory to access a memory of another device, thereby reducing the memory access latency between devices in the same device cluster.
Need to check novelty before this filing date? Find Prior Art

Description

A memory allocation method and device cluster

[0001] This application claims priority to Chinese Patent Application No. 202510664337.0, filed on May 21, 2025, entitled "A Memory Allocation Method and Device Cluster", the entire contents of which are incorporated herein by reference. Technical Field

[0002] This application relates to the field of computer technology, and in particular to a memory allocation method and device cluster. Background Technology

[0003] Peer-to-peer (P2P) networking technology allows multiple devices connected by the same peer-to-peer bus to access each other's memory resources, thereby achieving memory resource sharing and improving memory utilization. Specifically, P2P technology requires that all shareable memory resources be uniformly addressed, allowing these devices to access memory by transmitting a unified address.

[0004] Under these requirements, when the first device accesses the memory of the second device using P2P technology, it needs to undergo three address translations and one message transmission. The first device first translates the virtual address in the user instruction into the actual address in its memory, then translates the actual address into a unified address, and transmits the unified address to the second device via the peer-to-peer bus. The second device then translates the unified address into its actual address in its memory. After these three address translations, the first device can access the memory of the second device. However, this translation mode results in a complex and time-consuming process when the first device accesses the memory of the second device. Summary of the Invention

[0005] To address the aforementioned technical problems, this application provides a memory allocation method and a device cluster, which can reduce the memory access latency between devices in the same device cluster.

[0006] Firstly, a memory allocation method is provided, applied to a device cluster. The device cluster includes a control device and multiple devices. The multiple devices are connected via a peer-to-peer interconnect bus. The control device stores the first physical address and capacity of memory in a memory pool. The memory in the memory pool is provided by the multiple devices. The first physical address of the memory is the address of the memory of the device associated with that memory among the multiple devices. The method includes: the control device receiving a memory request from a first device among the multiple devices. The memory request carries a target capacity. The control device transmits the first physical address of the target memory to the first device. The memory pool includes the target memory. The total capacity of the target memory is greater than or equal to the target capacity.

[0007] In the above scheme, the control device directly transmits the memory address of the device associated with the target memory to the first device, allowing the first device to directly access the memory of other devices using the memory address of the device associated with the target memory. In this way, the first device no longer needs to translate the physical address of its own memory into a unified address to meet the traditional transmission requirements of P2P technology, and the peer device no longer needs to translate the unified address from the first device into the physical address of its own memory. Therefore, this method can reduce the memory access latency between devices in the same device cluster.

[0008] In some possible implementations, the aforementioned multiple devices include a second device. The second device is used to provide the target memory. Before the control device receives the memory request from the first device, the method further includes: the control device receiving the address of the memory of the second device and using the address of the memory of the second device as the first physical address of the target memory.

[0009] In some possible implementations, the target memory mentioned above includes a first memory. The plurality of devices mentioned above includes a third device. The third device is used to provide the first memory. The method further includes: the first device generating a first message and transmitting the first message to the third device via a peer-to-peer interconnect bus. The first message carries a first operation and a first physical address of the first memory, and the first message is used to instruct the third device to perform the first operation on the first memory.

[0010] This technical solution supports using the address of the provider's memory as the first physical address of the memory in the memory pool. In this application scenario, when constructing the memory pool, the control device can directly determine the first physical address of all memory in the memory pool. After the first device obtains the first physical address of the target memory, when it needs to operate on the first memory in the target memory, it can directly transmit the operation content (corresponding to the first operation) and the first physical address of the first memory (i.e., the address of the third device's memory) to the third device. Subsequently, the memory controller of the third device executes the first operation on the first memory based on the first physical address of the first memory. It can be seen that in this technical solution, after the first device translates the virtual address in the user instruction into the address of its own memory, the first device can directly translate the address of its own memory into the address of the third device's memory and transmit the address of the third device's memory to the third device through the peer-to-peer interconnect bus. This conversion mode only involves two address translations to enable the first device to access the memory of the third device. Compared with the existing three address translations, two address translations can reduce the process when the first device accesses the memory of the third device and shorten the access time.

[0011] In some possible implementations, the first message carries address permissions. These address permissions indicate the operations permitted to be performed on the first memory location, and are used to verify whether the first operation is included.

[0012] In this technical solution, when the first device accesses the memory of the third device, the first message transmitted directly carries the address permissions. Since the address permissions directly describe the specific access permissions (such as read, write, execute) to the specified memory area, the permissions are fine-grained and clear. This allows the third device to immediately determine whether access is allowed based on the address permission bits, without the need for additional token verification, permission query or authorization process. Therefore, access latency can be reduced and communication and computing overhead can be reduced.

[0013] In some possible implementations, the memory request includes the address of the memory of the first device. After the control device receives the memory request from the first device, the method further includes: the control device determining the target memory from the memory pool based on the target capacity; the control device generating a correspondence between the address of the target memory and the address of the memory of the first device, and using the address of the memory of the first device as the first physical address of the target memory.

[0014] In some possible implementations, the target memory includes a second memory. The plurality of devices includes a fourth device. The fourth device is used to provide the second memory. After the control device transmits the first physical address of the target memory to the first device, the method further includes: the first device generating a second message and transmitting the second message to the fourth device via a peer-to-peer interconnect bus. The second message carries a second operation and the first physical address of the second memory. The fourth device determines the second physical address of the second memory based on the first physical address of the second memory, and then performs the second operation on the second memory based on the second physical address. The second physical address is the address of the memory of the fourth device.

[0015] In some possible implementations, the target memory includes a third memory. The plurality of devices includes a fifth device. The fifth device is used to provide the third memory. After the control device transmits the first physical address of the target memory to the first device, the method further includes: the first device determining the third physical address of the third memory based on the first physical address of the third memory. The third physical address is the address of the memory of the fifth device. The first device generates a third message and transmits the third message to the fifth device via a peer-to-peer interconnect bus. The third message carries a third operation and the third physical address of the third memory, and is used to instruct the fifth device to perform a third operation on the third memory.

[0016] This technical solution supports using the address of the user's memory as the first physical address of the memory in the memory pool. In this application scenario, the control device determines the first physical address of the memory when allocating memory in the memory pool. After the first device obtains the first physical address of the target memory, when it needs to operate on part (or all) of the target memory, it can choose either of two methods. In the first method, the first device directly transmits the operation content (corresponding to the second operation) and the first physical address of the second memory (i.e., the address of the first device's memory) to the fourth device. Subsequently, the fourth device converts the first physical address of the second memory into the address of its own memory (i.e., the second physical address of the second memory), and then the memory controller of the fourth device performs the second operation on the second memory based on the second physical address of the second memory. In the second method, the first device first converts the first physical address of the third memory (i.e., the address of the first device's memory) into the third physical address of the third memory (i.e., the address of the fifth device's memory), and then transmits the operation content (corresponding to the third operation) and the third physical address of the third memory to the fifth device. Subsequently, the memory controller of the fifth device performs the third operation on the third memory based on the third physical address of the third memory. As can be seen, this technical solution supports translating the virtual address in the user instruction into the memory address of the device receiving the user instruction, and directly translating the memory address of the device receiving the user instruction into the memory address of the device to which the memory to be accessed belongs. This translation mode only involves two address translations to enable the first device to access the memory of other devices. Compared to the existing three address translations, two address translations can reduce the process when the first device accesses the memory of other devices and shorten the access time.

[0017] Secondly, a memory allocation method is provided, applied to a device cluster. The device cluster includes a control device and multiple devices. The multiple devices are connected via a peer-to-peer interconnect bus. The control device stores the first physical address and capacity of memory in a memory pool. The memory in the memory pool is provided by the multiple devices. The first physical address of the memory is the address of the memory of the device associated with that memory among the multiple devices. The multiple devices include a first device. The method includes: the first device transmitting a memory request to the control device and receiving the first physical address of the target memory from the control device. The memory request carries the target capacity. The memory pool includes the target memory. The total capacity of the target memory is greater than or equal to the target capacity.

[0018] In some possible implementations, the target memory mentioned above includes a first memory. The plurality of devices mentioned above includes a third device. The third device is used to provide the first memory. The method further includes: the first device generating a first message and transmitting the first message to the third device via a peer-to-peer interconnect bus. The first message carries a first operation and a first physical address of the first memory. The first physical address of the first memory is the address of the memory of the third device. The first message is used to instruct the third device to perform a first operation on the first memory.

[0019] In some possible implementations, the first message carries address permissions. These address permissions indicate the operations permitted to be performed on the first memory location, and are used to verify whether the first operation is included.

[0020] In some possible implementations, the target memory includes a second memory. The plurality of devices includes a fourth device. The fourth device is used to provide the second memory. The method further includes: the first device generating a second message and transmitting the second message to the fourth device via a peer-to-peer interconnect bus. The second message carries a second operation and a first physical address of the second memory. The first physical address of the second memory is the address of the memory of the first device. The fourth device determines a second physical address of the second memory based on the first physical address of the second memory. The second physical address is the address of the memory of the fourth device. The fourth device performs a second operation on the second memory based on the second physical address of the second memory.

[0021] In some possible implementations, the target memory mentioned above includes third memory. The plurality of devices mentioned above includes a fifth device. The fifth device is used to provide the third memory. The method further includes: a first device determining a third physical address of the third memory based on a first physical address of the third memory. Wherein, the first physical address of the third memory is the address of the memory of the first device. The third physical address of the third memory is the address of the memory of the fifth device. The first device generates a third message and transmits the third message to the fifth device via a peer-to-peer interconnect bus. Wherein, the third message carries a third operation and the third physical address of the third memory. The third message is used to instruct the fifth device to perform a third operation on the third memory.

[0022] Thirdly, a control device is provided for storing a first physical address and capacity of memory in a memory pool. The memory in the memory pool is provided by multiple computing devices. The multiple computing devices are connected via a peer-to-peer interconnect bus. The first physical address of the memory is the address of the memory of the computing device associated with that memory among the multiple computing devices. The multiple computing devices include a first device. The control device includes a first receiving unit and a first sending unit. The first receiving unit is used to receive a memory request from the first device. The memory request carries a target capacity. The first sending unit is used to transmit the first physical address of the target memory to the first device. The memory pool includes target memory. The total capacity of the target memory is greater than or equal to the target capacity.

[0023] In some possible implementations, the aforementioned plurality of computing devices includes a second device. The second device is used to provide the target memory. The aforementioned first receiving unit is further configured to receive the address of the memory of the second device before receiving a memory request from the first device, and to use the address of the memory of the second device as the first physical address of the target memory.

[0024] In some possible implementations, the memory request includes the address of the memory of the first device. The control device includes a determining unit. The determining unit is configured to, after the first receiving unit receives the memory request from the first device, determine the target memory from the memory pool based on the target capacity, generate a correspondence between the address of the target memory and the address of the memory of the first device, and use the address of the memory of the first device as the first physical address of the target memory.

[0025] Fourthly, a computing device is provided as a first device. This first device comprises multiple computing devices. The multiple computing devices are connected via a peer-to-peer interconnect bus. The multiple computing devices provide memory in a memory pool. A first physical address and capacity of the memory in the memory pool are stored by a control device. The first physical address of the memory is the address of the memory of the computing device associated with that memory among the multiple computing devices. The first device includes a second sending unit and a second receiving unit. The second sending unit is used to transmit a memory request to the control device. The memory request carries a target capacity. The second receiving unit is used to receive the first physical address of the target memory from the control device. The memory pool includes the target memory. The total capacity of the target memory is greater than or equal to the target capacity.

[0026] In some possible implementations, the target memory includes a first memory. Multiple computing devices include a third device. The third device is used to provide the first memory. The second sending unit is further used to generate a first message and transmit the first message to the third device via a peer-to-peer interconnect bus. The first message carries a first operation and a first physical address of the first memory. The first physical address of the first memory is the address of the memory of the third device. The first message is used to instruct the third device to perform a first operation on the first memory.

[0027] In some possible implementations, the first message carries address permissions. Address permissions indicate the operations permitted to be performed on the first memory location. Address permissions are used to verify whether the first operation is included.

[0028] In some possible implementations, the target memory includes a second memory. Multiple computing devices include a fourth device. The fourth device is used to provide the second memory. The second sending unit is further used to generate a second message and transmit the second message to the fourth device via a peer-to-peer interconnect bus, so that the fourth device determines the second physical address of the second memory based on the first physical address of the second memory, and then performs a second operation on the second memory based on the second physical address of the second memory. The second message carries the second operation and the first physical address of the second memory. The first physical address of the second memory is the address of the memory of the first device. The second physical address of the second memory is the address of the memory of the fourth device.

[0029] In some possible implementations, the target memory includes a third memory. Multiple computing devices include a fifth device. The fifth device is used to provide the third memory. The second sending unit is further used to determine the third physical address of the third memory based on the first physical address of the third memory. The first physical address of the third memory is the address of the memory of the first device. The third physical address of the third memory is the address of the memory of the fifth device. The second sending unit is further used to generate a third message and transmit the third message to the fifth device via a peer-to-peer interconnect bus. The third message carries a third operation and the third physical address of the third memory. The third message is used to instruct the fifth device to perform a third operation on the third memory.

[0030] Fifthly, a computing device is provided, the computing device including a processor and a memory, the processor being configured to execute instructions stored in the memory to cause the computing device to perform an action performed by a control device as in any of the methods of the first aspect, or to perform an action performed by a first device as in any of the methods of the second aspect.

[0031] A sixth aspect provides a device cluster, which is a device cluster as described in any of the methods of the first aspect. The device cluster includes a control device and a first device. The control device is used to perform actions performed by the control device as described in any of the methods of the first aspect. The first device is used to perform actions performed by the first device as described in any of the methods of the first aspect.

[0032] In a seventh aspect, a chip is provided, including a processor and a power supply circuit for supplying power to the processor, which is used to perform actions performed by a control device as in any of the methods of the first aspect.

[0033] Eighthly, a computer program product containing instructions is provided that, when the instructions are run by a cluster of devices, causes the cluster of devices to perform the method as described in any of the first aspects.

[0034] A ninth aspect provides a computer-readable storage medium, characterized in that it includes computer program instructions that, when executed by a cluster of devices, perform the method as described in any of the first aspects. Attached Figure Description

[0035] Figure 1 is a schematic diagram of a device cluster structure provided in an embodiment of this application;

[0036] Figure 2 is a schematic diagram of a data center architecture provided in an embodiment of this application;

[0037] Figure 3 is a schematic diagram of a memory pool provided in an embodiment of this application;

[0038] Figure 4 is a schematic diagram of the architecture of a device cluster provided in an embodiment of this application;

[0039] Figure 5 is a schematic diagram of another device cluster architecture provided in an embodiment of this application;

[0040] Figure 6 is a flowchart illustrating a memory allocation method provided in an embodiment of this application;

[0041] Figure 7 is a schematic diagram of the structure of a control device provided in this application;

[0042] Figure 8 is a schematic diagram of the structure of a computing device provided in this application;

[0043] Figure 9 is a schematic diagram of the structure of a computing device provided in an embodiment of this application. Detailed Implementation

[0044] The technical solutions of the embodiments of this application will now be described with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.

[0045] To address the problem of multiple steps and long processing times when the first device accesses the memory of the second device using P2P technology in the existing address translation mode, this application provides a memory allocation method. This method allows the first device in the same device cluster to access the memory of the second device using P2P technology with only two address translations, effectively reducing the latency of accessing the memory of the remote device.

[0046] The application scenarios of the memory allocation method provided in this application will be introduced below.

[0047] Referring to Figure 1, Figure 1 is a schematic diagram of a device cluster structure provided in an embodiment of this application. As shown in Figure 1, the device cluster includes a control device 10 and multiple devices (taking three devices as an example, including device 11, device 12, and device 13) and a peer-to-peer interconnection bus 14.

[0048] Devices (such as Device 11, Device 12, Device 13) generally refer to devices with CPUs and memory, capable of hosting or running a standalone operating system (OS). A device can correspond to a physical server (including processor and memory), or it can correspond to one or more virtual machines virtualized from a physical server. To process certain tasks or data, a device typically needs to utilize memory resources.

[0049] The peer-to-peer interconnect bus 14 is used to connect devices 11, 12, 13, and other devices. Devices 11, 12, 13, and other devices connected via the peer-to-peer interconnect bus 14 have the same status, thus allowing direct data exchange and communication between them. Devices connected via the peer-to-peer interconnect bus 14, such as devices 11, 12, and 13, can provide their own memory to build a memory pool. For example, if device 11 provides 10 gigabytes (GB), device 12 provides 20 GB, and device 13 provides 50 GB, then the memory pool will contain at least 80 GB of memory. After the memory pool is built, each device connected via the peer-to-peer interconnect bus 14 can access the memory in the memory pool.

[0050] Control device 10 can be a standalone physical server (including processor and memory), or it can correspond to one of one or more virtual machines virtualized on a physical server. Control device 10 typically hosts independent management software (such as Fabric Manager, FM). Understandably, when a device hosts management software (such as FM), it is also control device 10; that is, a device can be control device 10, device 11, device 12, or device 13 simultaneously. Control device 10 can be used to allocate memory resources in a memory pool to one or more devices in a device cluster. Optionally, control device 10 can register or deregister memory resources in the memory pool based on changes in memory allocation strategies or changes in memory resources in the memory pool, dynamically allocating memory resources in the memory pool to devices.

[0051] It should be understood that the number of devices in the device cluster is illustrated using the device cluster shown in Figure 1, which includes devices 11, 12, and 13 as an example. In practical applications, the number of devices in the device cluster can be more or less, and this application does not make a specific limitation. When the device cluster includes more devices, and these devices are all connected through the same peer-to-peer interconnect bus, it supports more devices providing their own memory to expand the memory pool and increase the memory resources in the memory pool.

[0052] For ease of understanding, the following will provide an exemplary description of the applicable scenarios of the device cluster provided in the embodiments of this application. Taking the application to a data center as an example, please refer to Figure 2. Figure 2 is a schematic diagram of the architecture of a data center provided in the embodiments of this application. A data center (DC) 20 generally refers to the centralized processing, storage, transmission, exchange and management of information in a physical space. It can generally include servers (such as server 21 and server 22), network devices, storage devices, etc. In addition, it can also include other basic devices and other devices that provide specific services to the servers.

[0053] The servers can be standalone servers (such as servers 21 and 22) or server clusters (such as a server cluster consisting of servers 21 and 22). Servers generally include CPUs and memory. Network devices can be routers, switches, and network interface cards (NICs), used to provide network services to the servers. Storage devices are used to store information, providing data storage services to the servers. This typically involves digitizing the information and then storing it using media such as electricity, magnetism, or optical signals, such as hard drives and memory cards. Other basic equipment can include various devices that ensure the normal operation of the data center 20, such as network security equipment (e.g., firewalls), power supply equipment (e.g., uninterruptible power supplies, UPS), cooling equipment (e.g., air conditioners), and fire protection equipment (e.g., smoke detectors, fire extinguishers).

[0054] The control device provided in this embodiment can correspond to a server device in the data center 20, such as server 21 or server 22; the control device can also correspond to a server cluster, such as a server cluster composed of server 21 and server 22; the control device can also correspond to one of multiple hosts virtualized on a server device, for example, three hosts are virtualized on server 21, where the host with the sequence number 1 can be the control device. Similarly, the device provided in this embodiment can correspond to a server device in the data center 20, such as server 21 or server 22; the device can also correspond to a server cluster, such as a server cluster composed of server 21 and server 22 (or a cluster composed of other servers); the device can also correspond to one of multiple hosts virtualized on a server device, for example, three hosts are virtualized on server 21, where the host with the sequence number 2 and / or 3 can be the device.

[0055] Referring to Figure 3, which is a schematic diagram of a memory pool provided in an embodiment of this application, the memory pool may include memory from multiple devices. For example, it includes memory 1 and memory 2 provided by device 11, memory 3 provided by device 12, and memory 4 provided by device 13. A control device can allocate the memory resources in the memory pool to at least one of the aforementioned devices. It should be noted that the control device can allocate some or all of the memory resources in the memory pool to a single device. For example, the control device can allocate some or all of the memory in the memory pool to a first device. Alternatively, the control device can allocate some or all of the memory in the memory pool to the first device in a first time period, and then allocate the memory resources originally allocated to the first device to other devices in a second time period. Alternatively, the control device can allocate a portion of the memory in the memory pool to the first device and allocate another portion of the memory in the memory pool to other devices. These other devices are devices other than the first device among the aforementioned multiple devices. For example, as shown in Figure 3, the control device allocates memory 1 to device 12 (the first device), and memory 2 and memory 3 to device 13 (another device).

[0056] In one possible implementation, the control device directly establishes a connection with multiple devices, as shown in Figure 4. Figure 4 is a schematic diagram of the architecture of a device cluster provided in an embodiment of this application. The control device 10 is connected to multiple devices through a peer-to-peer interconnection bus, and the control device 10 can communicate with devices 11, 12, and 13 through the peer-to-peer interconnection bus 14.

[0057] In another possible implementation, the control device indirectly establishes connections with multiple devices, as shown in Figure 5. Figure 5 is a schematic diagram of another device cluster architecture provided in an embodiment of this application. The device cluster also includes a switching device 15 (e.g., a switch). The switching device 15 can be used to connect the control device 10 and multiple devices (including devices 11, 12, and 13). The switching device 15 can provide a large number of ports. By adding the switching device 15, the multiple devices and the control device 10 do not need to establish direct connections, saving and protecting the physical ports of the devices and facilitating the expansion of the number of devices in the device cluster. In addition, the switching device 15 can also forward communication messages (e.g., packets) for each device in the device cluster.

[0058] Optionally, the control device 10 can configure network addresses for the physical ports of the aforementioned multiple devices, the control device 10, and the switching device 15, respectively, so that communication between the multiple devices, the control device 10, and the switching device 15 can be routed based on the network addresses of each physical port. For example, a communication message (e.g., a packet) may include the network addresses of the source and destination ports. When forwarding communication messages, the switching device 15 routes the messages based on the network addresses of the source and destination ports, thereby enabling communication between the devices.

[0059] In one possible implementation, the control device 10 can configure an entity identity identifier for each device in the device cluster. That is, the control device 10 can assign a unique ID (i.e., entity identity identifier) ​​to each device in the device cluster to uniquely identify the device, thereby achieving unified and peer-to-peer management of multiple devices. For example, when allocating memory resources to a device, the device can be identified through its entity identity identifier, thus enabling the sending of messages to it.

[0060] Optionally, the control device 10 can distinguish the devices in the aforementioned device cluster using a globally unique identifier (GUID). The GUID is a device identifier and is globally unique, typically 128 bits in length. Furthermore, when scanning the device cluster, the control device 10 can also use the GUID to discover and determine how many devices exist within the cluster and what type of device they belong to.

[0061] Optionally, the control device 10 can configure an entity identifier (EID) for each device in the device cluster, thereby distinguishing different devices through the EID. For example, the length of the EID is determined based on the total number of devices. For instance, if there are 16 devices, the control device 10 can distinguish all devices using 4 bits of data. Or, for example, if there are 32 devices, the management host can distinguish all devices using 5 bits of data.

[0062] Compared to using GUIDs to distinguish different devices, the method of configuring EIDs to distinguish different devices in this embodiment uses fewer resources. Understandably, the purpose of configuring EIDs is to distinguish different devices, and the specific configuration method can refer to other methods, which are not specifically limited here. It is also understood that when there are a large number of devices in the system, and the resources required to configure EIDs to distinguish different devices are greater than those required by GUIDs, GUIDs can be used to distinguish different devices without configuring EIDs separately.

[0063] The above describes the relevant architecture of the device cluster in the embodiments of this application. For ease of understanding, the relevant methods and processes for memory allocation and usage in the embodiments of this application will be described below. It should be noted that the application scenarios of the memory allocation method provided in the embodiments of this application are not limited to the device clusters shown in Figures 1-5 above. All scenarios in which the memory allocation method provided in the embodiments of this application can be applied are within the protection scope of this application.

[0064] Referring to Figure 6, Figure 6 is a schematic flowchart of a memory allocation method provided in an embodiment of this application. As shown in Figure 6, the memory allocation method provided in this application includes:

[0065] S101: The first device transmits a memory request to the control device.

[0066] Accordingly, the control device receives a memory request from the first device.

[0067] The first device can be any device in the device cluster shown in any of Figures 1-5, such as any device 11, device 12, or device 13 in the device cluster of Figure 1. The control device can be control device 10 in the device cluster shown in any of Figures 1-5.

[0068] In some possible application scenarios, the control device is used to manage and allocate memory in a memory pool. The memory in the memory pool is provided by multiple devices connected to the same peer-to-peer interconnect bus. The peer-to-peer interconnect bus can be the peer-to-peer interconnect bus 14 in any of the device clusters shown in Figures 1-5, and the multiple devices connected to the same peer-to-peer interconnect bus can be multiple devices in any of the device clusters shown in Figures 1-5.

[0069] In order to manage and allocate memory in the memory pool, the control device needs to determine and store the first physical address and capacity of the memory in the memory pool before responding to the memory request from the first device.

[0070] In some possible implementations, the control device determines and stores the capacity of the memory in the memory pool. Specifically, each device transmits its address, the capacity of the memory it provides, and the memory address to the control device. The control device then receives and stores the device addresses, memory capacities, and memory addresses from different devices. The device address can be, for example, an IP address or a MAC address. The memory address here refers to the physical address of the memory in the device providing the memory (the provider). This is the actual hardware address of the memory unit, the actual location of the storage unit on the memory chip, directly corresponding to the physical location in dynamic random access memory (DRAM) or persistent storage swap space (SSD / NVMe). Each physical address uniquely corresponds to one storage unit. User programs cannot directly manipulate the physical address of memory; they must do so through the operating system's permission management and address translation mechanisms.

[0071] Taking device 11 providing 10GB of memory, device 12 providing 20GB of memory, and device 13 providing 50GB of memory as examples, the device addresses, memory capacities, and memory addresses of each provider controlling the storage of the devices are shown in Table 1.

[0072] Table 1

[0073] It should be understood that Table 1 only shows that each device provides memory to the memory pool starting from 0x0000000000000000. In actual applications, the address range of memory provided by each device may be different. For example, device 11 provides memory to the memory pool starting from 0x00000000000000000, device 12 provides memory to the memory pool starting from 0x00000004FFFFFFFF, and device 13 provides memory to the memory pool starting from 0x00000000000000FF. Alternatively, the memory addresses provided by each device may be consecutive. For example, the memory address range provided by device 11 is 0x000000000000000-0x000000027FFFFFFF (total 10GB), the memory address range provided by device 12 is 0x0000000280000000-0x00000006FFFFFFFF (total 20GB), and the memory address range provided by device 13 is 0x0000000700000000-0x000000138FFFFFFF (total 50GB). The composition of the memory pool and the specific contents of the memory addresses shown in Table 1 are merely examples and are not specifically limited in this application.

[0074] In some possible implementations, the control device determines and stores the first physical address of the memory in the memory pool, including at least the following two implementations:

[0075] Implementation method 1: The control device uses the address of the provider's memory as the first physical address of the memory in the memory pool;

[0076] Implementation Method 2: The control device uses the address of the memory provided by the device (hereinafter referred to as the user) that uses the memory in the memory pool as the first physical address of the memory in the memory pool.

[0077] Corresponding to implementation method 1 of step S101, and continuing to use Table 1 as an example of memory in the memory pool, the first physical address of memory in the memory pool is shown in Table 2.

[0078] Table 2

[0079] Corresponding to implementation method 2 of step S101, the control device needs to first obtain the address of the memory provided by the user. This can be achieved by having the user include its own memory address in the memory request when sending it to the control device. After receiving the memory request, the control device can then generate a mapping between the addresses of the memory in the memory pool and the user's memory, and use the user's memory address as the first physical address of the memory in the memory pool. The address of the memory provided by the user is also a physical address, representing the actual hardware address of the memory unit in the user's memory, indicating the actual location of the storage unit on the memory chip, directly corresponding to the physical location in DRAM or SSD / NVMe. Each physical address uniquely corresponds to one storage unit.

[0080] It's understandable that implementing method 2 would cause the first physical address of the memory in the memory pool to change dynamically. Specifically, memory in the memory pool only has a first physical address when it is allocated; unallocated memory does not have a first physical address. Furthermore, the first physical address of the same memory may be different at different times.

[0081] Continuing with Table 1 as an example of memory in the memory pool, assuming that the memory allocation in the memory pool is as shown in Table 3, then the first physical address of the memory in the memory pool is as shown in Table 4.

[0082] Table 3

[0083] Table 4

[0084] It should be understood that the memory allocation in the memory pool and the specific contents of the memory addresses shown in Tables 3 and 4 are merely examples and are not specifically limited in this application.

[0085] In a specific application scenario, the memory request sent by the first device to the control device carries the address of the first device's memory. After receiving the memory request from the first device, the control device allocates the memory in the memory pool to the first device and generates a correspondence between the allocated memory (referred to as the target memory) and the address of the first device's memory, and uses the address of the first device's memory as the first physical address of the target memory.

[0086] For example, the first device is device 13 in Table 3. As can be seen from Table 3, the memory address range of the first device carried in the memory request sent by the first device is: 0x000000000EEEEEEE-0x0000000D8FFFFFFFF. Then the control device allocates part of the memory provided by device 11 and all of the memory provided by device 12 in the memory pool to the first device, and sets the first physical address of the memory allocated to the first device to the address of the memory provided by the first device.

[0087] Combining implementation methods 1 and 2 of step S101, the first physical address of the memory in the memory pool can be summarized as follows: the first physical address of the memory is the address of the memory of the device associated with that memory. Here, the device associated with that memory can refer to either the device providing the memory or the device using that memory.

[0088] It should be understood that implementation methods 1 and 2 in step S101 above are merely examples, and this application does not impose any specific limitations.

[0089] S102: The control device determines the target memory from the memory pool based on the target capacity in the memory request, and transmits the first physical address of the target memory to the first device.

[0090] Since the first device sends a memory request to the control device in order to request memory resources in the memory pool, the memory request sent by the first device carries the target capacity. This way, the control device can know the needs of the first device and allocate memory resources in the memory pool accurately and reasonably.

[0091] In some possible implementations, the control device determines the target memory from the memory pool based on the target capacity in the memory request, including at least the following determination methods:

[0092] Method 1: When the target capacity is less than or equal to the total capacity of unallocated memory provided by the same device in the memory pool, the control device marks the memory provided by that device with a capacity greater than or equal to the target capacity as the target memory.

[0093] For example, the first device is device 12 in Table 3. According to Table 3, the target capacity required by the first device (e.g., 5GB) is less than the total capacity of the memory provided by device 11 that has not been allocated (10GB). Therefore, the control device marks the memory provided by device 11 that is greater than or equal to the target capacity as the target memory.

[0094] Method 1 allows the first device to communicate with only one device when using the memory resources it has acquired, thus saving communication overhead.

[0095] Method 2: The control device randomly marks the memory in the memory pool as the target memory until the total capacity of the memory marked as the target memory is greater than or equal to the target capacity.

[0096] For example, the first device is device 13 in Table 3. According to Table 3, the control device randomly marks the memory in the memory pool. The marking result is that part of the memory provided by device 11 and all of the memory provided by device 12 in the memory pool are marked as target memory.

[0097] Method 2 allows the control device to quickly determine the target memory, is easy to operate, and can quickly respond to the memory request of the first device.

[0098] After determining the target memory from the memory pool, the control device obtains the first physical address of the target memory and then transmits the first physical address of the target memory to the first device. Correspondingly, the first device receives the first physical address of the target memory from the control device.

[0099] In application scenarios where the first physical addresses of memory in the memory pool are stored in a table format, the control device obtains the first physical address of the target memory by looking up the table. If the first physical address of memory in the memory pool is represented by the address of the provider's memory (see Table 2), the control device uses the address of the provider's memory marked as the target memory in the table as the first physical address of the target memory. If the first physical address of memory in the memory pool is represented by the address of the user's memory (see Table 4), the control device uses the address of the user's memory marked as the target memory in the table as the first physical address of the target memory.

[0100] S103: The first device uses the target memory to store the application.

[0101] For applications running on a computing device, storage and management primarily rely on the coordinated operation of virtual and physical addresses within that device, using address translation mechanisms to achieve efficient memory utilization and protection. Virtual addresses refer to the address space seen by the application at runtime. Each process has its own independent virtual address space, and instructions and data access within the program are based on virtual addresses. Virtual addresses allow programs to use contiguous address spaces, simplifying programming while providing memory protection and isolation. The address translation mechanism specifically translates virtual addresses to physical addresses. Applications use virtual addresses to access memory, but the actual data is stored in physical memory. To achieve this mapping, the operating system and the memory management unit (MMU) work together. The operating system typically uses a paging mechanism to manage memory. Both virtual and physical addresses are divided into fixed-size pages and page frames, for example, 4KB in size. A virtual address consists of a page number and an offset within the page. The operating system maintains a page table for each process, recording the mapping relationship between virtual page numbers and physical page frame numbers. Page tables are stored in memory and contain information such as the physical page frame address and access permissions corresponding to each virtual page. The MMU is responsible for real-time translation of virtual addresses to physical addresses. It completes the address translation based on the page table information of the current process. The translation process is as follows: (1) Virtual address decomposition: The virtual address is divided into a virtual page number (VPN) and an offset within the page. (2) Page table lookup: The page table is looked up according to the VPN to obtain the corresponding physical page frame number (PFN). (3) Physical address generation: The physical address consists of the physical page frame number and the offset within the page. (4) Accessing physical memory: The CPU accesses the data in memory through the physical address. In another specific implementation, in order to improve the translation efficiency, the MMU has a translation lookaside buffer (TLB) to cache the most recently used page table entries, reducing the latency of accessing the memory page table. In summary, by separating virtual addresses and physical addresses, and combining the address translation mechanism of page tables and the MMU, effective management of application storage can be achieved. Virtual addresses provide programs with an independent and contiguous address space, while physical addresses correspond to actual memory locations. The two are converted through the collaboration of hardware and the operating system, ensuring the safe, efficient, and flexible use of memory.

[0102] As described above, the first device uses the address of its own memory to store and manage applications running on the device. Therefore, when the first device uses target memory to store applications, it needs to determine the specific usage process of the target memory based on the specific content of the target memory's first physical address. The following will explain the impact of different contents of the target memory's first physical address on the first device's use of the target memory.

[0103] Application Scenario (1): Using the address of the provider's memory to represent the first physical address of the target memory.

[0104] Corresponding to application scenario (1), the device providing the target memory is referred to as the second device. Before receiving the memory request from the first device, the control device first receives the address of the second device's memory and uses the address of the second device's memory as the first physical address of the target memory. This process can be referred to in step S101 above, where the control device uses the address of the provider's memory as the first physical address of the memory in the memory pool. For the sake of brevity, it will not be elaborated here.

[0105] In application scenario (1), after the first device receives the first physical address of the target memory (actually the address of the memory of the second device) and the device address of the second device, it generates a correspondence between the first physical address of the target memory and the address of the memory of its own device, and then provides the address of the memory of its own device corresponding to the first physical address of the target memory to the application for use.

[0106] Specifically, the virtual address currently being operated on by the first device is referred to as the first VA. The first device uses an address translation mechanism to convert the first VA into an address of its own memory (referred to as the zeroth physical address of the first memory). Then, based on the correspondence between the first physical address of the target memory and the address of the device's own memory, the zeroth physical address of the first memory is converted into the first physical address of the first memory. This generates a first message carrying the first operation (such as a write operation, read operation, etc.) and the first physical address of the first memory. The first message is then transmitted to the third device providing the first memory via a peer-to-peer interconnect bus. The first message instructs the third device to perform the first operation on the first memory. The first memory refers to a portion or all of the target memory that the first device currently wants to operate on.

[0107] After the third device receives the first message through the peer-to-peer interconnect bus, it extracts the first operation and the first physical address of the first memory from the first message. The memory controller in the third device then performs the first operation on the memory space (i.e., the first memory) corresponding to the first physical address. Thus, an operation on the first memory is completed. This operation can be understood as the storage and management of the application running on the first device.

[0108] For example, if the first physical address of the target memory received by the first device is specifically 0x000000000000000-0x0000000005555555, then the first device can provide the memory address of its own device 0x000000000AAAAAAA-0x000000000FFFFFFF, and generate a one-to-one correspondence between 0x000000000000000-0x0000000005555555 and 0x000000000AAAAAAA-0x000000000FFFFFFF, as shown in Table 5.

[0109] Table 5

[0110] Next, the first device provides 0x000000000AAAAAAA-0x000000000FFFFFFF to the application. Assuming the zeroth physical address of the first memory obtained by converting the first VA is 0x000000000AAAAAAB, the first device finds 0x0000000000000001 in Table 5, corresponding to 0x0000000000000AAAAAAB, as the first physical address of the first memory. It then generates a first message carrying the first operation and 0x00000000000000001, and transmits the first message to the third device via the peer-to-peer interconnect bus. After receiving the first message, the third device extracts the first operation and 0x00000000000000001 from the first message. The memory controller in the third device then performs the first operation on the memory space indicated by 0x0000000000000001 (i.e., the first memory).

[0111] Application Scenario (2): Using the address of the user's memory to represent the first physical address of the target memory.

[0112] In application scenario (ii), after the first device receives the first physical address of the target memory (which is actually the address of its own memory) and the device address of the provider of the target memory, it can directly provide the first physical address of the target memory to the application for use.

[0113] In the first implementation, the part or all of the target memory that the first device wants to operate on is called the second memory. The first device transmits the first physical address of the second memory to the fourth device that provides the second memory. The fourth device converts the first physical address of the second memory into the address of the memory of its own device and performs the operation according to the conversion result.

[0114] Specifically, the virtual address currently being operated on by the first device is referred to as the second VA. The first device uses an address translation mechanism to translate the second VA into the address of its own memory (referred to as the first physical address of the second memory), thereby generating a second message carrying the second operation and the first physical address of the second memory. This second message is then transmitted to the fourth device via the peer-to-peer interconnect bus. The second message instructs the fourth device to perform the second operation on the second memory.

[0115] After the fourth device receives the second message via the peer-to-peer interconnect bus, it extracts the second operation and the first physical address of the second memory from the second message. Then, based on the correspondence between the first physical addresses of the memory in the memory pool and the addresses of the memory in this device, it converts the first physical address of the second memory into the address of the memory in this device (referred to as the second physical address of the second memory). Then, the memory controller in the fourth device performs the second operation on the memory space (i.e., the second memory) in the fourth device corresponding to the second physical address. Thus, one operation on the second memory is completed. This operation can be understood as the storage and management of the application running on the first device.

[0116] It should be noted that the correspondence between the memory address of the user (which is also the first physical address of the memory in the memory pool) stored on the fourth device and the memory address of this device can be generated by the control device after determining the allocation of memory provided by the fourth device in the memory pool, and then transmitting this correspondence to the fourth device.

[0117] For example, if the target memory is the memory allocated to device 12 in Table 3, then the control device transmits the one-to-one correspondence between the addresses of the user device 12's memory (i.e., the first physical address of the target memory) 0x000000000AAAAAAA-0x000000000FFFFFFF and the addresses of the provider device 11's memory 0x000000000000000-0x0000000005555555 to device 11 (i.e., the fourth device). Furthermore, the control device transmits the first physical address of the target memory to device 12 (i.e., the first device).

[0118] Next, device 12 provides 0x000000000AAAAAAA-0x000000000FFFFFFF to the application on this device. Assuming that the first physical address of the second memory obtained by device 12 after converting the second VA is 0x000000000AAAAAAB, device 12 generates a second message carrying the second operation and 0x000000000AAAAAAB, and transmits the second message to device 11 through the peer-to-peer interconnect bus.

[0119] After receiving the second message, device 11 extracts the second operation and 0x000000000AAAAAAB from the second message. Then, it searches for the correspondence between memory addresses 0x000000000AAAAAAA-0x000000000FFFFFFF in device 12 and memory addresses 0x000000000000000-0x0000000005555555 in device 11, and finds 0x00000000000AAAAAAB as the second physical address of the second memory. The memory controller in device 11 then performs the second operation on the memory space (i.e., the second memory) indicated by 0x0000000000000001.

[0120] In the second implementation, a portion or all of the target memory that the first device wants to operate on is referred to as the third memory. The first device converts the first physical address of the third memory into the address of the memory of the fifth device that provides the third memory, and transmits the conversion result to the fifth device, which then performs the operation based on the conversion result.

[0121] Specifically, the virtual address currently being operated on by the first device is referred to as the third VA. The first device uses an address translation mechanism to convert the third VA into the address of its own memory (referred to as the first physical address of the third memory). Then, based on the correspondence between the first physical address of the target memory and the address of the provider's memory, the first physical address of the third memory is converted into the third physical address of the third memory. This generates a third message carrying the third operation and the third physical address of the third memory, and transmits the third message to the fifth device through the peer-to-peer interconnect bus. The third message instructs the fifth device to perform a third operation on the third memory.

[0122] After the fifth device receives the third message through the peer-to-peer interconnect bus, it extracts the third operation and the third physical address of the third memory from the third message. The memory controller in the fifth device then performs the third operation on the memory space (i.e., the third memory) corresponding to the third physical address. Thus, an operation on the third memory is completed. This operation can be understood as the storage and management of the application running on the first device.

[0123] It should be noted that the correspondence between the first physical address of the target memory stored on the first device and the address of the provider's memory can be generated by the control device after determining the target memory in the memory pool, and then the control device transmits this correspondence to the first device.

[0124] For example, if the target memory is the memory allocated to device 12 in Table 3, then the control device transmits the one-to-one correspondence between the address of the user device 12's memory (i.e., the first physical address of the target memory) 0x000000000AAAAAAA-0x000000000FFFFFFF and the address of the provider device 11's memory 0x000000000000000-0x0000000005555555 to device 12 (i.e., the first device) in Table 3.

[0125] Next, device 12 provides 0x000000000AAAAAAA-0x000000000FFFFFFF to the application on this device. Assuming the first physical address of the third memory obtained by converting the third VA is 0x000000000AAAAAAB, then device 12 finds 0x000000000AAAAAAA-0x000000000FFFFFFF in the correspondence between the memory addresses of device 12 (0x00000000000000-0x0000000005555555) and the memory addresses of device 11 (0x000000000000000-0x0000000005555555) as the third physical address of the third memory. Then, it generates a third message carrying the third operation and 0x00000000000000001, and transmits the third message to device 11 (i.e., the fifth device) through the peer-to-peer interconnect bus. After receiving the third message, device 11 extracts the third operation and 0x0000000000000001 from the third message. The memory controller in device 11 then performs the third operation on the memory space (i.e., the third memory) indicated by 0x0000000000000001.

[0126] It should be understood that the two implementation methods in the above application scenario (II) are merely examples, and this application does not impose any specific limitations.

[0127] In summary, the control device directly transmits the memory address of the device associated with the target memory to the first device, allowing the first device to directly access the memory of other devices using the memory address of the device associated with the target memory. In this way, the first device no longer needs to translate the physical address of its own memory into a unified address to meet the traditional transmission requirements of P2P technology, and the peer device no longer needs to translate the unified address from the first device into the physical address of its own memory. Therefore, this method can reduce the memory access latency between devices in the same device cluster.

[0128] Specifically, this technical solution supports using the address of the provider's memory as the first physical address of the memory in the memory pool. In this application scenario, when constructing the memory pool, the control device can directly determine the first physical address of all memory in the memory pool. After the first device obtains the first physical address of the target memory, when it needs to operate on the first memory in the target memory, it can directly transmit the operation content (corresponding to the first operation) and the first physical address of the first memory (i.e., the address of the third device's memory) to the third device. Subsequently, the memory controller of the third device executes the first operation on the first memory based on the first physical address of the first memory. It can be seen that in this technical solution, after the first device converts the virtual address in the user instruction into the address of its own memory, the first device can directly convert the address of its own memory into the address of the third device's memory and transmit the address of the third device's memory to the third device through the peer-to-peer interconnect bus. This conversion mode only involves two address translations to enable the first device to access the memory of the third device. Compared with the existing three address translations, two address translations can reduce the process when the first device accesses the memory of the third device and shorten the access time.

[0129] Furthermore, this technical solution also supports using the address of the user's memory as the first physical address of the memory in the memory pool. In this application scenario, the control device determines the first physical address of these memories when allocating memory in the memory pool. After the first device obtains the first physical address of the target memory, when it needs to operate on part (or all) of the memory in the target memory, it can choose either of two methods. In the first method, the first device directly transmits the operation content (corresponding to the second operation) and the first physical address of the second memory (i.e., the address of the first device's memory) to the fourth device. Subsequently, the fourth device converts the first physical address of the second memory into the address of its own memory (i.e., the second physical address of the second memory), and then the memory controller of the fourth device performs the second operation on the second memory based on the second physical address of the second memory. In the second method, the first device first converts the first physical address of the third memory (i.e., the address of the first device's memory) into the third physical address of the third memory (i.e., the address of the fifth device's memory), and then transmits the operation content (corresponding to the third operation) and the third physical address of the third memory to the fifth device. Subsequently, the memory controller of the fifth device performs the third operation on the third memory based on the third physical address of the third memory. As can be seen, this technical solution supports translating the virtual address in the user instruction into the memory address of the device receiving the user instruction, and directly translating the memory address of the device receiving the user instruction into the memory address of the device to which the memory to be accessed belongs. This translation mode only involves two address translations to enable the first device to access the memory of other devices. Compared to the existing three address translations, two address translations can reduce the process when the first device accesses the memory of other devices and shorten the access time.

[0130] In some possible implementations, the first, second, or third message carries address permissions, which indicate permitted operations on the specified memory. Taking a first message carrying address permissions as an example, the address permissions carried in the first message indicate permitted operations on the first memory. After obtaining the first message, the third device extracts not only the first operation and the first physical address of the first memory from the first message, but also the address permissions, and verifies whether the address permissions include the first operation. If the address permissions include the first operation, the memory controller in the third device performs the first operation on the first memory. If the address permissions do not include the first operation, the memory controller in the third device refuses to perform the first operation on the first memory and may also transmit a rejection message to the first device.

[0131] Address permissions refer to access permission settings for data within a memory address range. They determine whether a program or process can perform read, write, and execute operations on that memory region, and whether access to that region is permitted. Address permissions include read permissions, write permissions, access flags, and execute permissions. Read permission (R) allows reading data from a specified memory address. Without read permission, accessing a specified memory region to read data will result in an access exception (such as a page fault or protection exception). Write permission (W) allows writing data to a specified memory address. Without write permission, the write operation will be denied or trigger an exception. The access flag (A) is a status bit indicating whether a specified memory page has been accessed (read or write). The operating system uses this bit to determine page activity and for management strategies such as page replacement algorithms. Execute permission (X) allows code to be executed at a specified memory address. Without execute permission, attempting to execute code in a specified region will trigger an exception (such as an execution protection exception), preventing malicious code execution.

[0132] For example, the address permissions carried in the first message are specifically R / W / A. If the first operation is specifically R, then the address permissions include the first operation, and therefore the memory controller in the third device performs the first operation on the first memory. If the first operation is specifically X, then the address permissions do not include the first operation, and therefore the memory controller in the third device refuses to perform the first operation on the first memory.

[0133] In existing three-way address translation, packets transmitted between devices carry Token IDs, which are credential identifiers used for access control and authentication, representing the sender's authorization information. However, the Token ID itself does not contain address permission details; address permission information is stored in the data structure corresponding to the Token. Therefore, after receiving a packet, the receiver needs to perform additional table lookups or verifications based on the Token ID to map to specific address permissions, which significantly increases the complexity and latency of access control. In this technical solution, when devices access each other's memory, the transmitted packets directly carry address permissions. Since address permissions directly describe the specific access permissions (such as read, write, execute) to a specified memory region, the granularity of permissions is fine and clear. This allows the receiving device to immediately determine whether access is allowed based on the address permission bits, without the need for additional Token verification, permission lookup, or authorization processes. This reduces access latency and communication and computational overhead. Furthermore, address permissions can be flexibly configured with different access permissions for different memory regions, supporting dynamic adjustments and facilitating fine-grained permission management.

[0134] In some potential application scenarios, if the device cluster supports both the two-stage address translation mode provided by this technical solution and the traditional three-stage address translation mode, the currently used mode can be distinguished by carrying a flag bit (such as a ByPass Flag) in the first, second, or third message. For example, ByPass Flag = 1 indicates two-stage address translation mode; ByPass Flag = 0 indicates three-stage address translation mode. In a specific implementation, the ByPass Flag is carried by the reserved field in the first, second, or third message.

[0135] Referring to Figure 7, which is a schematic diagram of a control device provided in this application, the control device 300 can be used to implement the steps executed by the control device in the memory allocation method of Figure 6. Specifically, the control device 300 is used to store the first physical address and capacity of the memory in the memory pool. The memory in the memory pool is provided by multiple computing devices. The multiple computing devices are connected through a peer-to-peer interconnect bus. The first physical address of the memory is the address of the memory of the computing device associated with that memory among the multiple computing devices. The multiple computing devices include a first device. As shown in Figure 7, the control device 300 includes: a first receiving unit 301 and a first sending unit 302.

[0136] The first receiving unit 301 is used to receive a memory request from the first device. The memory request carries the target capacity.

[0137] The first sending unit 302 is used to transmit the first physical address of the target memory to the first device. The memory pool includes the target memory. The total capacity of the target memory is greater than or equal to the target capacity.

[0138] In some possible implementations, multiple computing devices include a second device. The second device is used to provide the target memory. The first receiving unit 301 is further configured to receive the address of the memory of the second device before receiving the memory request from the first device, and use the address of the memory of the second device as the first physical address of the target memory.

[0139] In some possible implementations, the memory request includes the address of the memory of the first device. The control device 300 includes a determining unit. After the first receiving unit 301 receives the memory request from the first device, the determining unit is configured to determine the target memory from the memory pool according to the target capacity, generate a correspondence between the address of the target memory and the address of the memory of the first device, and use the address of the memory of the first device as the first physical address of the target memory.

[0140] The first receiving unit 301, the first transmitting unit 302, and the determining unit can all be implemented in software, hardware, or a combination of both. For example, the implementation of the first receiving unit 301 will be described below. Similarly, the implementation of the first transmitting unit 302 and the determining unit can refer to the implementation of the first receiving unit 301.

[0141] As an example of a software functional unit, the first receiving unit 301 may include code running on a computing instance. The computing instance may include at least one of a physical host (computing device), a virtual machine, and a container. Further, the aforementioned computing instance may be one or more. For example, the first receiving unit 301 may include code running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers used to run the code may be distributed in the same region or in different regions. Further, the multiple hosts / virtual machines / containers used to run the code may be distributed in the same availability zone (AZ) or in different AZs, each AZ including one or more geographically proximate data centers. Typically, a region may include multiple AZs.

[0142] Similarly, multiple hosts / virtual machines / containers used to run this code can be distributed within the same Virtual Private Cloud (VPC) or across multiple VPCs. Typically, a VPC is set up within a region. Communication between two VPCs within the same region, as well as between VPCs in different regions, requires a communication gateway to be set up within each VPC to enable interconnection between VPCs.

[0143] As an example of a hardware functional unit, the first receiving unit 301 may include at least one computing device, such as a server. Alternatively, the first receiving unit 301 may also be a device implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD may be implemented using a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), generic array logic (GAL), or any combination thereof.

[0144] The multiple computing devices included in the first receiving unit 301 can be distributed in the same region or in different regions. Similarly, the multiple computing devices included in the first receiving unit 301 can be distributed in the same Availability Zone (AZ) or in different AZs. Likewise, the multiple computing devices included in the first receiving unit 301 can be distributed in the same Virtual Private Cloud (VPC) or in multiple VPCs. These multiple computing devices can be any combination of computing devices such as servers, ASICs, PLDs, CPLDs, FPGAs, and GALs.

[0145] It should be noted that, in other embodiments, the first receiving unit 301 can be used to execute any step of the memory allocation method performed by the control device, the first sending unit 302 can be used to execute any step of the memory allocation method performed by the control device, and the determining unit can be used to execute any step of the memory allocation method performed by the control device. The steps implemented by the first receiving unit 301, the first sending unit 302, and the determining unit can be specified as needed. The control device 300 can achieve all its functions by implementing different steps of the memory allocation method performed by the control device through the first receiving unit 301, the first sending unit 302, and the determining unit respectively.

[0146] Referring to Figure 8, which is a schematic diagram of a computing device provided in this application, the computing device 400 can be used to implement the steps performed by the first device in the memory allocation method of Figure 6. Specifically, the computing device 400, as the first device, belongs to multiple computing devices. The multiple computing devices are connected through a peer-to-peer interconnect bus. The multiple computing devices are used to provide memory in a memory pool. The first physical address and capacity of the memory in the memory pool are stored by a control device. The first physical address of the memory is the address of the memory of the computing device associated with that memory among the multiple computing devices. The computing device 400 includes a second transmitting unit 401 and a second receiving unit 402.

[0147] The second sending unit 401 is used to transmit a memory request to the control device. The memory request carries the target capacity.

[0148] The second receiving unit 402 is used to receive the first physical address of the target memory from the control device. The memory pool includes the target memory. The total capacity of the target memory is greater than or equal to the target capacity.

[0149] In some possible implementations, the target memory includes a first memory. Multiple computing devices include a third device. The third device is used to provide the first memory. The second sending unit 401 is further used to generate a first message and transmit the first message to the third device via a peer-to-peer interconnect bus. The first message carries a first operation and a first physical address of the first memory. The first physical address of the first memory is the address of the memory of the third device. The first message is used to instruct the third device to perform a first operation on the first memory.

[0150] In some possible implementations, the first message carries address permissions. Address permissions indicate the operations permitted to be performed on the first memory location. Address permissions are used to verify whether the first operation is included.

[0151] In some possible implementations, the target memory includes a second memory. Multiple computing devices include a fourth device. The fourth device is used to provide the second memory. The second sending unit 401 is further used to generate a second message and transmit the second message to the fourth device via a peer-to-peer interconnect bus, so that the fourth device determines the second physical address of the second memory based on the first physical address of the second memory, and then performs a second operation on the second memory based on the second physical address of the second memory. The second message carries the second operation and the first physical address of the second memory. The first physical address of the second memory is the address of the memory of the first device. The second physical address of the second memory is the address of the memory of the fourth device.

[0152] In some possible implementations, the target memory includes a third memory. Multiple computing devices include a fifth device. The fifth device is used to provide the third memory. The second sending unit 401 is further configured to determine the third physical address of the third memory based on the first physical address of the third memory. The first physical address of the third memory is the address of the memory of the first device. The third physical address of the third memory is the address of the memory of the fifth device. The second sending unit is further configured to generate a third message and transmit the third message to the fifth device via a peer-to-peer interconnect bus. The third message carries a third operation and the third physical address of the third memory. The third message is used to instruct the fifth device to perform a third operation on the third memory.

[0153] The second transmitting unit 401 and the second receiving unit 402 can be implemented in software, hardware, or a combination of both. For example, the implementation of the second transmitting unit 401 will be described below. Similarly, the implementation of the second receiving unit 402 can refer to the implementation of the second transmitting unit 401.

[0154] As an example of a software functional unit, the second sending unit 401 may include code running on a computing instance. The computing instance may include at least one of a physical host (computing device), a virtual machine, and a container. Further, the aforementioned computing instance may be one or more. For example, the second sending unit 401 may include code running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers used to run the code may be distributed in the same region or in different regions. Further, the multiple hosts / virtual machines / containers used to run the code may be distributed in the same availability zone (AZ) or in different AZs, each AZ including one or more geographically proximate data centers. Typically, a region may include multiple AZs.

[0155] Similarly, multiple hosts / virtual machines / containers used to run this code can be distributed within the same Virtual Private Cloud (VPC) or across multiple VPCs. Typically, a VPC is set up within a region. Communication between two VPCs within the same region, as well as between VPCs in different regions, requires a communication gateway to be set up within each VPC to enable interconnection between VPCs.

[0156] As an example of a hardware functional unit, the second transmitting unit 401 may include at least one computing device, such as a server. Alternatively, the second transmitting unit 401 may also be a device implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD may be implemented using a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), generic array logic (GAL), or any combination thereof.

[0157] The multiple computing devices included in the second sending unit 401 can be distributed in the same region or in different regions. Similarly, the multiple computing devices included in the second sending unit 401 can be distributed in the same Availability Zone (AZ) or in different AZs. Likewise, the multiple computing devices included in the second sending unit 401 can be distributed in the same Virtual Private Cloud (VPC) or in multiple VPCs. These multiple computing devices can be any combination of computing devices such as servers, ASICs, PLDs, CPLDs, FPGAs, and GALs.

[0158] It should be noted that, in other embodiments, the second sending unit 401 can be used to execute any step of the memory allocation method performed by the first device, and the second receiving unit 402 can be used to execute any step of the memory allocation method performed by the first device. The steps implemented by the second sending unit 401 and the second receiving unit 402 can be specified as needed. The computing device 400 can achieve all its functions by implementing different steps of the memory allocation method performed by the first device through the second sending unit 401 and the second receiving unit 402 respectively.

[0159] This application also provides a chip including a processor and a power supply circuit. The power supply circuit supplies power to the processor, which executes the steps performed by the control device in the memory allocation method described in Figure 6. For simplicity, further details are omitted here. The processor can be implemented using a CPU, or it can be implemented using computing devices such as a GPU, DPU, NPU, TPU, XPU, SoC, offloading card, or accelerator card.

[0160] Referring to Figure 9, which is a schematic diagram of the structure of a computing device provided in an embodiment of this application, the computing device 500 provided in this application includes a bus 501, a processor 502, a memory 503, and a communication interface 504. The processor 502, the memory 503, and the communication interface 504 communicate with each other via the bus 501. The computing device 500 can be a server or a terminal device. It should be understood that this application does not limit the number of processors and memories in the computing device 500.

[0161] Bus 501 can be a Peripheral Component Interconnect Express (PCIe) bus, an Extended Industry Standard Architecture (EISA) bus, a Unified Bus (Ubus or UB), a Compute Express Link (CXL), a Cache Coherent Interconnect for Accelerators (CCIX), etc. The Unified Bus is also known as the Lingqu Bus. Buses can be categorized as address buses, data buses, control buses, etc. For ease of representation, only one line is used in Figure 9, but this does not indicate that there is only one bus or one type of bus. Bus 501 can include pathways for transmitting information between various components of computing device 500 (e.g., memory 503, processor 502, communication interface 504).

[0162] Processor 502 may include any one or more of the following computing devices: central processing unit (CPU), graphics processing unit (GPU), microprocessor (MP) or digital signal processor (DSP), ASIC, FPGA, CPLD, NPU, SoC, offload card, accelerator card, etc.

[0163] Memory 503 may include volatile memory, such as random access memory (RAM). Processor 502 may also include non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid state drive (SSD). Furthermore, memory 503 may also be implemented using storage class memory (SCM), phase change memory (PCM), or other types of storage media.

[0164] It is worth noting that the same type of storage medium can be configured in the same computing device to realize the function of memory 503, or two or more types of storage media can be configured to realize the function of memory 503. This application does not limit this.

[0165] The memory 503 stores executable program code, and the processor 502 executes the executable program code to implement the functions of the first receiving unit 301 and the first sending unit 302, thereby implementing any step executed by the first device in the memory allocation method of FIG6. That is, the memory 503 stores instructions for executing the memory allocation method of FIG6.

[0166] Alternatively, the memory 503 stores executable program code, which the processor 502 executes to implement the functions of the aforementioned second sending unit 401 and second receiving unit 402, thereby implementing any step performed by the first device in the memory allocation method of FIG6. That is, the memory 503 stores instructions for executing the memory allocation method of FIG6.

[0167] The communication interface 504 uses transceiver units such as, but not limited to, network interface cards and transceivers to enable communication between the computing device 500 and other computing devices or communication networks.

[0168] As one possible implementation, the computing device 500 may also include a chip, which includes a processor and a power supply circuit. The power supply circuit supplies power to the processor, which executes the operation steps performed by the control device in the memory allocation method of Figure 6, or the operation steps performed by the first device in the memory allocation method of Figure 6. The processor can be implemented using a CPU, or it can be implemented using computing devices or AI chips such as GPUs, DPUs, NPUs, TPUs, XPUs, SoCs, offloading cards, or accelerator cards.

[0169] As one possible implementation, the computing device 500 may include various types of processors 502, i.e., the computing device 500 is a heterogeneous device. For example, the computing device 500 may include a CPU and a GPU. At least one of the processors 502 may execute the operation steps performed by the control device in the memory allocation method of FIG6, or execute the operation steps performed by the first device in the memory allocation method of FIG6. For the sake of brevity, further details are omitted here.

[0170] This application also provides a computer program product containing instructions. This computer program product can be software or program products containing instructions, capable of running on a computing device or stored on any available medium. When the computer program product runs on a device cluster, it causes the device cluster to execute the memory allocation method of FIG6. Specifically, a control device in the device cluster executes the steps performed by the control device in the memory allocation method of FIG6; a first device in the device cluster executes the steps performed by the first device in the memory allocation method of FIG6; a second device in the device cluster executes the steps performed by the second device in the memory allocation method of FIG6; a third device in the device cluster executes the steps performed by the third device in the memory allocation method of FIG6; a fourth device in the device cluster executes the steps performed by the fourth device in the memory allocation method of FIG6; and a fifth device in the device cluster executes the steps performed by the fifth device in the memory allocation method of FIG6.

[0171] This application embodiment also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that a computing device can store, or a data storage device such as a data center containing one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state drive). The computer-readable storage medium includes instructions that instruct a device cluster to execute the memory allocation method of FIG. 6. Specifically, the instructions instruct a control device in the device cluster to execute the steps performed by the control device in the memory allocation method of FIG. 6; the instructions instruct a first device in the device cluster to execute the steps performed by the first device in the memory allocation method of FIG. 6; the instructions instruct a second device in the device cluster to execute the steps performed by the second device in the memory allocation method of FIG. 6; the instructions instruct a third device in the device cluster to execute the steps performed by the third device in the memory allocation method of FIG. 6; the instructions instruct a fourth device in the device cluster to execute the steps performed by the fourth device in the memory allocation method of FIG. 6; and the instructions instruct a fifth device in the device cluster to execute the steps performed by the fifth device in the memory allocation method of FIG. 6.

[0172] It should be understood that in the embodiments of this application, "when," "...when," and "if" all refer to the device making corresponding processing under certain objective circumstances, and are not time-limited, nor do they require the device to make a judgment action, nor do they imply any other limitations.

[0173] It should be understood that in the embodiments of this application, "simultaneous" does not necessarily require that they occur at the same time, minute, second, or even at the same moment. When the times of occurrence are slightly different, they can also be understood as occurring "simultaneously".

[0174] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the protection scope of the technical solutions of the embodiments of this application.

Claims

1. A memory allocation method, characterized by, The method is applied to a device cluster, which includes a control device and multiple devices connected via a peer-to-peer interconnect bus. The control device stores the first physical address and capacity of memory in a memory pool, which is provided by the multiple devices. The first physical address is the address of the memory of the device associated with the corresponding memory among the multiple devices. The multiple devices include a first device. The method includes: The control device receives a memory request from the first device, wherein the memory request carries a target capacity; The control device transmits the first physical address of the target memory to the first device, wherein the memory pool includes the target memory, and the total capacity of the target memory is greater than or equal to the target capacity.

2. The method of claim 1, wherein, The plurality of devices includes a second device for providing the target memory. Before the control device receives the memory request from the first device, the method further includes: The control device receives the memory address of the second device and uses the memory address of the second device as the first physical address of the target memory.

3. The method of claim 2, wherein, The target memory includes a first memory, the plurality of devices includes a third device, the third device being used to provide the first memory, and the method further includes: The first device generates a first message and transmits the first message to the third device through the peer-to-peer interconnect bus; The first message carries a first operation and a first physical address of the first memory, and the first message is used to instruct the third device to perform the first operation on the first memory.

4. The method of claim 3, wherein, The first message carries address permissions, which indicate the operations permitted to be performed on the first memory, and the address permissions are used to verify whether the first operation is included.

5. The method of claim 1, wherein, The memory request includes the address of the memory of the first device. After the control device receives the memory request from the first device, the method further includes: The control device determines the target memory from the memory pool based on the target capacity; The control device generates a correspondence between the addresses of the target memory and the memory of the first device, and uses the address of the memory of the first device as the first physical address of the target memory.

6. The method of claim 5, wherein, The target memory includes a second memory, and the plurality of devices includes a fourth device for providing the second memory. After the control device transmits the first physical address of the target memory to the first device, the method further includes: The first device generates a second message and transmits the second message to the fourth device through the peer-to-peer interconnect bus, wherein the second message carries a second operation and a first physical address of the second memory; The fourth device determines the second physical address of the second memory based on the first physical address of the second memory, wherein the second physical address is the address of the memory of the fourth device; The fourth device performs the second operation on the second memory according to the second physical address of the second memory.

7. The method of claim 5, wherein, The target memory includes a third memory, and the plurality of devices includes a fifth device, which is used to provide the third memory. After the control device transmits the first physical address of the target memory to the first device, the method further includes: The first device determines the third physical address of the third memory based on the first physical address of the third memory, wherein the third physical address is the address of the memory of the fifth device; The first device generates a third message and transmits the third message to the fifth device through the peer-to-peer interconnect bus. The third message carries a third operation and a third physical address of the third memory. The third message is used to instruct the fifth device to perform the third operation on the third memory.

8. A memory allocation method characterized by comprising: The method is applied to a device cluster, which includes a control device and multiple devices connected via a peer-to-peer interconnect bus. The control device stores the first physical address and capacity of memory in a memory pool, which is provided by the multiple devices. The first physical address is the address of the memory of the device associated with the corresponding memory among the multiple devices. The multiple devices include a first device. The method includes: The first device transmits a memory request to the control device, wherein the memory request carries a target capacity; The first device receives a first physical address of the target memory from the control device, wherein the memory pool includes the target memory, and the total capacity of the target memory is greater than or equal to the target capacity.

9. The method of claim 8, wherein, The target memory includes a first memory, the plurality of devices includes a third device, the third device being used to provide the first memory, and the method further includes: The first device generates a first message and transmits the first message to the third device through the peer-to-peer interconnect bus; The first message carries a first operation and a first physical address of the first memory, wherein the first physical address of the first memory is the address of the memory of the third device, and the first message is used to instruct the third device to perform the first operation on the first memory.

10. The method of claim 9, wherein, The first message carries address permissions, which indicate the operations permitted to be performed on the first memory, and the address permissions are used to verify whether the first operation is included.

11. The method of claim 8, wherein, The target memory includes a second memory, the plurality of devices includes a fourth device, the fourth device being used to provide the second memory, and the method further includes: The first device generates a second message and transmits the second message to the fourth device through the peer-to-peer interconnect bus. The second message carries a second operation and a first physical address of the second memory, and the first physical address of the second memory is the address of the memory of the first device. The fourth device determines the second physical address of the second memory based on the first physical address of the second memory, wherein the second physical address is the address of the memory of the fourth device; The fourth device performs the second operation on the second memory according to the second physical address of the second memory.

12. The method of claim 8, wherein, The target memory includes a third memory, the plurality of devices includes a fifth device, the fifth device being used to provide the third memory, and the method further includes: The first device determines the third physical address of the third memory based on the first physical address of the third memory, wherein the first physical address of the third memory is the address of the memory of the first device, and the third physical address of the third memory is the address of the memory of the fifth device; The first device generates a third message and transmits the third message to the fifth device through the peer-to-peer interconnect bus. The third message carries a third operation and a third physical address of the third memory. The third message is used to instruct the fifth device to perform the third operation on the third memory.

13. A control device characterized by comprising: The control device is used to store the first physical address and capacity of the memory in the memory pool. The memory in the memory pool is provided by multiple computing devices, which are connected via a peer-to-peer interconnect bus. The first physical address is the address of the memory of the computing device associated with the corresponding memory among the multiple computing devices. The multiple computing devices include a first device, and the control device includes a first receiving unit and a first transmitting unit. The first receiving unit is configured to receive a memory request from the first device, wherein the memory request carries a target capacity; The first sending unit is used to transmit the first physical address of the target memory to the first device, wherein the memory pool includes the target memory, and the total capacity of the target memory is greater than or equal to the target capacity.

14. The control device of claim 13, wherein The plurality of computing devices includes a second device for providing the target memory. The first receiving unit is further configured to receive the address of the memory of the second device before receiving the memory request of the first device, and use the address of the memory of the second device as the first physical address of the target memory.

15. The control device of claim 14, wherein, The memory request includes the address of the memory in the first device, and the control device includes a determining unit. The determining unit is configured to, after the first receiving unit receives the memory request from the first device, determine the target memory from the memory pool according to the target capacity, generate a correspondence between the address of the target memory and the address of the memory of the first device, and use the address of the memory of the first device as the first physical address of the target memory.

16. A computing device, comprising: This device serves as a first apparatus belonging to a plurality of computing devices interconnected via a peer-to-peer bus. The plurality of computing devices provide memory from a memory pool. The first physical address and capacity of the memory in the memory pool are stored by a control device. The first physical address is the address of the memory of the computing device associated with the corresponding memory among the plurality of computing devices. The first apparatus includes a second transmitting unit and a second receiving unit. The second sending unit is used to transmit a memory request to the control device, wherein the memory request carries a target capacity; The second receiving unit is configured to receive a first physical address of the target memory from the control device, wherein the memory pool includes the target memory, and the total capacity of the target memory is greater than or equal to the target capacity.

17. The computing device of claim 16, wherein, The target memory includes a first memory, and the plurality of computing devices includes a third device for providing the first memory. The second sending unit is further configured to generate a first message and transmit the first message to the third device via the peer-to-peer interconnection bus; The first message carries a first operation and a first physical address of the first memory, wherein the first physical address of the first memory is the address of the memory of the third device, and the first message is used to instruct the third device to perform the first operation on the first memory.

18. The computing device of claim 17, wherein, The first message carries address permissions, which indicate the operations permitted to be performed on the first memory, and the address permissions are used to verify whether the first operation is included.

19. The computing device of claim 16, wherein, The target memory includes a second memory, and the plurality of computing devices includes a fourth device for providing the second memory. The second sending unit is further configured to generate a second message and transmit the second message to the fourth device via the peer-to-peer interconnect bus, so that the fourth device determines the second physical address of the second memory based on the first physical address of the second memory, and then performs the second operation on the second memory based on the second physical address of the second memory. The second message carries a second operation and a first physical address of the second memory. The first physical address of the second memory is the address of the memory of the first device, and the second physical address of the second memory is the address of the memory of the fourth device.

20. The computing device of claim 16, wherein, The target memory includes a third memory, and the plurality of computing devices includes a fifth device for providing the third memory. The second sending unit is further configured to determine the third physical address of the third memory based on the first physical address of the third memory, wherein the first physical address of the third memory is the address of the memory of the first device, and the third physical address of the third memory is the address of the memory of the fifth device; The second sending unit is further configured to generate a third message and transmit the third message to the fifth device via the peer-to-peer interconnect bus, wherein the third message carries a third operation and a third physical address of the third memory, and the third message is used to instruct the fifth device to perform the third operation on the third memory.

21. A computing device, comprising: The computing device includes a processor and memory; The processor is configured to execute instructions stored in the memory, causing the computing device to perform the steps performed by the control device in the memory allocation method as described in any one of claims 1-7, or to perform the steps performed by the first device in the memory allocation method as described in any one of claims 8-12.

22. A cluster of devices, characterized in that, The device cluster is the device cluster in the memory allocation method according to any one of claims 1-7, the device cluster includes a control device and a first device, the control device is used to perform the steps performed by the control device in the memory allocation method according to any one of claims 1-7, and the first device is used to perform the steps performed by the first device in the memory allocation method according to any one of claims 1-7.

23. A chip, characterized by The chip includes a processor and a power supply circuit, the power supply circuit being used to supply power to the processor, the processor being used to perform the steps executed by the control device in the memory allocation method as described in any one of claims 1-7.