Access method and access device

By dividing the shared virtual address space for server nodes in a distributed system, the poor scalability and low performance of the summation of inter-process calculation results are solved, efficient and secure data access is achieved, and system performance and scalability are improved.

CN119276835AActive Publication Date: 2025-01-07HUAWEI TECH CO LTD

Patent Information

Application Number
CN202310831471.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-07-05
Publication Date
2025-01-07
Estimated Expiration
2043-07-05

AI Technical Summary

Technical Problem

In distributed systems or computer clusters, the summary of inter-process calculation results has problems such as poor scalability and low performance, and the prior art is complex and inefficient.

Method used

By dividing the shared virtual address space for server nodes, efficient inter-process access is achieved, and virtual addresses are used for address translation and access request processing, complex packet processing and protocol stack transmission are avoided, and performance and scalability are improved.

Benefits of technology

It realizes safe and reliable inter-process data access, improves system scalability and performance, reduces physical memory overhead, and enhances access security, avoids private data leakage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119276835A_ABST
    Figure CN119276835A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an access method and an access device, relates to the technical field of computers, and solves the problems of poor expansibility and low performance during server node data mutual access. According to the specific scheme, an address of a second server node corresponding to a first virtual address is determined according to the first virtual address, and the first virtual address is an address carried by an access request acquired by the first server node; if the address of the second server node is a second virtual address, the access request is sent to the second virtual address, and the second virtual address is a shared virtual address of the first server node and the second server node. The embodiment of the invention is used for the data exchange access process between the server nodes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of computer technology, and in particular to an access method and an access device. Background Art

[0002] A distributed system or computer cluster is generally composed of multiple server nodes, wherein the multiple server nodes are interconnected through high-speed links. In order to fully utilize the computing power of multiple server nodes in a distributed system or computer cluster, a computing task can be divided into multiple sub-computing tasks and sent to different server nodes for computing, and then the computing results of each sub-computing task can be summarized.

[0003] Computing tasks are usually run in the form of processes. The address spaces of processes deployed on different server nodes are isolated, and the operating systems (OS) on different server nodes are also isolated from each other. Therefore, how to efficiently, simply, safely and reliably aggregate the computing results between processes is a huge challenge. Summary of the invention

[0004] The embodiments of the present application provide an access method and an access device. By dividing a shared virtual address space for a first server node and a second server node, they can safely and reliably use the shared virtual address to access each other, thereby solving the problems of poor scalability and low performance of existing implementation methods.

[0005] In order to achieve the above-mentioned purpose, the embodiment of the present application adopts the following technical solution.

[0006] In a first aspect, an embodiment of the present application provides an access method, the method comprising: determining, based on a first virtual address, an address of a second server node corresponding to the first virtual address, the first virtual address being an address carried by an access request obtained by the first server node; if the address of the second server node is a second virtual address, sending an access request to the second virtual address, the second virtual address being a shared virtual address of the first server node and the second server node.

[0007] Therefore, if the address of the second server node is a shared virtual address, such as the second virtual address, it means that the address of the second server node can be shared and accessed by other server nodes, such as the first server node. Compared with the prior art that requires complex packet sending and receiving processing or sending through a protocol stack, it is more efficient and has better performance. In addition, the embodiment of the present application adopts a shared virtual address, which does not depend on the topological structure of the server node, and its expansion is more flexible compared to the prior art.

[0008] In addition, the correspondence between the first virtual address and the address of the second server node may be stored in the physical memory of the first server node, and accessing the physical memory of the first server node is more efficient than accessing a remote physical memory.

[0009] In a possible design, according to the first virtual address, determining the address of the second server node corresponding to the first virtual address includes: according to the first virtual address, determining the virtual physical address corresponding to the first virtual address, the virtual physical address being the address of the virtual space of the first server node; according to the virtual physical address, determining the address of the second server node corresponding to the virtual physical address. Based on this, the virtual space corresponding to the virtual physical address can be divided in the first server node, wherein the virtual space can be much larger than the space of the local physical address, thereby expanding the physical memory space accessible to the first server node.

[0010] In a possible design, the correspondence between the first virtual address and the virtual physical address is stored in a server node page table, and the correspondence between the virtual physical address and the address of the second server node is stored in a bus page table.

[0011] In this design, the server node page table and the bus page table can be stored in the local physical memory of the first server node. When performing address translation, the first server node can improve efficiency and performance by reading the page table in the local physical memory.

[0012] In a possible design, the page table entry length of the server node page table is different from the page table entry length of the bus page table. Thus, by setting different page table entry lengths, the number of page table entries can be reduced, the physical memory overhead of the first server node is reduced, and the table lookup efficiency is improved.

[0013] In one possible design, the access request also includes an access credential and an identifier of the second server node, and the access credential is used to configure the access rights of the access request, that is, to limit the access scope of the first server node, so that the access of the second server node can be more secure and avoid privacy data leakage.

[0014] In one possible design, the method further includes: if the address of the second server node is a physical address, accessing the physical memory of the first server node based on the physical address, and the first server node and the second server node are the same server node.

[0015] In this design, if the first server node accesses the local physical memory, the physical address can be determined through the first virtual address and the corresponding relationship between the first virtual address and the physical address.

[0016] In a second aspect, an embodiment of the present application also provides an access method, which includes: receiving an access request, the access request including a second virtual address, the second virtual address being a shared virtual address of a first server node and a second server node; determining a physical address corresponding to the second virtual address based on the second virtual address; and accessing the physical memory of the second server node based on the access request and the physical address.

[0017] Thus, different server nodes access each other through a shared virtual address, and after receiving the access request, the second server node determines the physical address according to the shared virtual address to access the physical memory corresponding to the physical address. Therefore, the access method provided by the embodiment of the present application uses a shared virtual address for mutual access, which is more efficient than the prior art that requires complex packet processing or sending through a protocol stack. In addition, the embodiment of the present application uses a shared virtual address, which is independent of the topological structure of the server node and is more flexible than the prior art.

[0018] In addition, the correspondence between the second virtual address and the physical address may be stored in the physical memory of the second server node, and accessing the physical memory of the second server node is more efficient than accessing the remote physical memory.

[0019] In one possible design, the access request also includes an access credential, and the access credential is used to configure the access rights of the access request. Before determining the physical address corresponding to the second virtual address according to the second virtual address, the method further includes: determining whether the access rights of the access request are valid based on the access credential. That is, the access credential can limit the access scope of the first server node, so that for the second server node, access can be safer and privacy data leakage can be avoided.

[0020] In a third aspect, an embodiment of the present application also provides an access device, comprising a system address management unit and a sending unit, wherein the system address management unit is used to determine, based on the first virtual address, an address of a second server node corresponding to the first virtual address, the first virtual address being an address carried in an access request obtained by the first server node; the sending unit is used to send an access request to the second virtual address if the address of the second server node is a second virtual address, the second virtual address being a shared virtual address of the first server node and the second server node.

[0021] The beneficial effects of the third aspect can be found in the description of the first aspect.

[0022] In one possible design, the system address management unit includes: an address management unit and a bus address management unit; the address management unit is used to determine the virtual physical address corresponding to the first virtual address based on the first virtual address, and the virtual physical address is the address of the virtual space of the first server node; the bus address management unit is used to determine the address of the second server node corresponding to the virtual physical address based on the virtual physical address.

[0023] In a possible design, the correspondence between the first virtual address and the virtual physical address is stored in a server node page table, and the correspondence between the virtual physical address and the address of the second server node is stored in a bus page table.

[0024] In a possible design, the length of a page table entry in the server node page table is different from the length of a page table entry in the bus page table.

[0025] In one possible design, the access request also includes an access credential and an identifier of the second server node, and the access credential is used to configure access rights of the access request.

[0026] In one possible design, the access device also includes an access unit; the access unit is used to access the physical memory of the first server node based on the physical address if the address of the second server node is a physical address, and the first server node and the second server node are the same server node.

[0027] In a fourth aspect, an embodiment of the present application provides an access device, the access device comprising a receiving unit and a bus address management unit; the receiving unit is used to receive an access request, the access request comprising a second virtual address, the second virtual address being a shared virtual address of a first server node and a second server node; the bus address management unit is used to determine a physical address corresponding to the second virtual address based on the second virtual address; the bus address management unit is also used to access the physical memory of the second server node based on the access request and the physical address.

[0028] The beneficial effects of the fourth aspect can refer to the description of the second aspect.

[0029] In one possible design, the access request also includes an access credential, which is used to configure access rights of the access request. The bus address management unit is further used to determine whether the access rights of the access request are valid based on the access credential.

[0030] In a fifth aspect, an embodiment of the present application provides a chip system, which includes a processor core, a system address management unit and a physical memory, wherein the processor core and the system address management unit are coupled, and the system address management unit and the physical memory are coupled.

[0031] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, including computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the access method in any of the above aspects and any possible implementation methods.

[0032] In a seventh aspect, an embodiment of the present application provides a computer program product, which, when executed on a computer or a processor, enables the computer or the processor to execute the access method in any of the above aspects and any possible implementation methods.

[0033] It can be understood that any of the access devices, chip systems, computer-readable storage media or computer program products provided above can be applied to the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods and will not be repeated here.

[0034] These and other aspects of the present application will become more apparent from the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 A schematic diagram of the structure of a distributed system provided in an embodiment of the present application;

[0036] Figure 2 A schematic diagram of the structure of a server node provided in an embodiment of the present application;

[0037] Figure 3 A schematic diagram of the structure of another server node provided in an embodiment of the present application;

[0038] Figure 4 A schematic diagram of the structure of another server node provided in an embodiment of the present application;

[0039] Figure 5 A flowchart of an access method provided in an embodiment of the present application;

[0040] Figure 6 A schematic diagram of an address mapping relationship provided in an embodiment of the present application;

[0041] Figure 7 A flowchart of a first server node initiating an access request to a shared virtual address provided in an embodiment of the present application;

[0042] Figure 8 Another flowchart of a first server node initiating an access request to a shared virtual address provided in an embodiment of the present application;

[0043] Fig. 9 A flowchart of another method provided by an embodiment of the present application for a first server node to initiate an access request to a shared virtual address;

[0044] Fig.10 A flowchart of another method provided by an embodiment of the present application for a first server node to initiate an access request to a shared virtual address;

[0045] Fig.11 A structural block diagram of a server node provided in an embodiment of the present application;

[0046] Fig.12 A flow chart of a page table configuration of a server node provided in an embodiment of the present application;

[0047] Fig.13 A flowchart of another server node page table configuration provided in an embodiment of the present application;

[0048] Fig.14 An application scenario diagram of an access method provided in an embodiment of the present application;

[0049] Fig.15 A schematic diagram of the composition of an access device provided in an embodiment of the present application;

[0050] Fig.16 A schematic diagram of the composition of another access device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0051] For ease of understanding, the embodiments of the present application first explain the relevant concepts for reference, as shown below:

[0052] Distributed systems, such as Figure 1 As shown, the distributed system 10 includes multiple servers 11, multiple computing nodes 12, an interconnection network 13, multiple clients 14, and applications 15. Among them, one or more computing nodes 12 can be configured on each server 11. The computing nodes 12 can include, but are not limited to, graphics processors and field programmable gate arrays (FPGAs). In addition to the computing nodes 12, the server 11 can also include one or more general processing units (CPUs) such as central processing units (CPUs). Figure 1 14). Each client 14 can run one or more applications 15, and the application 15 can perform tasks such as corresponding data processing or analysis. Multiple clients 14 can be coupled to one or more servers 11 through an interconnection network 13, and the application 15 is handed over to one or more computing nodes 12 on the server 11 for execution, wherein the interconnection network 13 can support different types of wired or wireless connections based on various network transmission technologies such as remote direct memory access (RDMA) and transmission control protocol (TCP).

[0053] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.

[0054] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this embodiment, unless otherwise specified, "plurality" means two or more.

[0055] At present, in order to realize the aggregation of calculation results, one implementation method is to use the protocol stack / network communication method to aggregate the calculation results. For example, if data aggregation is required between server node 1 and server node 2, the calculation process 1 of server node 1 sends the calculation result to the calculation process 2 of server node 2 through the transmission control protocol or the Internet protocol (IP). After receiving the calculation result of the calculation process 1, server node 2 aggregates it with the calculation result of the calculation process 2.

[0056] However, in this way, the computing task needs to perceive the interconnection topology between the server nodes, which is not conducive to the expansion and transplantation of the computing task. And if the data of the computing task is processed through the protocol stack, the software layers involved are more and the performance is poor. For example, server node 1 needs to copy the calculation result to the protocol stack before sending the calculation result, and then send the calculation result to server node 2 through the network. When server node 2 receives it, it is also necessary to copy the calculation result of server node 1 to the memory of server node 2. Therefore, in the process of data aggregation, two more copies of the calculation results are made, which will lead to poor performance and complex processing flow of the entire distributed network / computer cluster. In addition, in order to improve the computing power of the server node, an acceleration chip will be used for accelerated computing, such as adding an artificial intelligence (AI) acceleration card or a graphics processing unit (GPU) card to the server node to accelerate AI computing. At this time, the central processing unit (CPU) of the server node performs logical control and does not participate in AI computing. However, the acceleration chip usually cannot be directly connected to the TCP / IP protocol stack or remote direct memory access, and needs to be customized, which is not conducive to chip design. Therefore, if the central processing unit and the acceleration chip are used for interactive processing, the process will be more complicated.

[0057] Another implementation method is to use a supernode method. A supernode is composed of multiple nodes interconnected by high-speed links. The node consists of a computing unit (such as a CPU or AI chip) and corresponding physical memory (such as high bandwidth memory (HBM)). Among them, the physical memory of different nodes is uniformly addressed, and the same operating system manages multiple nodes that make up the supernode. The nodes access the uniformly addressed physical memory through a shared page table. The essence of this method is the non-uniform memory access (NUMA) mechanism of the operating system.

[0058] However, the memory that makes up the supernode needs to be uniformly addressed by physical addresses, and the number of chips that make up the supernode is limited, which limits scalability. In addition, since the supernode is managed by an operating system and uses the same page table, the page table entries can only be stored in the physical memory of a certain node. Each memory access to other memories must first access the page table entries of another node, resulting in poor performance. Cache consistency needs to be supported between different nodes, which poses challenges to chip design and the bandwidth of high-speed links.

[0059] Therefore, an embodiment of the present application provides an access method, which divides a shared virtual address (SVA) space for a first server node and a second server node, so that the shared virtual address can be used to access each other safely and reliably, thereby solving the problems of poor scalability and low performance of existing implementation methods.

[0060] For ease of understanding, the present application embodiment first introduces the server node to which the access method is applied. Figure 2 As shown, Figure 2 A schematic diagram of the structure of a server node provided for an embodiment of the present application. The server node 20 may include a central processing unit core 21 (CPU core), an artificial intelligence core 22 (AI core), an address management unit 23 (memory management unit, MMU), a system address management unit 24 (system memory management unit, SMMU), an address bus 25, a bus address management unit 26 (bus memory management unit, busMMU) and a physical memory 27 (physicalmemroy). Among them, the central processing unit core 21 is responsible for logical calculations, the artificial intelligence core 22 is responsible for matrix calculations, and the address management unit 23 receives a virtual address conversion request initiated by the central processing unit core 21, and searches for a page table entry to convert it into a local physical address (localphysical address, LPA) or a virtual physical address (virtual physical address, VPA). The system address management unit 24 receives and processes the address conversion request of the artificial intelligence core. The bus address management unit 26 receives the address conversion request of the address bus 25, and forms an access request with the converted result to send to the switch of the high-speed link (high link). In addition, the bus address management unit 26 also receives access requests from the switch of the high-speed link. The bus address management unit 26 searches for the local page table entry based on the access request of the high-speed link, converts it into the physical address of the physical memory 27, and sends the access request to the address bus 25 to access the physical memory 27.

[0061] In another implementation, Figure 3 As shown, Figure 3 A schematic diagram of another server node structure provided in an embodiment of the present application. The server node 20 may include a central processing unit core 21, an address management unit 23, an address bus 25, and a physical memory 27. The bus address management unit may not be integrated into the server node 20, but may be coupled to the address bus 25 in the server node 20 as a new hardware unit.

[0062] In yet another implementation, Figure 4 As shown, Figure 4 A structural diagram of another server node provided in an embodiment of the present application. The server node 20 includes an artificial intelligence core 22, a system address management unit 24, an address bus 25, and a physical memory 27. The bus address management unit is integrated into the system address management unit 24, and the system address management unit 24 has the functions of receiving address access requests from the artificial intelligence core 22 and the high-speed link, performing address conversion, and initiating address access. The address bus 25 identifies the address to be accessed, and either accesses the local physical memory or accesses the physical memory of the destination node through the high-speed link.

[0063] in, Figure 4 The server nodes shown in Figure 3 The server node shown in the figure reduces one hardware unit, saving hardware cost and hardware space. In the address conversion process of the server node, the system address management unit can be used to convert the page table entry into the access request of the external link by looking up the page table entry once, reducing the number of page table entries, reducing the system memory overhead, and improving performance.

[0064] However, the structural diagram of the server node provided in the embodiment of the present application is not limited to the above three implementation methods.

[0065] Application Figure 2 , Figure 3 or Figure 4 The server node in the present application is described below with respect to the access method provided in the embodiment of the present application. Figure 5 As shown, Figure 5 Flowchart of the access method provided for the embodiment of the present application. Among them, the server node can be a request server node and a destination server node, and the server node can also be only a request server node or a destination server node. The server node that initiates the access request can be understood as the request server node, and the server node that receives the access request can be understood as the destination server node. In the embodiment of the present application, the request server node is the first server node, and the destination server node is the second server node. The method flow is as follows:

[0066] S501. A first server node determines an address of a second server node corresponding to a first virtual address according to a first virtual address, where the first virtual address is an address carried in an access request obtained by the first server node.

[0067] S502: If the address of the second server node is a second virtual address, the first server node sends an access request to the second virtual address, where the second virtual address is a shared virtual address of the first server node and the second server node.

[0068] Exemplarily, when an application or program sends an access request to a first server node, the access request includes a first virtual address, and the first server node can obtain the address of a second server node based on the first virtual address. At this time, if the address of the second server node is a second virtual address, it indicates that the access request is not used to access a local server node, and the first server node can send the access request to the second server node corresponding to the second virtual address.

[0069] Correspondingly, S503, the second server node receives an access request, where the access request includes a second virtual address, and the second virtual address is a shared virtual address of the first server node and the second server node.

[0070] S504: The second server node determines a physical address corresponding to the second virtual address according to the second virtual address.

[0071] S505: The second server node accesses the physical memory of the second server node based on the access request and the physical address.

[0072] The second virtual address may be a shared virtual address. For ease of understanding, the embodiment of the present application first introduces the shared virtual address. In order to enable the server node to access shared data simply, safely and reliably, the server node may apply for a virtual address space of the global virtual address space, wherein the global virtual address space is a virtual address space that can be used by each server node in a distributed system or computer cluster.

[0073] like Figure 6 As shown, Figure 6 A schematic diagram of an address mapping relationship provided for an embodiment of the present application. Figure 6 , a first server node and a second server node are shown, and the first server node and the second server node jointly apply for a virtual address space of the global virtual address space, for example, a virtual address space with a starting address of va1 and a length of len1. In the first server node, the shared virtual address is mapped to a first virtual address, and in the second server node, the shared virtual address is mapped to a physical address.

[0074] Application Figure 4 The flow chart of the server node in which the first server node initiates an access request to the shared virtual address is as follows: Figure 7As shown, the processing element (PE) on the first server node initiates an access request, where the processing element can be a process or an execution program. Assume that the first server node uses a shared virtual address (such as va) with the second server node to initiate an access request, that is, the first virtual address is an address in the shared virtual address. The system address management unit in the first server node determines the second virtual address ( Figure 7 The bus address management unit of the second server node processes the access request from the external link switch, which includes the second virtual address. The bus address management unit determines the physical address ( Figure 7 pa in the figure) and access the physical memory corresponding to the physical address.

[0075] The first server node and the second server node may be coupled via a transmission line, and the access request of the first service node may be directly sent to the second server node. In addition, the first server node and the second server node may also be coupled via a switch, and the first service node sends the access request to the switch, and the switch forwards the access request to the second server node.

[0076] Optionally, step 501 may include: the first server node determines a virtual physical address corresponding to the first virtual address according to the first virtual address, the virtual physical address being the address of the virtual space of the first server node. The first server node determines an address of a second server node corresponding to the virtual physical address according to the virtual physical address.

[0077] The first server node may be divided into a virtual space corresponding to the virtual physical address, wherein the virtual space may be much larger than the space of the local physical address, thereby expanding the physical memory space accessible to the first server node.

[0078] Application Figure 2 The flow chart of the first server node initiating an access request to the shared virtual address of the second server node is as follows: Figure 8 As shown. The processing unit on the first server node initiates an access request, assuming that the first server node uses a shared virtual address with the second server node ( Figure 8The address management unit in the first server node determines the virtual physical address ( Figure 8 Then, the bus address management unit in the first server node determines the address of the second server node according to the virtual physical address and the correspondence between the virtual physical address and the address of the second server node. At this time, the address of the second server node is the second virtual address ( Figure 8 The bus address management unit of the second server node processes the access request from the first server node, and the access request includes the second virtual address. The bus address management unit determines the physical address ( Figure 8 pa in the figure) and access the physical memory corresponding to the physical address.

[0079] In another implementation, Fig. 9 As shown, the first server node may also send the access request to the switch, and then send it to the second server node through the switch. The embodiment of the present application does not limit the sending method of the access request.

[0080] The corresponding relationship between the first virtual address and the virtual physical address is stored in the server node page table, and the corresponding relationship between the virtual physical address and the address of the second server node is stored in the bus page table.

[0081] The server node page table and the bus page table may be stored in the physical memory of the first server node. Fig.10 As shown, assuming that the first server node and the second server node use the same global virtual address for shared access, the second server node applies for the global virtual address, and locally establishes a correspondence between the shared virtual address and the local physical address, which is stored in the bus page table. The first server node also establishes a correspondence between the shared virtual address and the virtual physical address, which is stored in the server node page table, and then establishes a correspondence between the virtual physical address and the first virtual address, which is stored in the bus page table.

[0082] At this time, the processing unit in the first server node initiates an access request to the shared virtual address, and the access request includes the first virtual address. The address management unit first searches the server node page table to obtain the address of the second server node after the first virtual address is converted. If the address of the second server node is a physical address, access to the local physical memory is initiated through the internal bus. If the address of the second server node is a virtual physical address, the virtual physical address is sent to the bus address management unit through the internal bus. The bus address management unit searches the bus page table to find the second virtual address corresponding to the virtual physical address, and sends an access request to the second server node according to the second virtual address. After receiving the access request, the second server node searches the bus page table to find the physical address corresponding to the second virtual address through the bus address management unit, and accesses the physical memory of the second server node based on the physical address.

[0083] Among them, the page table entry length of the server node page table is different from the page table entry length of the bus page table. The page table entry length can also be understood as the page table entry granularity. In an example, the page table entry length of the server node page table can be 4k, and the page table entry length of the bus page table can be 2M. Therefore, by controlling the page table entry length, different numbers of server node page tables or bus page tables can be obtained.

[0084] It is understandable that the page table entry length of the server node page table and the page table entry length of the bus page table may also be the same, and the present application does not impose any specific restriction on the value of the page table entry length.

[0085] The access request also includes an access token, which is used to configure the access rights of the access request.

[0086] The access credential is stored in the bus page table of the second server node, and the access permission of the virtual address is configured in the bus page table through the access credential to generate the access credential. If the first server node and the second server node use a shared virtual address, a correspondence between the shared virtual address and the virtual physical address should be established in the first server node, the bus page table should be configured, and then a correspondence between the virtual physical address and the first virtual address should be established, and the server node page table should be configured, wherein the page table mapping entry also includes the information of the access credential. After receiving the access request, the second server node searches the bus page table according to the access credential.

[0087] Accordingly, the second server node determines whether the access rights of the access request are valid based on the access credential.

[0088] In addition, the same virtual address space can support multiple access credentials, and different access permissions are granted according to the access credentials. The access permissions may include: read-write, read-only, and write-only permissions. Optionally, the method may also include: if the address of the second server node is a physical address, accessing the physical memory of the first server node based on the physical address, the first server node and the second server node are the same server node.

[0089] Exemplarily, if the address of the second server node determined according to the first virtual address is a physical address, it indicates that the access request accesses the local server node. In this case, the server node is both the first server node and the second server node, and accesses the physical memory corresponding to the physical address based on the access request.

[0090] In summary, the following describes the process of configuring the page table of a server node. Fig.11 As shown, the server node may include a virtual physical address management module and an address mapping module. The virtual physical address management module is used to configure the virtual physical address space, and the address mapping module is used to perform address mapping. The address mapping process may include: Fig.12 The process shown. Fig.12 A flow chart of a page table configuration of a server node provided in an embodiment of the present application. Figure 2 or Figure 3 The first server node and the second server node will configure the idle virtual address into the dynamic address window (DAW) based on the server nodes constituting the distributed system or computer cluster and the size of the shared virtual address space. The subsequent address bus will send the access request for the virtual address to the bus address management unit according to the range of the dynamic address window, and the bus address management unit will perform address conversion.

[0091] In one implementation, assuming that only server node 1 and server node 2 share data, and the size of the shared data is 32M, the virtual physical address management module only needs to configure 32M of virtual physical address space to the dynamic address window. For example, the virtual physical address space (0xa0000000000, 32M) is configured to the dynamic address window of server node 1, and the virtual physical address space (0xb0000000000, 32M) is configured to the dynamic address window of server node 2.

[0092] The process of the address mapping module may include the following process. As shown in S1201, process 1 is started on server node 1 (device identification (identification, id) is 1). Process 1 includes: create_process "pid=1, shareMemSize=32M, token=0x00000001, peer_did=2, peer_token=0x00000002, total_process=2". Among them, the parameter pid is the number of process 1, shareMemSize is the size of the virtual address space shared by each process, token is the access credential of the shared memory of server node 1, peer_did is the device identification of server node 2, peer_token is the credential for accessing server node 2, and total_process is the number of started processes. When process 1 starts, the size of the shared virtual address space required is 64M, and the shared virtual address space is applied for through the operating system interface. The starting address of the shared virtual address space can be 0x1000000000, for example, mmap(0x1000000000,64M). Thus, the virtual address space (va1 to va2) is obtained.

[0093] As shown in S1202, process 1 calls the memset (0x1000000000, 0, 32M) interface of the operating system, and the operating system establishes the first 32M server node page table in server node 1. The size (pagesize) of the page table entry of the server node page table is 4k, and 8k 4k page table entries will be added. Among them, each page table entry maps a 4k virtual address to the physical address of server node 1, for example, there are 8k address mapping relationships such as (0x1000000000, 0x00100000) (0x1000001000, 0x00103000). In one example, the virtual address va = 1000000000, and the corresponding local physical address is lpa = 0x00100000.

[0094] As shown in S1203, process 1 calls the interface set_shared (0x1000000000, 32M, token = 0x00000001, peer_did = 2, prog = "rw") of the address mapping module. Configure the 32M address space of server node 1 starting from 0x1000000000, that is, configure the permission table. The permission table can be shared with the server node with peer_did 2 for shared access. The access credential is the parameter value of token, and the access permission is read and write.

[0095] As shown in S1204, process 1 calls the interface map_remote (0x1000000000+32M, 32M, did=2, peer_token=0x00000002) of the address mapping module, and configures the 32M space starting from the virtual address 0x1000000000+32M for remote access, and the access credential is the token value. The map_remote interface includes the following steps: (1) Apply for a virtual physical address space according to the size of the space to be mapped, such as a 32M virtual physical address space starting from vpa=0xa0000000000. (2) Configure page table mapping in the bus page table. The size of the page table entry is 2M, and 16 page table entries are mapped, including (0x1000000000+32M, 0xa000000000, 2M), (0x1000000000+34M, 0xa000000000+2M, 2M). (3) Configure page table mapping in the server page table to convert the virtual physical address into a virtual address. The page table entry also includes the device identification and access credentials of the server node corresponding to the virtual address.

[0096] Start process 2 on server node 2 (device ID is 2). Process 2 includes: create_process "pid=2, shareMemSize=32M, token=0x00000002, peer_did=1, peer_token=0x00000001, total_process=2". The parameter pid is the number of process 2, shareMemSize is the size of the virtual address space shared by each process, token is the access credential of the shared memory of server node 2, peer_did is the device ID of server node 1, peer_token is the credential for accessing server node 1, and total_process is the number of started processes. When process 2 is started, the size of the shared virtual address space required is 64M, which is calculated based on the parameters. The shared virtual address space is applied for through the interface of the operating system. The starting address of the shared virtual address space can be 0x1000000000, for example, mmap(0x1000000000, 64M). Get the virtual address space (va2 to va3)

[0097] As shown in S1205, process 2 calls the memset (0x1000000000+32M, 0, 32M) interface of the operating system, and the operating system establishes a page table entry of 32M space starting from 0x1000000000+32M in server node 2. If the size (pagesize) of the page table entry is 4k, 8k 4k page table entries will be added. Among them, each page table entry maps a 4k virtual address to the physical address of server node 2, for example, there are 8k address mapping relationships such as (0x1000000000+32M, 0x00100000) (0x1000001000+32M+4K, 0x00102000).

[0098] As shown in S1206, process 2 calls the interface set_shared (0x1000000000+32M, 32M, token=0x00000002, peer_did=1, prog="rw") of the address mapping module. The 32M address space of server node 2 starting from 0x1000000000+32M is configured to be shared with the server node with peer_did 1 for shared access. The access credential is the parameter value of token, and the access permission is read and write.

[0099] As shown in S1207, process 2 calls the interface map_remote (0x1000000000, 32M, did=1, peer_token=0x00000001) of the address mapping module, and configures the 32M space starting from the virtual address 0x1000000000 for remote access, and the access credential is the peer_token value. Among them, the map_remote interface includes the following steps: (1) Apply for virtual physical address space according to the size of the space to be mapped, such as the 32M virtual physical address space starting from 0xb000000000. (2) Configure page table mapping in the bus page table, the size of the page table entry is 2M, and map 16 page table entries such as (0x1000000000, 0xb000000000, 2M), (0x1000000000+2M, 0xb000000000+2M, 2M). (3) Configure page table mapping in the server page table to convert the virtual physical address into a virtual address. The page table entry also includes the device identifier and access credentials of the server node corresponding to the virtual address.

[0100] Therefore, process 1 performs task calculation and writes the calculation result into 0x1000000000. When accessing the virtual address, the central processing unit converts it into a physical address for access through the address management unit.

[0101] Perform task 2 calculation and write the calculation result to 0x1000000000+32M. When accessing the virtual address, the central processing unit converts it into a physical address for access through the address management unit.

[0102] If process 1 takes the calculation results from process 2 and summarizes them, the access address is 0x1000000000+32M, and the CPU converts it into a virtual physical address (0xa0000000000) through the address management unit for access. If the bus of the server node where process 1 is located finds that 0xa0000000000 is within the local dynamic address window, it forwards the access request to the bus address management unit. At this time, the did=2, token=0x00000002 in the access request, the virtual address is 0x1000000000+32M, and it is read-only access. Then the bus address management unit composes an access request and sends it to the external high-speed link.

[0103] Server node 2 receives the access request from server node 1, and the bus address management unit of server node 2 searches for the page table entry according to the did, token, and virtual address. In one implementation, since the token is valid, the permission table search is passed, and the bus address management unit further searches for the page table entry of server 2 through the virtual address to obtain the local physical address. In another implementation, the permission table search and the page table search can be performed concurrently. If both search results are passed, the access request is valid. If one of the search results is not passed, the access request is invalid.

[0104] Server node 2 initiates a read request for physical address 0x00100000, and returns the read data to server node 1 via a high-speed link. The processing code of server node 1 performs a summary calculation on the read data.

[0105] In another implementation, Fig.13 As shown, Fig.13 A flowchart of another server node page table configuration provided in an embodiment of the present application. Figure 4 The server node shown in . Fig.11The flowchart of the page table configuration shown in , in which there is no need to configure the server node page table and the bus page table separately, only one system page table needs to be configured. Among them, S1301 is the same as S1201, S1303 is the same as S1203, and S1304 is the same as S1206, so they are not repeated here. In addition, since the virtual address of each server node is different, the server node obtains the address of the second server node according to the conversion instruction of the system address management unit. If the address of the second server node is the second virtual address, the access request is sent to the second server node. In an embodiment of the present application, the first virtual address and the shared virtual address are the same. In another implementation, the first virtual address and the shared virtual address may also be different.

[0106] Therefore, in scenarios that require huge amounts of computing, such as artificial intelligence and high-performance computing (HPC), a computing task is usually broken down into multiple sub-computing tasks, and then the calculation results are merged and the next round of iterative calculations is performed until the calculation results meet the requirements. Fig.14 As shown, assume that a computing task is decomposed into three sub-computing tasks and deployed on three servers, namely server 1, server 2 and server 3. After the sub-computing tasks are completed, server 1 stores the calculation results in the virtual address space from va1 to va2, server 2 stores the calculation results in the virtual address space from va2 to va3, and server 3 stores the calculation results in the virtual address space from va3 to va4. If a server wants to summarize the calculation results, the server initiates an address access request to obtain the calculation results from other servers. In an example, server 1 needs to obtain the calculation results from server 2, then server 1 initiates an address access request to the virtual address space of server 2 (the virtual address space from va2 to va3), the address access request includes id2, token2 and va3, and obtains data from the virtual address space of server 2 to the physical memory of server 2. In another example, server 1 needs to obtain calculation results from server 2, so server 1 initiates an address access request to the virtual address space of server 2 (the virtual address space from va3 to va4), and the address access request includes id3, token3 and va4, to obtain data from the virtual address space of server 3 to the physical memory of server 3.

[0107] It is understandable that in order to implement the above functions, the electronic device includes hardware and / or software modules corresponding to the execution of each function. In combination with the algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in combination with the embodiments, but such implementation should not be considered to be beyond the scope of the present application.

[0108] In this embodiment, the electronic device can be divided into functional modules according to the above method example. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware. It should be noted that the division of modules in this embodiment is schematic and is only a logical function division. There may be other division methods in actual implementation.

[0109] In the case of dividing each functional module into corresponding functional modules, Fig.15 A possible schematic diagram of the composition of the access device 1500 involved in the above embodiment is shown. Fig.15 As shown, the access device 1500 may include: a system address management unit 1501 and a sending unit 1502 .

[0110] The system address management unit 1501 may be used to support the access device 1500 to execute the above step 501, etc., and / or other processes of the technology described herein.

[0111] The sending unit 1502 may be used to support the access device 1500 to perform the above step 502 and / or other processes for the technology described herein.

[0112] It should be noted that all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module and will not be repeated here.

[0113] The access device provided in this embodiment is used to execute the above access method, and thus can achieve the same effect as the above implementation method.

[0114] In the case of using integrated units, the access device 1500 may include a processing module, a storage module and a communication module. The processing module may be used to control and manage the actions of the access device 1500, for example, it may be used to support the access device 1500 to perform the steps performed by the above-mentioned system address management unit 1501 and the sending unit 1502. The storage module may be used to support the access device 1500 to store program codes and data, etc. The communication module may be used to support the communication between the access device 1500 and other devices, such as communication with wireless access devices.

[0115] Among them, the processing module can be a processor or a controller. It can implement or execute various exemplary logic boxes, modules and circuits described in conjunction with the disclosure of this application. The processor can also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of digital signal processing (DSP) and a microprocessor, etc. The storage module can be a memory. The communication module can specifically be a device that interacts with other electronic devices, such as a radio frequency circuit, a Bluetooth chip, a Wi-Fi chip, etc.

[0116] In one embodiment, when the processing module is a processor and the storage module is a memory, the access device involved in this embodiment may be a Figure 4 Server node of the structure shown.

[0117] Accordingly, when each functional module is divided according to each function, Fig.16 Another possible composition diagram of the access device 1600 involved in the above embodiment is shown. Fig.16 As shown, the access device 1600 may include: a receiving unit 1601 and a bus address management unit 1602 .

[0118] The receiving unit 1601 may be used to support the access device 1600 to execute the above step 503 and / or other processes of the technology described herein.

[0119] The bus address management unit 1602 may be used to support the access device 1600 to execute the above steps 504 and 505, etc., and / or other processes of the technology described herein.

[0120] It should be noted that all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module and will not be repeated here.

[0121] The access device 1600 provided in this embodiment is used to execute the above access method, and thus can achieve the same effect as the above implementation method.

[0122] The embodiment of the present application also provides an electronic device, including one or more processors and one or more memories. The one or more memories are coupled to the one or more processors, and the one or more memories are used to store computer program codes, and the computer program codes include computer instructions. When the one or more processors execute the computer instructions, the electronic device executes the above-mentioned related method steps to implement the access method in the above-mentioned embodiment.

[0123] The embodiment of the present application also provides a chip system, which includes a processor core, a system address management unit and a physical memory, wherein the processor core and the system address management unit are coupled, and the system address management unit and the physical memory are coupled. The system address management unit includes an address management unit and a bus address management unit, and the address management unit and the bus address management unit are coupled.

[0124] An embodiment of the present application further provides a computer storage medium, in which computer instructions are stored. When the computer instructions are executed on an electronic device, the electronic device executes the above-mentioned related method steps to implement the access method in the above-mentioned embodiment.

[0125] The embodiments of the present application further provide a computer program product. When the computer program product is run on a computer, the computer is caused to execute the above-mentioned related steps to implement the access method executed by the electronic device in the above-mentioned embodiments.

[0126] In addition, an embodiment of the present application also provides a device, which may specifically be a chip, component or module, and the device may include a connected processor and memory; wherein the memory is used to store computer execution instructions, and when the device is running, the processor may execute the computer execution instructions stored in the memory so that the chip executes the access method executed by the electronic device in the above-mentioned method embodiments.

[0127] Among them, the electronic device, computer storage medium, computer program product or chip provided in this embodiment is used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method provided above and will not be repeated here.

[0128] Through the description of the above implementation methods, technical personnel in the relevant field can understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0129] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0130] The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0131] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0132] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.

[0133] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. An access method, characterized in that: The method comprises: Determine, according to the first virtual address, an address of the second server node corresponding to the first virtual address, where the first virtual address is an address carried in the access request obtained by the first server node; If the address of the second server node is a second virtual address, the access request is sent to the second virtual address, and the second virtual address is a shared virtual address of the first server node and the second server node.

2. The method according to claim 1, characterized in that The step of determining, according to the first virtual address, an address of a second server node corresponding to the first virtual address includes: Determine, according to the first virtual address, a virtual physical address corresponding to the first virtual address, wherein the virtual physical address is an address of a virtual space of the first server node; According to the virtual physical address, an address of a second server node corresponding to the virtual physical address is determined.

3. The method according to claim 2, characterized in that The correspondence between the first virtual address and the virtual physical address is stored in a server node page table, and the correspondence between the virtual physical address and the address of the second server node is stored in a bus page table.

4. The method according to claim 3, characterized in that: The length of a page table entry of the server node page table is different from the length of a page table entry of the bus page table.

5. The method according to any one of claims 1 to 4, characterized in that: The access request also includes an access credential and an identifier of the second server node, wherein the access credential is used to configure access rights of the access request.

6. The method according to claim 1, characterized in that The method further comprises: If the address of the second server node is a physical address, the physical memory of the first server node is accessed based on the physical address, and the first server node and the second server node are the same server node.

7. An access method, characterized in that: The method comprises: receiving an access request, the access request comprising a second virtual address, the second virtual address being a shared virtual address of the first server node and the second server node; Determine, according to the second virtual address, a physical address corresponding to the second virtual address; Based on the access request and the physical address, access the physical memory of the second server node.

8. The method according to claim 7, characterized in that The access request further includes an access credential, and the access credential is used to configure access rights of the access request. Before determining the physical address corresponding to the second virtual address according to the second virtual address, the method further includes: A determination is made based on the access credential whether the access permission of the access request is valid.

9. An access device, characterized in that: The access device includes a system address management unit and a sending unit; The system address management unit is used to determine, according to a first virtual address, an address of a second server node corresponding to the first virtual address, where the first virtual address is an address carried in an access request obtained by the first server node; The sending unit is configured to send the access request to a second virtual address if the address of the second server node is the second virtual address, where the second virtual address is a shared virtual address of the first server node and the second server node.

10. The access device according to claim 9, characterized in that: The system address management unit includes: an address management unit and a bus address management unit; The address management unit is used to determine a virtual physical address corresponding to the first virtual address according to the first virtual address, wherein the virtual physical address is an address of a virtual space of the first server node; The bus address management unit is used to determine the address of the second server node corresponding to the virtual physical address according to the virtual physical address.

11. The access device according to claim 10, characterized in that: The correspondence between the first virtual address and the virtual physical address is stored in a server node page table, and the correspondence between the virtual physical address and the address of the second server node is stored in a bus page table.

12. The access device according to claim 11, characterized in that: The length of a page table entry of the server node page table is different from the length of a page table entry of the bus page table.

13. The access device according to any one of claims 9 to 12, characterized in that: The access request also includes an access credential and an identifier of the second server node, wherein the access credential is used to configure access rights of the access request.

14. The access device according to claim 9, characterized in that: The access device also includes an access unit; The access unit is used to access the physical memory of the first server node based on the physical address if the address of the second server node is a physical address, and the first server node and the second server node are the same server node.

15. An access device, characterized in that: The access device comprises: a receiving unit and a bus address management unit; The receiving unit is used to receive an access request, wherein the access request includes a second virtual address, and the second virtual address is a shared virtual address of the first server node and the second server node; The bus address management unit is used to determine the physical address corresponding to the second virtual address according to the second virtual address; The bus address management unit is further used to access the physical memory of the second server node based on the access request and the physical address.

16. The access device according to claim 15, characterized in that: The access request further includes an access credential, and the access credential is used to configure access rights of the access request. The bus address management unit is further used to: A determination is made based on the access credential whether the access permission of the access request is valid.

17. A chip system, characterized in that: The chip system comprises a processor core, a system address management unit and a physical memory. The processor core is coupled to the system address management unit, and the system address management unit is coupled to the physical memory.

18. The chip system according to claim 17, characterized in that: The system address management unit includes an address management unit and a bus address management unit, and the address management unit and the bus address management unit are coupled.

19. A computer-readable storage medium, characterized in that: The method comprises computer instructions, which, when executed on an electronic device, cause the electronic device to execute the method described in any one of claims 1 to 6 or claim 7 or 8.

20. A computer program product, characterized in that When the computer program product runs on a computer or a processor, the computer or the processor is caused to execute the method of any one of claims 1 to 6 or claim 7 or 8.

Citation Information

Patent Citations

  • Address mapping method and device of shared memory

    CN107729159A

  • Shared memory management unit system, establishing method and memory access method

    CN113806251A

  • Storage management device, processor, related device and related method

    CN114328295A

  • Request processing method, device and system

    CN116010296A

  • Computing system and method for sharing device memories of different computing devices

    US20220121383A1

Cited By

  • Access permission control method and artificial intelligence chip

    CN121396656A

  • Access method and access apparatus

    EP4697182A1

  • Access method and access apparatus

    WO2025007567A1