Data access method and device
By querying the correspondence between the virtual address and the data acquisition address in the address management unit, and directly obtaining the target data acquisition address, the problem of low data access efficiency in the shared virtual address space is solved, and more efficient data access is achieved.
Patent Information
- Application Number
- CN202410050249.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-11
- Publication Date
- 2025-07-11
AI Technical Summary
In computing devices that share virtual address space, prior art requires querying multiple page tables, resulting in low data access efficiency.
The access request is received through the address management unit, and the corresponding relationship between the virtual address and the data acquisition address is queried based on the target virtual address, and the target data acquisition address is directly obtained, including the identification information of the second computing node, so that there is no need to query the page table of the network controller.
Reduces the number of page tables query during data access and improves data access efficiency.
Smart Images

Figure CN120295943A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of memory access, and particularly to a data access method and apparatus. Background Art
[0002] With the rapid development of memory technology, multiple physically independent computing devices can share a virtual address space. For any computing device sharing the virtual address space, the memory data of the computing device may be stored on the physical memory block of the computing device itself, or may be stored on the physical memory block of other computing devices sharing the virtual address space with the computing device.
[0003] Currently, when any computing device sharing the virtual address space needs to access the data indicated by its virtual address, it needs to first query multiple page tables based on the virtual address to determine the location of the physical memory block storing the data, and then obtain the data from the physical memory block.
[0004] However, this process requires querying multiple page tables, resulting in low data access efficiency. Summary of the Invention
[0005] This application provides a data access method and apparatus. This application can improve the data access efficiency. The technical solutions provided by this application are as follows:
[0006] In a first aspect, this application provides a data access method. This method is applied to a first computing node. The first computing node includes an address management unit. The first computing node shares a virtual address space with a second computing node. The method includes: the address management unit receives an access request, where the access request indicates an access to a target virtual address; the address management unit queries the correspondence between the virtual address and the data acquisition address based on the target virtual address, and obtains a target data acquisition address corresponding to the target virtual address, where the target data acquisition address includes the identification information of the second computing node; the address management unit obtains the data indicated by the target virtual address from the second computing node based on the target data acquisition address.
[0007] It can be seen that the target data acquisition address indicates the second computing node for storing the data indicated by the target virtual address, and the address management unit can directly obtain the target data acquisition address by querying the correspondence between the virtual address and the data acquisition address based on the target virtual address. Therefore, the address management unit does not need to first find the network controller corresponding to the target virtual address as in the related art, and then use the network controller to query the page table to obtain the identification of the second computing node, reducing the number of page tables that need to be queried during the data access process and improving the data access efficiency.
[0008] In one implementation, the address management unit queries the correspondence between the virtual address and the data acquisition address based on the target virtual address, and obtains the target data acquisition address corresponding to the target virtual address, including: the address management unit queries the page table based on the target virtual address to obtain the target data acquisition address. The page table includes multiple page table entries, and the page table entry corresponding to the target virtual address records the target data acquisition address. Exemplarily, the descriptor of the page table entry records the target data acquisition address.
[0009] In one implementation, before the address management unit obtains the data indicated by the target virtual address from the second computing node based on the target data acquisition address, the method further includes: the address management unit obtains the target attribute information corresponding to the target virtual address, and the target attribute information indicates the computing node indicated by the target data acquisition address; the address management unit determines that the target data acquisition address indicates the second computing node based on the target attribute information.
[0010] Optionally, the address management unit obtains the target attribute information corresponding to the target virtual address, including: the address management unit queries the page table based on the target virtual address to obtain the target attribute information. The page table includes multiple page table entries, and the page table entry corresponding to the target virtual address records the target attribute information. Exemplarily, the descriptor of the page table entry records the target attribute information.
[0011] Or, before the address management unit obtains the data indicated by the target virtual address from the second computing node based on the target data acquisition address, the method further includes: the address management unit determines that the target data acquisition address indicates the second computing node when the target data acquisition address belongs to a preset address range.
[0012] Optionally, the first computing node includes multiple communication ports, and the target data acquisition address further includes the identification information of the target communication port, so that the address management unit can send a second data acquisition request through the target communication port. The target communication port is one of the multiple communication ports.
[0013] In one implementation, the address management unit obtains the data indicated by the target virtual address from the second computing node based on the target data acquisition address, including: the address management unit sends a first data acquisition request based on the identification information of the target communication port, and the first data acquisition request indicates to obtain the data indicated by the target virtual address from the second computing node. Correspondingly, the method further includes: the target communication port sends a second data acquisition request based on the identification information of the second computing node, and the second data acquisition request indicates that the second computing node provides the data indicated by the target virtual address.
[0014] Optionally, the first data acquisition request and the second data acquisition request further indicate that the target virtual address belongs to a specified application, so that after obtaining the data indicated by the target virtual address, the data can be fed back to the application based on the identification information.
[0015] Similarly, the first data acquisition request and the second data acquisition request also indicate that the target virtual address belongs to the process of the specified application, so that after acquiring the data indicated by the target virtual address, the data can be fed back to the process based on the identification information.
[0016] In a second aspect, the present application provides a data access device. The device is applied to the first computing node. The first computing node and the second computing node share a virtual address space. The data access device includes: a receiving module, configured to receive an access request, where the access request indicates an access to a target virtual address; a query module, configured to query a correspondence between the virtual address and the data acquisition address based on the target virtual address, to obtain a target data acquisition address corresponding to the target virtual address, where the target data acquisition address includes identification information of the second computing node; an acquisition module, configured to acquire the data indicated by the target virtual address from the second computing node based on the target data acquisition address.
[0017] Optionally, the query module is specifically configured to: query a page table based on the target virtual address to obtain the target data acquisition address, where the page table includes multiple page table entries, and the page table entry corresponding to the target virtual address records the target data acquisition address.
[0018] Optionally, the descriptor of the page table entry records the target data acquisition address.
[0019] Optionally, the query module is further configured to: acquire target attribute information corresponding to the target virtual address, where the target attribute information indicates the computing node indicated by the target data acquisition address; and determine, based on the target attribute information, that the target data acquisition address indicates the second computing node.
[0020] Optionally, the query module is specifically configured to: query a page table based on the target virtual address to obtain the target attribute information, where the page table includes multiple page table entries, and the page table entry corresponding to the target virtual address records the target attribute information.
[0021] Optionally, the descriptor of the page table entry records the target attribute information.
[0022] Optionally, the query module is further configured to: determine that the target data acquisition address indicates the second computing node when the target data acquisition address belongs to a preset address range.
[0023] Optionally, the first computing node includes multiple communication ports, and the target data acquisition address further includes identification information of a target communication port, where the target communication port is one of the multiple communication ports.
[0024] Optionally, the acquisition module is specifically configured to: send a first data acquisition request based on the identification information of the target communication port, where the first data acquisition request indicates to acquire the data indicated by the target virtual address from the second computing node.
[0025] Correspondingly, the data access device further includes: a sending module, configured to send a second data acquisition request based on the identification information of the second computing node, where the second data acquisition request instructs the second computing node to provide data indicated by a target virtual address.
[0026] In a third aspect, the present application provides a computing device, including a memory and a processor, where the memory stores program instructions, and the processor runs the program instructions to execute the method provided in the first aspect of the present application and any of its possible implementation manners.
[0027] In a fourth aspect, the present application provides a computing device cluster, including a plurality of computing devices, where the plurality of computing devices include a plurality of processors and a plurality of memories, the plurality of memories store program instructions, and the plurality of processors run the program instructions, so that the computing device cluster executes the method provided in the first aspect of the present application and any of its possible implementation manners.
[0028] In a fifth aspect, the present application provides a computer-readable storage medium, which is a non-volatile computer-readable storage medium, and the computer-readable storage medium includes program instructions. When the program instructions run on a computing device, the computing device is caused to execute the method provided in the first aspect of the present application and any of its possible implementation manners.
[0029] In a sixth aspect, the present application provides a computer program product including instructions. When the computer program product runs on a computer, the computer is caused to execute the method provided in the first aspect of the present application and any of its possible implementation manners. Description of the Drawings
[0030] Figure 1 is a schematic diagram of a shared virtual address space between a GPU1 and a GPU2 provided by an embodiment of the present application;
[0031] Figure 2 is a schematic diagram of a virtual address divided into multiple address segments provided by an embodiment of the present application;
[0032] Figure 3 is a schematic diagram of a process of querying according to a virtual address provided by an embodiment of the present application;
[0033] Figure 4 is a schematic diagram of a structure of an application scenario involved in a data access method provided by an embodiment of the present application;
[0034] Figure 5 is a flowchart of a data access method provided by an embodiment of the present application;
[0035] Figure 6It is a logical schematic diagram for a first computing node to access data stored in a second computing node provided by an embodiment of the present application;
[0036] Figure 7 It is a process schematic diagram for a first computing node to access data stored in a second computing node provided by an embodiment of the present application;
[0037] Figure 8 It is a schematic diagram of a block descriptor provided by an embodiment of the present application;
[0038] Figure 9 It is a schematic diagram of a page descriptor provided by an embodiment of the present application;
[0039] Figure 10 It is a schematic diagram of a data access device provided by an embodiment of the present application;
[0040] Figure 11 It is a schematic diagram of another data access device provided by an embodiment of the present application;
[0041] Figure 12 It is a structural schematic diagram of a computing device provided by an embodiment of the present application;
[0042] Figure 13 It is a structural schematic diagram of a computing device cluster provided by an embodiment of the present application. Detailed implementation manners
[0043] To make the objectives, technical solutions, and advantages of the present application clearer, the following will further describe the embodiments of the present application in detail with reference to the accompanying drawings.
[0044] With the rapid development of memory technology, multiple physically independent computing devices can share a virtual address (VA) space, increasing the available memory of the computing devices. For any computing device sharing the virtual address space, the memory data of the computing device may be stored on the physical memory blocks of the computing device itself, or may be stored on the physical memory blocks of other computing devices sharing the virtual address space with the computing device.
[0045] Currently, when any computing device sharing the virtual address space needs to access the data indicated by its virtual address, it needs to first query multiple page tables based on the virtual address to determine the location of the physical memory block storing the data. When the data that the computing device needs to access is stored on the physical memory blocks of other computing devices sharing the virtual address space with it, the computing device can obtain the data from the other computing devices to achieve access to the data. However, this process requires querying multiple page tables, resulting in low data access efficiency.
[0046] For example, when a virtual address space is shared among multiple graphics processing units (GPUs), a communication connection is established among the multiple GPUs. By way of example, Figure 1 is a schematic diagram of GPUs GPU1 and GPU2 sharing a virtual address space. As Figure 1 shown, GPU1 includes a memory management unit (MMU), a memory, and multiple network controllers. The memory stores a system page table. The system page table is used to record the correspondence between virtual addresses and physical addresses (PAs). The network controllers store a network page table. The network page table is used to record the correspondence between virtual addresses and the network addresses (NAs) of other GPUs sharing the virtual address space of GPU1. Among them, a virtual address is an address in the virtual address space used to load program data during the running of a program. That is to say, a virtual address is an address allocated to the process of an application program during the running of the application program. A virtual address can be mapped to physical memory. The data indicated by the virtual address is recorded on the physical memory block to which it is mapped. A physical address is the address of a physical memory block. The network address of a computing device is identification information used to uniquely identify the computing device in a network. By way of example, the network address can be, for example, an Internet Protocol (IP) address, the device number of the computing device, or other identification information that can uniquely identify the computing device. For example, assuming that a computing cluster includes 10 computing nodes, each of the 10 computing nodes can be uniquely identified by "cluster number + i", where i indicates that the computing node is the i-th computing node among the 10 computing nodes.
[0047] Part of the system page table can be optionally cached in the memory management unit. That is, the memory management unit has a translation lookaside buffer (TLB). An application 1 is running in GPU1. When the memory management unit receives an indication from application 1 to access the data indicated by VA1, the memory management unit first looks up VA1 in the cached system page table, that is, performs a TLB lookup. When the memory management unit fails to find the physical address corresponding to VA1 in the cached system page table, the memory management unit then looks up in the system page table, that is, the memory management unit performs a page table walk (PTW). When the data indicated by VA1 is recorded on the memory block of another GPU sharing the virtual address space with GPU1, the physical address corresponding to VA1 indicates the physical address of the network controller for interacting with the other GPU. Since there are multiple network controllers in the GPU, after the memory management unit obtains the physical address corresponding to VA1, it sends an access request of the application to the network controller indicated by the physical address. After receiving the access request, the network controller looks up the network page table according to VA1 carried in the access request to obtain the network address corresponding to VA1, and then sends an access request of the application to the GPU indicated by the network address, so that the GPU can feedback the data indicated by VA1 to GPU1 based on the access request.
[0048] Among them, virtual addresses are usually divided into multiple address segments. For example, Figure 2 as shown, VA1 includes address segment a, address segment b, address segment c, address segment d, and address segment e. As Figure 3 shown, the system page table includes multiple page tables. When the memory management unit looks up the physical address corresponding to VA1 in the system page table, it needs to first find the level-1 table of the system page table according to the base address of the system page table, and then look up the level-1 table based on address segment a to obtain the base address of the level0 table, and then find the level0 table based on the base address of the level0 table, and then look up the level0 table based on address segment b to obtain the base address of the level1 table, and then find the level1 table based on the base address of the level1 table, and so on, until the physical address PA1 corresponding to VA1 is found based on address segment e. Similarly, the network page table also includes multiple page tables. When the network controller looks up the network address corresponding to VA1 according to VA1, it also needs to query these multiple page tables. It can be seen that when the GPU needs to access data, it needs to query multiple page tables, resulting in low access efficiency for data.
[0049] Based on this, an embodiment of the present application provides a data access method. This method is applied to a first computing node. The first computing node and a second computing node share a virtual address space. The first computing node includes: an address management unit. The method includes: the address management unit receives an access request, and the access request indicates an access to a target virtual address; the address management unit queries the correspondence between the virtual address and the data acquisition address based on the target virtual address, and obtains a target data acquisition address corresponding to the target virtual address, where the target data acquisition address includes the identification information of the second computing node; then, the address management unit obtains the data indicated by the target virtual address from the second computing node based on the target data acquisition address.
[0050] It can be seen that the target data acquisition address indicates the second computing node for storing the data indicated by the target virtual address, and the address management unit can directly obtain the target data acquisition address by querying the correspondence between the virtual address and the data acquisition address based on the target virtual address. Therefore, the address management unit does not need to first find the network controller corresponding to the target virtual address as in the related art, and then use the network controller to query the page table to obtain the identification of the second computing node, reducing the number of page tables that need to be queried during the data access process and improving the efficiency of accessing data.
[0051] Next, the technical solution of the present application will be introduced in detail from multiple perspectives such as application scenarios, method flows, hardware devices, and software devices. Here, an example of the application scenario of the embodiment of the present application will be described first.
[0052] Figure 4 It is a schematic structural diagram of an application scenario involved in a data access method provided by an embodiment of the present application. As Figure 4 shown, this application scenario includes: a compute cluster 10. The compute cluster 10 includes a group of multiple compute nodes 101 with communication interconnection relationships managed by a scheduler. A communication connection is established between the multiple compute nodes 101. For example, a communication connection is established between the compute nodes 101 through a network. Optionally, the network can be a local area network, an Internet, or other networks, which are not limited in the embodiment of the present application. Figure 4 It is a schematic diagram of the interconnection of multiple compute nodes 101 through a switch in the network.
[0053] Multiple computing nodes 101 may optionally execute a computing task jointly. Multiple computing nodes 101 may optionally execute multiple computing tasks jointly. Alternatively, each computing node 101 among the multiple computing nodes 101 may execute a computing task independently. Alternatively, there are multiple computing tasks executed by the multiple computing nodes 101, some of the computing tasks are jointly executed by some of the computing nodes 101 among the multiple computing nodes 101, and some of the computing tasks are executed by a certain computing node 101 among the multiple computing nodes 101. Alternatively, the multiple computing nodes 101 may also optionally execute tasks in other ways, and the embodiments of the present application do not make specific limitations thereto. Moreover, each computing node 101 has its own operating system, one or more processor cores (such as Figure 4 the central processing unit (CPU) and XPU in
[0054] ), some storage, and communication ports. Each computing node 101 can be used in an exclusive or shared manner according to the tasks arranged in the computing cluster including the multiple computing nodes 101.
[0055] In this application, multiple computing nodes 101 can share a virtual address space, enabling the memory data of a computing node 101 to be stored not only in the memory of the computing node 101 itself but also in the memory of other computing nodes 101 that share the virtual address space with this computing node 101. The memory of other computing nodes 101 is equivalent to an extension of the memory of this computing node 101, which can increase the available memory of the computing node 101. Multiple computing nodes 101 sharing a virtual address space is also referred to as multiple computing nodes 101 using unified virtual memory. Among them, multiple computing nodes 101 sharing a virtual address space can be achieved by uniformly allocating the available virtual addresses of multiple computing nodes 101, such that the virtual address assigned to any process in any one of the multiple computing nodes 101 is unique for the multiple computing nodes 101. When two computing devices share a virtual address space, the memory data of any one of them can be stored on the physical memory block of this computing device as needed, or on the physical memory block of the other computing device. Therefore, for any computing node 101 sharing a virtual address space, the memory data of this computing node 101 may be stored on the physical memory block of this computing node 101 or on the physical memory block of other computing nodes 101 that share the virtual address space with this computing node 101. When the memory data of any one of the multiple computing nodes 10 is stored in the memory of another computing node 10, this computing node 10 can access the data stored in the memory of the other computing node 10. Multiple computing nodes 10 can form a computing node cluster with an extremely large scale by sharing a virtual address space, which helps to apply it to scenarios with large demands for storage and computing, such as scenarios related to AI model training, testing, and deployment.
[0056] In one implementation, the data access method provided by the embodiments of this application can be implemented by a computing node 101 running an executable program. For example, the executable program of this data access method can be presented in the form of an application installation package. After the application installation package is installed in the computing node 101, the data access method can be implemented by running this executable program.
[0057] Optionally, the data access method provided by the embodiments of this application can be implemented by a functional unit in the computing node 101, such as implemented by an address management unit. This address management unit can be optionally implemented in whole or in part by software, hardware, firmware, or any combination thereof. Exemplarily, the function of this address management unit is implemented by an MMU.
[0058] It should be understood that the above content is an exemplary description of the application scenario of the data access method provided in the embodiments of the present application, and does not constitute a limitation on the application scenario of the data access method. Those of ordinary skill in the art can know that with the change of business requirements, its application scenario can be adjusted according to application requirements, and the embodiments of the present application do not list them one by one.
[0059] Next, taking the data access method provided in the embodiments of the present application as being executed by a first computing node, and the first computing node and a second computing node sharing a virtual address space as an example, the data access method provided in the embodiments of the present application will be described. As Figure 5 shown, the data access method includes the following steps:
[0060] Step 501: The address management unit of the first computing node receives an access request, and the access request indicates an access to a target virtual address.
[0061] An application program runs in the first computing node. During the running of the application program, if it needs to access a target virtual address, it can initiate an access request to request access to the data indicated by the target virtual address. After the application program initiates the access request, the address management unit can receive the access request. In one implementation, when the process of the application program needs to access a target virtual address, it sends an access request to the processor core of the first computing node to request the processor core to provide the data indicated by the target virtual address. After receiving the access request, the processor core forwards the access request to the address management unit to indicate the address management unit to provide the data. Exemplarily, as Figure 6 and Figure 7 shown, when the process of the application program needs to access the target virtual address VA = 0x1000, it sends an access request carrying the target virtual address VA = 0x1000 to the core (GPU Core) of the image processor. After receiving the access request, the GPU Core can forward the access request to the address management unit of the computing node to which the GPU Core belongs by executing a preset instruction, so that the address management unit makes a response based on the access request. Among them, Figure 7 is a schematic diagram of the address management unit implemented by the MMU.
[0062] Optionally, the address management unit may also obtain the identification information of the application program that initiates the access request. In one implementation, after receiving the access request sent by the application program, the processor core may obtain the identification information of the application program, and when forwarding the access request to the address management unit, provide the address management unit with the identification information of the application program. In another implementation, when the application program sends an access request to the processor core, it may also send the identification information of the application program to the processor core. Optionally, the identification information of the application program may be carried in the access request sent by the application program to the processor core. Similarly, the access request sent by the processor core to the address management unit may also carry the identification information of the application program. In this way, the address management unit can distinguish the application program that initiates the access request based on the identification information, so as to feedback the data to the application program based on the identification information after obtaining the data indicated by the target virtual address. In one implementation, the identification information of the application program may be selected as the name of the application program, etc. It should be noted that the identification information of the application program may also be implemented in other ways, which are not listed one by one here.
[0063] Similarly, the address management unit may also obtain the identification information of the process that initiates the access request. For example, after receiving the access request sent by the process of the application program, the processor core may obtain the identification information of the process, and when forwarding the access request to the address management unit, provide the address management unit with the identification information of the process. For another example, when the process of the application program sends an access request to the processor core, it may also send the identification information of the process to the processor core. Optionally, the identification information of the process may be carried in the access request sent by the process to the processor core. Similarly, the access request sent by the processor core to the address management unit may also carry the identification information of the process. In this way, the address management unit can distinguish the process that initiates the access request based on the identification information, so as to feedback the data to the process based on the identification information after obtaining the data indicated by the target virtual address. In one implementation, the identification information of the process may be randomly assigned. For example, when a process is launched in a computing node, the operating system of the computing node may assign identification information to the process and ensure the uniqueness of the identification information. In one implementation, the identification information of the process may be selected as the address space identifier (ASID) of the application program to which the process belongs. It should be noted that the identification information of the process may also be implemented in other ways, which are not listed one by one here. By way of example, as Figure 7 shown, after the process with the identification information of ASID = 0x1 sends an access request to the processor core, the processor core can obtain the identification information and provide the address management unit with the identification information of the process when forwarding the access request to the address management unit.
[0064] Step 502: The address management unit queries the correspondence between the virtual address and the data acquisition address based on the target virtual address, and obtains the target data acquisition address corresponding to the target virtual address.
[0065] The target data acquisition address is used to indicate the storage location of the data indicated by the target virtual address. That is, the target data acquisition address is the address used to acquire the data indicated by the target virtual address. After the address management unit obtains the target data acquisition address, it can acquire the data indicated by the target virtual address from the location indicated by the target data acquisition address. According to the previous description, the data indicated by the target virtual address may be stored on the physical memory block of the first computing node or on the physical memory block of the second computing node. Then, according to different situations of storing data, the content indicated by the target data acquisition address has at least two alternatives. For example, the target data acquisition address indicates the physical memory block of the first computing node, or the target data acquisition address indicates the second computing node. And the second computing node can be indicated by the identification information of the second computing node. For example, the target data acquisition address includes the identification information of the second computing node. The identification information of the second computing node can be selected as the network address (NA) of the second computing node to facilitate the differentiation of the second computing node in the network. By way of example, the network address can be selected as the internet protocol (IP) address, the device number of the computing device, or other identification information that can uniquely identify the computing device. For example, assuming that the computing cluster includes 10 computing nodes, each of the 10 computing nodes can be uniquely identified by "cluster number + i", where i indicates that the computing node is the i-th computing node among the 10 computing nodes.
[0066] Among them, since each computing node can maintain the correspondence between its own physical memory block and the virtual address, and considering the security of the data in the computing node, when the data indicated by the target virtual address is stored on the physical memory block of the second computing node, the target data acquisition address queried by the first computing node based on the target virtual address can optionally indicate the second computing node without indicating the physical memory slice in the second computing node. Or, the target data acquisition address can also indicate the physical memory slice used to store the data in the second computing node, which can be adjusted according to the application requirements, and the embodiments of the present application do not make specific limitations on this. At this time, the granularity indicated by the target data acquisition address can be determined according to the way the operating system (OS) of the computing node maintains the correspondence between the virtual address and the data acquisition address. During the operation of the operating system, such as during the initialization process of the operating system, the operating system can establish the correspondence between the virtual address and the data acquisition address in the computing node according to the way it maintains this correspondence for subsequent use.
[0067] In this application, when the target data acquisition address indicates a second computing node, the first computing node needs to send a second data acquisition request to the second computing node, so that the second computing node can provide the data indicated by the target virtual address to the first computing node based on this second data acquisition request. This second data acquisition request can be optionally sent to the second computing node through the communication port of the first computing node. Then the target data acquisition address can also optionally indicate the target communication port for sending the second data acquisition request to the second computing node, so that the address management unit can send the second data acquisition request through this target communication port. That is to say, the target data acquisition address includes not only the identification information of the second computing node, but also the identification information of the target communication port. Optionally, the identification information of the target communication port can be the identification number of the target communication port. Or, the target communication port can be the port address of the target communication port. When the first computing node has one communication port, the target communication port indicated by the target data acquisition address is this communication port. When the first computing node has multiple communication ports, the target communication port is one of the multiple communication ports that has established a communication connection with the second computing node.
[0068] Exemplarily, assume that the first computing node has multiple communication ports, and these multiple communication ports are respectively connected to different computing nodes. When the identification information of all the computing nodes connected by the multiple communication ports is different, the identification message of the second computing node indicated by the target data acquisition address can uniquely determine this second computing node, and correspondingly, the communication port for sending the second data acquisition request to this second computing node can be determined. Therefore, the target data acquisition address may not indicate the identification message of the target communication port. When the identification information of all the computing nodes connected by the multiple communication ports has duplicates, the identification message of the second computing node indicated by the target data acquisition address cannot uniquely determine this second computing node. Therefore, the target data acquisition address can also optionally indicate the identification message of the target communication port to uniquely determine the second computing node through the identification information of the target communication port and the identification message of the second computing node. For example, assume that the first computing node is both in computing cluster 1 and in computing cluster 2. The first computing node communicates with the second computing node 1-10 in computing cluster 1 through communication port 1, and communicates with the second computing node 1-10 in computing cluster 2 through communication port 2. The network addresses of the second computing node 1-10 in computing cluster 1 and the second computing node 1-10 in computing cluster 2 have duplicates, such as both being NA1-NA10. Then, in order to distinguish different second computing nodes, the target data acquisition address can optionally include the computing node identification message and the identification information of the port to indicate a unique second computing node.
[0069] In one implementation, the implementation process of step 502 includes: The address management unit queries the correspondence between the virtual address and the data acquisition address based on the target virtual address to obtain the target data acquisition address. In this way, the address management unit can directly obtain the target data acquisition address indicating the second computing node by querying this correspondence according to the target virtual address, without first finding the corresponding network controller as in the related art and then using the network controller to query the page table to obtain the identifier of the second computing node, reducing the number of page tables to be queried and effectively improving the efficiency of accessing data.
[0070] Optionally, the correspondence between the virtual address and the data acquisition address can be recorded in a page table. The index of the page table is the virtual address. The page table includes multiple page table entries (PTEs), and the page table entry records the data acquisition address corresponding to the virtual address. Then the address management unit can index the page table based on the target virtual address to obtain the target data acquisition address corresponding to the target virtual address. In one implementation, the page table entry includes a descriptor. The data acquisition address corresponding to the virtual address can be optionally recorded in this descriptor. And, according to the different scopes of action of the descriptor, the descriptors of the page table include block descriptors and page descriptors. Then the data acquisition address can be optionally recorded in the block descriptor or the page descriptor. Further, both the block descriptor and the page descriptor include multiple fields, and the data acquisition address can be optionally recorded in any one of these multiple fields. For example, as Figure 8 and Figure 9 shown, both the block descriptor and the page descriptor include an "output address" field, and the data acquisition address can be optionally recorded in the "output address" field of the block descriptor or the page descriptor. In the related art, the physical address used to indicate the network controller is recorded in the "output address" field of the page descriptor of the page table. Then, by recording the data acquisition address of the present application in the "output address" field of the block descriptor or the page descriptor, the format of the original page table can be reused without making many changes to the page table, improving the feasibility of the data access method provided by the embodiments of the present application.
[0071] Among them, when the address management unit queries the target data acquisition address based on the target virtual address, it can first search in the cache, for example, search in the TLB. When the address management unit cannot find the result in the cache, it then traverses and searches in the memory, for example, uses PTW, until the target data acquisition address corresponding to the target virtual address is obtained. Since the cache has a faster reading speed than the memory, by first searching in the cache, if the target data acquisition address can be found in the cache, there is no need to search in the memory anymore, which can effectively improve the search speed and thus improve the data access speed.
[0072] As Figure 7 shown, after the address management unit obtains the target virtual address VA = 0x1000 and the process identification information ASID = 0x1, it can first perform a TLB lookup based on the target virtual address. As Figure 6 and Figure 7 shown, when the address management unit cannot find the target data acquisition address corresponding to the target virtual address in the TLB, the address management unit continues to perform PTW on the page table in the memory. After finding the target data acquisition address corresponding to the target virtual address VA = 0x1000 in the memory, the memory feeds back the target data acquisition address to the address management unit. The address management unit obtains the target data acquisition address 0xF0009000.
[0073] Step 503: The address management unit determines whether the target data acquisition address indicates the second computing node.
[0074] What the address management unit actually obtains by executing Step 502 is the binary number representing the target data acquisition address. After the address management unit obtains the binary number representing the target data acquisition address, it needs to first identify the binary number to determine whether the target data acquisition address indicates the physical memory block of the first computing node or the second computing node. There are various implementation methods. The following takes the following two implementation methods as examples to illustrate it:
[0075] In one implementation method, the address management unit may optionally obtain the target attribute information corresponding to the target virtual address, and then, based on the target attribute information, determine whether the binary number representing the target data acquisition address indicates the second computing node. Among them, the attribute information indicates that the target data acquisition address indicates the physical memory block of the first computing node, or the target data acquisition address indicates the second computing node. Then, when the target attribute information indicates that the target data acquisition address indicates the second computing node, the address management unit determines that the binary number representing the target data acquisition address indicates the second computing node. When the attribute information of the target virtual address indicates that the target data acquisition address indicates the physical memory block of the first computing node, the address management unit determines that the binary number representing the target data acquisition address indicates the physical memory block of the first computing node.
[0076] Optionally, the address management unit may optionally query a preset correspondence between virtual addresses and their attribute information based on the target virtual address to obtain the attribute information of the target virtual address. Exemplarily, this correspondence may be recorded in a page table. The index of the page table is the virtual address, and the page table includes multiple page table entries, and the page table entry includes the attribute information corresponding to the virtual address. Then the address management unit may index the page table based on the target virtual address to obtain the target attribute information corresponding to the target virtual address. In one implementation, the page table entry includes a descriptor, and the attribute information corresponding to the virtual address may optionally be recorded in the descriptor. Moreover, according to the different scopes of action of the descriptor, the descriptors of the page table include block descriptors and page descriptors. Then the attribute information corresponding to the virtual address may optionally be recorded in the block descriptor or the page descriptor. Further, both the block descriptor and the page descriptor include multiple fields, and the attribute information corresponding to the virtual address may optionally be recorded in any one of the multiple fields. For example, as Figure 8 and Figure 9 shown, both the block descriptor and the page descriptor include an "upper attributes" field, and the attribute information corresponding to the virtual address may optionally be recorded in the "upper attributes" field of the block descriptor or the page descriptor. At this time, the "upper attributes" is used to indicate whether the physical memory block indicated by the data acquisition address is "remote". Exemplarily, when the value of the "upper attributes" field is "1", the target attribute information corresponding to the target virtual address indicates that the data acquisition address indicates the second computing node. When the value of the "upper attributes" field is "0", the target attribute information corresponding to the target virtual address indicates that the data acquisition address indicates the physical memory block of the first computing node. Moreover, as Figure 6 and Figure 7 shown, when the target data acquisition address indicates the second computing node, the target data acquisition address also indicates the target communication port used by the first computing node to send a second data acquisition request to the second computing node. Then the address management unit may know that the target data acquisition address 0xF0009000 indicates the second computing node with a network address NA of 0x9 and the target communication port with a port address P1 of 0xF0000000. In this way, the present application can reuse the existing fields in the original page table without making many changes to the page table, improving the feasibility of the data access method provided by the embodiments of the present application.
[0077] In another implementation, when multiple computing nodes sharing a virtual address space use a unified physical address plan, any physical address is unique among the multiple computing nodes. Then, when the target data acquisition address belongs to the computing node cluster sharing the virtual address space but does not belong to the first computing node, it can be determined that the target data acquisition address belongs to the second computing node. Therefore, after the address management unit obtains the binary number representing the target data acquisition address, if the target data acquisition address belongs to a preset address range, it can be determined that the target data acquisition address indicates the second computing node. The physical addresses in the preset address range belong to the computing node cluster sharing the virtual address space but do not belong to the first computing node.
[0078] Step 504: The address management unit obtains the data indicated by the target virtual address from the second computing node based on the target data acquisition address.
[0079] When the target data acquisition address indicates the second computing node, the address management unit needs to obtain the data indicated by the target virtual address from the second computing node. In one implementation, the address management unit may optionally send a second data acquisition request to the second computing node through a communication interface to request the second computing node to provide the data indicated by the target virtual address to the first computing node. Then, when the address management unit determines that the target data acquisition address indicates the second computing node, it needs to first determine the target communication interface for sending the second data acquisition request to the second computing node. When the first computing node has one communication port, this communication port is the target communication port. When the first computing node has multiple communication ports, the address management unit needs to determine the target communication port among the multiple communication ports. Optionally, when the target data acquisition address includes the identification message of the communication port, the address management unit determines the communication port indicated by the target data acquisition address as the target communication port. Or, the address management unit may optionally obtain the connection methods of the multiple communication ports of the first computing node, determine the communication port having a communication connection with the second computing node based on the connection methods, and determine this communication port as the target communication port.
[0080] After the address management unit determines the target communication interface, it sends a first data acquisition request to the target communication port to instruct the target communication port to obtain the data indicated by the target virtual address from the second computing node. In one implementation, the first data acquisition request carries the identification information of the second computing node and the target virtual address to instruct to obtain the data indicated by the target virtual address from the second computing node. Optionally, the first data acquisition request also carries the identification information of the application program (or process) initiating the access request to instruct to obtain the data belonging to the application program (or process) recorded in the target virtual address from the second computing node. For example Figure 7As shown, after the address management unit determines the second computing node with a network address of 0x9 and the target communication port with a port address of 0xF0000000, it can send a first data acquisition request carrying the target virtual address VA = 0x1000, the identification information ASID = 0x1 of the process, the network address NA = 0x9, and the port address 0xF0000000.
[0081] After receiving the first data acquisition request, the target communication port can send a second data acquisition request to the second computing node based on the identification message of the second computing node to instruct the second computing node to provide the data indicated by the target virtual address to the first computing node. In one implementation, the second data acquisition request carries the target virtual address to instruct the second computing node to provide the data indicated by the target virtual address. Optionally, the first data acquisition request also carries the identification information of the application program (or process) that initiates the access request in the first computing node to instruct the second computing node to provide the data belonging to the application program (or process) recorded in the target virtual address. Among them, as Figure 7 shown, the target communication port can send a second data acquisition request to the second computing node through the network. The second data acquisition request carries the target virtual address VA = 0x1000 and the identification information ASID = 0x1 of the process.
[0082] After the communication port of the second computing node receives the second data acquisition request, it first queries the physical address of the physical memory block for storing the data indicated by the target virtual address based on the second data acquisition request, then reads the data from the physical address, and provides the data to the first computing node. In one implementation, the operation of querying the physical address can be optionally performed by the communication port of the second computing node. And when the communication port queries the physical address based on the second data acquisition request, it can optionally first look up in the cache, for example, look up in the TLB. When the communication port cannot find the result in the cache, the communication port traverses and searches in the memory through the address management unit of the second computing node, for example, using PTW, until the physical address of the physical memory block for storing the data indicated by the target virtual address is obtained. Since the cache has a faster reading speed than the memory, by first looking up in the cache, if the physical address can be found in the cache, there is no need to look up in the memory anymore, which can effectively improve the search speed and thus improve the access speed to the data. As Figure 7As shown in the figure, after the communication port of the second computing node receives the second data acquisition request sent by the target communication port, it can first perform a TLB lookup based on the target virtual address VA = 0x1000 and the process identification information ASID = 0x1. When the address management unit cannot find the physical address corresponding to the target virtual address and this identification information in the TLB, the communication port sends a lookup request to the address management unit of the second computing node. This lookup request carries the target virtual address VA = 0x1000 and the process identification information ASID = 0x1. The address management unit of the second computing node performs a PTW on the page table in the memory based on this lookup request. After finding the target physical address PA 0x8000 corresponding to the target virtual address VA = 0x1000 and the identification information ASID = 0x1 in the memory, the memory of the second computing node feeds back this target physical address to the address management unit. The address management unit of the second computing node feeds back this target physical address PA = 0x8000 to the communication port of the second computing node. Then, this communication port reads the corresponding data from the storage based on this target physical address PA = 0x8000 and feeds back this data to the first computing node, so that the process indicated by the identification information ASID = 0x1 can obtain this data.
[0083] In summary, in the data access method provided in the embodiments of the present application, the address management unit receives an access request, and this access request indicates an access to a target virtual address; the address management unit queries the correspondence between the virtual address and the data acquisition address based on the target virtual address, and obtains the target data acquisition address corresponding to the target virtual address. This target data acquisition address includes the identification information of the second computing node; then, the address management unit obtains the data indicated by the target virtual address from the second computing node based on this target data acquisition address. Thus, it can be seen that the target data acquisition address indicates the second computing node for storing the data indicated by the target virtual address, and the address management unit can directly obtain this target data acquisition address by querying the correspondence between the virtual address and the data acquisition address based on the target virtual address. It can be seen that the address management unit of the present application does not need to first find the physical address indicating the network controller based on the target virtual address in the system page table as in the related art, find the network controller corresponding to the target virtual address according to the found physical address, and then use the network controller to query the page table to obtain the identification of the second computing node. Therefore, the present application reduces the number of page tables that need to be queried during the process of accessing data, reduces the consumption caused by managing the page tables, and improves the efficiency of accessing data.
[0084] It should be noted that the sequence of steps of the data access method provided in the embodiments of the present application can be appropriately adjusted, and the steps can also be increased or decreased accordingly according to the situation. Any method of change that can be easily thought of by those skilled in the art within the technical scope disclosed in the present application should be covered within the protection scope of the present application, so it will not be elaborated here.
[0085] The following is an example of the virtual device in the embodiments of the present application.
[0086] The data access method in the embodiments of the present application is introduced above. Corresponding to the above method, the embodiments of the present application also provide a data access device. This device is applied to the first computing node. The first computing node shares a virtual address space with the second computing node. Figure 10 It is a schematic structural diagram of a data access device provided in the embodiments of the present application. Based on Figure 10 the following multiple components shown, this Figure 10 data access device shown can perform all or part of the operations shown above Figure 5 shown. It should be understood that the device may include more additional components than those shown or omit some of the components shown. The embodiments of the present application do not limit this. As Figure 10 shown, the data access device 1000 may include:
[0087] A receiving module 1001, configured to receive an access request, where the access request indicates an access to a target virtual address.
[0088] A query module 1002, configured to query the correspondence between the virtual address and the data acquisition address based on the target virtual address, and obtain a target data acquisition address corresponding to the target virtual address. The target data acquisition address includes identification information of the second computing node.
[0089] An acquisition module 1003, configured to acquire the data indicated by the target virtual address from the second computing node based on the target data acquisition address.
[0090] Optionally, the query module 1002 is specifically configured to: query a page table based on the target virtual address to obtain a target data acquisition address. The page table includes multiple page table entries, and the page table entry corresponding to the target virtual address records the target data acquisition address.
[0091] Optionally, the descriptor of the page table entry records the target data acquisition address.
[0092] Optionally, the query module 1002 is further configured to: acquire target attribute information corresponding to the target virtual address, where the target attribute information indicates the computing node indicated by the target data acquisition address; and determine that the target data acquisition address indicates the second computing node based on the target attribute information.
[0093] Optionally, the query module 1002 is specifically configured to: query a page table based on a target virtual address to obtain target attribute information, where the page table includes multiple page table entries, and the page table entry corresponding to the target virtual address records the target attribute information.
[0094] Optionally, the descriptor of the page table entry records the target attribute information.
[0095] Optionally, the query module 1002 is further configured to: when the target data acquisition address belongs to a preset address range, determine that the target data acquisition address indicates a second computing node.
[0096] Optionally, the first computing node includes multiple communication ports, and the target data acquisition address further includes the identification information of the target communication port, where the target communication port is one of the multiple communication ports.
[0097] Optionally, the acquisition module 1003 is specifically configured to: based on the identification information of the target communication port, send a first data acquisition request, where the first data acquisition request instructs to acquire the data indicated by the target virtual address from the second computing node.
[0098] Correspondingly, as Figure 11 shown, the data access device further includes: a sending module 1004, configured to send a second data acquisition request based on the identification information of the second computing node, where the second data acquisition request instructs the second computing node to provide the data indicated by the target virtual address.
[0099] Here, for the detailed working processes of the receiving module 1001, the query module 1002, the acquisition module 1003, and the sending module 1004, please refer to the descriptions in the foregoing method embodiments.
[0100] In summary, in the data access device provided in the embodiment of the present application, a receiving module receives an access request, and the access request indicates to access a target virtual address; a query module queries the correspondence between the virtual address and the data acquisition address based on the target virtual address to obtain a target data acquisition address corresponding to the target virtual address, and the target data acquisition address includes identification information of a second computing node; then, an acquisition module acquires data indicated by the target virtual address from the second computing node based on the target data acquisition address. It can be seen that the target data acquisition address indicates the second computing node for storing the data indicated by the target virtual address, and the query module can directly obtain the target data acquisition address by querying the correspondence between the virtual address and the data acquisition address based on the target virtual address. It can be seen that the query module of the present application does not need to first find the physical address indicating the network controller based on the target virtual address in the related art, find the network controller corresponding to the target virtual address according to the found physical address, and then use the network controller to query the page table to obtain the identification of the second computing node. Therefore, the present application reduces the number of page tables that need to be queried during the data access process, reduces the consumption caused by page table management, and improves the efficiency of data access.
[0101] An example of the basic hardware structure involved in the embodiment of the present application will be described below.
[0102] The embodiment of the present application provides a computing device. The computing device is used to implement some or all of the functions in the data access method provided in the embodiment of the present application. Figure 12 It is a schematic structural diagram of a computing device provided in the embodiment of the present application. As Figure 12 shown, the computing device 1200 includes a processor 1201, a memory 1202, a communication port 1203, and a bus 1204. Among them, the processor 1201, the memory 1202, and the communication port 1203 are communicatively connected to each other through the bus 1204.
[0103] The processor 1201 may include a general-purpose processor and / or a dedicated hardware chip. The general-purpose processor may include: a central processing unit (CPU), a microprocessor, or a graphics processing unit (GPU). The CPU is, for example, a single-core processor (single-CPU), or a multi-core processor (multi-CPU). The dedicated hardware chip is a high-performance processing hardware module. The dedicated hardware chip includes at least one of a digital signal processor, an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or a network processor (NP). The processor 1201 may also be an integrated circuit chip with signal processing capabilities. In the implementation process, part or all of the functions of the data access method of this application may be completed by the integrated logic circuit in the hardware of the processor 1201 or instructions in software form.
[0104] The memory 1202 is used to store computer programs, which include an operating system 1202a and executable code (i.e., program instructions) 1202b. The memory 1202 is, for example, a read-only memory or other types of static storage devices that can store static information and instructions, or a random access memory or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory, a read-only optical disc or other optical disc storage, optical disc storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store the desired executable code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. For example, the memory 1202 is used to store the outbound port queue, etc. The memory 1202 is, for example, independent and connected to the processor 1201 through a bus 1204. Or the memory 1202 and the processor 1201 are integrated together. The memory 1202 can store executable code. When the executable code stored in the memory 1202 is executed by the processor 1201, the processor 1201 is used to execute part or all of the functions of the data access method provided in the embodiments of this application. For the implementation manner of the processor 1201 to execute this process, please refer to the relevant descriptions in the foregoing embodiments accordingly. The memory 1202 may also include software modules and data required for other running processes such as an operating system.
[0105] Communication port 1203 uses a transceiver module such as, but not limited to, a transceiver to implement communication with other devices or communication networks. For example, communication port 1203 can be any one or any combination of the following devices: a network interface (such as an Ethernet interface), a wireless network card, or other devices with network access functions.
[0106] Bus 1204 is of any type and is used to implement the interconnection of internal components of a computing device (such as memory 1202, processor 1201, and communication port 1203), such as a system bus. In the embodiments of this application, the above components inside the computing device are interconnected through bus 1204 as an example. Optionally, the above components inside computing device 1200 can also communicate with each other using other connection methods in addition to bus 1204. For example, the above components inside computing device 1200 are interconnected through an internal logic interface.
[0107] It should be noted that the above-mentioned multiple components can be separately provided on independent chips, or at least partially or entirely provided on the same chip. Whether to separately provide each component on different chips or integrate them on one or more chips often depends on the needs of product design. The embodiments of this application do not limit the specific implementation forms of the above components. Moreover, the descriptions of the processes corresponding to the above respective drawings have different focuses. For parts not detailed in a certain process, reference can be made to the relevant descriptions of other processes.
[0108] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product providing the program development platform includes one or more computer instructions. When these computer program instructions are loaded and executed on a computing device, the functions of the data access method provided by the embodiments of this application are implemented in whole or in part.
[0109] Moreover, the computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center in a wired manner (such as coaxial cable, optical fiber, digital subscriber line) or a wireless manner (such as infrared, wireless, microwave, etc.). The computer-readable storage medium stores the computer program instructions providing the program development platform.
[0110] The embodiments of the present application also provide a computing device cluster. The computing device cluster includes at least one computing device. The computing device can be a server, such as a central server, an edge server, or a local server in a local data center. In some embodiments, the computing device can also be a terminal device such as a desktop computer, a laptop computer, or a smart phone.
[0111] Optionally, for the structure of at least one computing device included in the computing device cluster, reference can be made to Figure 12 the computing device 1200 shown. Instructions for executing a data access method can be stored in the memories 1202 of one or more of the computing devices 1200 in the computing device cluster.
[0112] In some possible implementation manners, partial instructions for executing a data access method can also be separately stored in the memories 1202 of one or more of the computing devices 1200 in the computing device cluster. In other words, a combination of one or more computing devices 1200 can jointly execute the instructions for executing a data access method.
[0113] It should be noted that different memories 1202 in different computing devices 1200 in the computing device cluster can store different instructions, which are respectively used to execute partial functions of a data access device.
[0114] In some possible implementation manners, one or more computing devices in the computing device cluster can be connected through a network. Among them, the network can be a wide area network or a local area network, etc. Figure 13 A possible implementation manner is shown. As Figure 13 shown, two computing devices 1300A and 1300B are connected through a network. Specifically, they are connected to the network through communication ports in each computing device. In this type of possible implementation manners, the computing devices 1300A and 1300B include a bus 1302, a processor 1304, a memory 1306, and a communication port 1308. Instructions for executing the functions of a first computing node are stored in the memory 1306 of the computing device 1300A. At the same time, instructions for executing the functions of a second computing node are stored in the memory 1306 of the computing device 1300B.
[0115] It should be understood that Figure 13 the functions of the computing device 1300A shown in
[0116] An embodiment of the present application further provides a computer-readable storage medium, which is a non-volatile computer-readable storage medium. The computer-readable storage medium includes program instructions. When the program instructions run on a computing device, the computing device is enabled to implement the data access method provided by the embodiment of the present application.
[0117] An embodiment of the present application further provides a computer program product containing instructions. When the computer program product runs on a computer, the computer is enabled to implement the data access method provided by the embodiment of the present application.
[0118] Those of ordinary skill in the art can understand that all or part of the steps of implementing the above embodiments can be completed by hardware or by a program instructing relevant hardware. The program can be stored in a computer-readable storage medium. The storage medium mentioned above can be a read-only memory, a magnetic disk, an optical disk, etc.
[0119] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data for analysis, stored data, displayed data, etc.) and signals involved in the present application are all authorized by the user or fully authorized by all parties. The collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions. For example, the original data and executable code involved in the present application are obtained under full authorization.
[0120] In the embodiments of the present application, the terms "first", "second" and "third" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. The term "at least one" means one or more, and the term "multiple" means two or more, unless otherwise clearly defined.
[0121] The term "and / or" in the present application 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 represent: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " in this article generally represents an "or" relationship between the associated objects before and after.
[0122] The above are only optional embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the concept and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A data access method, characterized in that, The method is applied to a first computing node, which includes an address management unit. The first computing node shares a virtual address space with a second computing node. The method includes: The address management unit receives an access request, which indicates accessing a target virtual address; Based on the target virtual address, the address management unit queries the correspondence between the virtual address and the data acquisition address, and obtains a target data acquisition address corresponding to the target virtual address. The target data acquisition address includes identification information of the second computing node; Based on the target data acquisition address, the address management unit acquires the data indicated by the target virtual address from the second computing node.
2. The method according to claim 1, wherein Based on the target virtual address, the address management unit queries the correspondence between the virtual address and the data acquisition address, and obtains a target data acquisition address corresponding to the target virtual address, including: Based on the target virtual address, the address management unit queries a page table and obtains the target data acquisition address. The page table includes multiple page table entries, and the page table entry corresponding to the target virtual address records the target data acquisition address.
3. The method according to claim 2, wherein The descriptor of the page table entry records the target data acquisition address.
4. The method according to any one of claims 1 to 3, characterized in that Before the address management unit acquires the data indicated by the target virtual address from the second computing node based on the target data acquisition address, the method further includes: The address management unit acquires target attribute information corresponding to the target virtual address, and the target attribute information indicates the computing node indicated by the target data acquisition address; Based on the target attribute information, the address management unit determines that the target data acquisition address indicates the second computing node.
5. The method according to claim 4, wherein The address management unit acquires target attribute information corresponding to the target virtual address, including: Based on the target virtual address, the address management unit queries a page table and obtains the target attribute information. The page table includes multiple page table entries, and the page table entry corresponding to the target virtual address records the target attribute information.
6. The method according to claim 5, characterized in that, The descriptor of the page table entry records the target attribute information.
7. The method according to any one of claims 1 to 3, characterized in that, Before the address management unit acquires the data indicated by the target virtual address from the second computing node based on the target data acquisition address, the method further includes: When the target data acquisition address belongs to a preset address range, the address management unit determines that the target data acquisition address indicates the second computing node.
8. The method according to any one of claims 1 to 7, characterized in that The first computing node includes multiple communication ports, and the target data acquisition address further includes identification information of a target communication port, and the target communication port is one of the multiple communication ports.
9. The method according to claim 8, wherein Based on the target data acquisition address, the address management unit acquires the data indicated by the target virtual address from the second computing node, including: Based on the identification information of the target communication port, the address management unit sends a first data acquisition request, which indicates acquiring the data indicated by the target virtual address from the second computing node; The method further includes: The target communication port sends a second data acquisition request based on the identification information of the second computing node, and the second data acquisition request instructs the second computing node to provide the data indicated by the target virtual address.
10. The method according to claim 9, characterized in that, The first data acquisition request and the second data acquisition request also indicate that the target virtual address belongs to a specified application.
11. A data access device, characterized in that, The apparatus is applied to a first computing node, and the first computing node shares a virtual address space with a second computing node. The apparatus includes: a receiving module, configured to receive an access request, where the access request indicates an access to a target virtual address; a query module, configured to query a correspondence between the virtual address and a data acquisition address based on the target virtual address, to obtain a target data acquisition address corresponding to the target virtual address, where the target data acquisition address includes the identification information of the second computing node; an acquisition module, configured to acquire the data indicated by the target virtual address from the second computing node based on the target data acquisition address.
12. The device according to claim 11, characterized in that, The query module is specifically configured to: query a page table based on the target virtual address to obtain the target data acquisition address, where the page table includes a plurality of page table entries, and the page table entry corresponding to the target virtual address records the target data acquisition address.
13. The device according to claim 12, characterized in that, The descriptor of the page table entry records the target data acquisition address.
14. The device according to any one of claims 11 to 13, characterized in that, The query module is further configured to: acquire target attribute information corresponding to the target virtual address, where the target attribute information indicates the computing node indicated by the target data acquisition address; determine, based on the target attribute information, that the target data acquisition address indicates the second computing node.
15. The device according to claim 14, characterized in that, The query module is specifically configured to: query a page table based on the target virtual address to obtain the target attribute information, where the page table includes a plurality of page table entries, and the page table entry corresponding to the target virtual address records the target attribute information.
16. The device according to claim 15, characterized in that, The descriptor of the page table entry records the target attribute information.
17. The device according to any one of claims 11 to 13, characterized in that The query module is further configured to: when the target data acquisition address belongs to a preset address range, determine that the target data acquisition address indicates the second computing node.
18. The device according to any one of claims 11 to 17, characterized in that The first computing node includes a plurality of communication ports, and the target data acquisition address further includes the identification information of a target communication port, where the target communication port is one of the plurality of communication ports.
19. The apparatus according to claim 18, wherein: The acquisition module is specifically configured to: send a first data acquisition request based on the identification information of the target communication port, where the first data acquisition request instructs to acquire the data indicated by the target virtual address from the second computing node; The apparatus further includes: a sending module, configured to send a second data acquisition request based on the identification information of the second computing node, where the second data acquisition request instructs the second computing node to provide the data indicated by the target virtual address.
20. The device according to claim 19, characterized in that, The first data acquisition request and the second data acquisition request also indicate that the target virtual address belongs to a specified application.
21. A cluster of computing devices, characterized in that, Comprising a plurality of computing devices, the plurality of computing devices including a plurality of processors and a plurality of memories, program instructions being stored in the plurality of memories, the plurality of processors running the program instructions such that the computing device cluster executes the method according to any one of claims 1 to 10.
22. A computer-readable storage medium, characterized in that, Comprising program instructions which, when run on a computing device, cause the computing device to execute the method according to any one of claims 1 to 10.
23. A computer program product comprising instructions, characterized in that, When the instructions are run by a computing device cluster, cause the computing device cluster to execute the method according to any one of claims 1 to 10.