Physical memory expansion architecture and method for server, and server, device and medium
By connecting multiple expansion devices to expand the physical memory space of the server, the problem of constrained physical address space of a single server is solved, and super-large application running without changing the application architecture is achieved, improving server performance and simplifying program deployment.
Patent Information
- Application Number
- PCT/CN2024/135774
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-12-29
- Filing Date
- 2024-11-29
- Publication Date
- 2025-07-03
AI Technical Summary
The physical address space of a single server is limited and cannot run super-large applications efficiently. The existing technology requires changes to the application architecture or distributed deployment on multiple servers.
By connecting multiple expansion devices to the physical memory space of the expansion server, using the central processor and expansion port to connect to the expansion device, to achieve a larger range of physical memory access, the application can run in a larger range of physical memory space.
Without changing the application architecture or distributed deployment, a single server can run super-large applications efficiently, improving server performance and simplifying program deployment.
Smart Images

Figure CN2024135774_03072025_PF_FP_ABST
Abstract
Description
Physical memory expansion architecture of server, server, method, device and medium
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application claims priority to the Chinese patent application filed with the China Patent Office on December 29, 2023, with application number 202311865605.2, and entitled “Physical memory expansion architecture, server, method, device and medium for server”, all contents of which are incorporated by reference into this application. Technical Field
[0003] The present application relates to the field of memory management, and in particular to a physical memory expansion architecture, server, method, device and medium of a server. Background Art
[0004] In early computer devices, programs ran directly on physical memory. Specifically, the addresses accessed by the program during execution were all physical addresses. This method is simple to implement, but is not suitable for complex systems, especially multi-tasking operating systems.
[0005] When running programs using physical memory as described above, insufficient physical memory is a major problem. If a program requires 64K of memory, but the machine only has 32K of physical memory, the program will not run. Secondly, the physical address where the program runs is uncertain. The same program may be loaded into physical memory at a different physical address each time, making it difficult to debug and optimize the program. In addition, low physical memory usage is also a problem. To run a program, the entire program must be loaded into physical memory before it can run, but only part of the program may be needed during actual execution. Finally, in a multi-tasking OS, the problem of non-isolation of address spaces between processes is also very serious. If one task fails, it may affect other tasks, leading to the crash of the entire system.
[0006] To address these issues, virtual memory management technology was introduced. Virtual memory management combines physical memory and disk storage into a unified address space. Programs can access memory as if they were running directly in physical memory, but they are actually accessing virtual addresses. The operating system uses a virtual memory management unit (MMU) to translate virtual addresses into physical addresses, thereby implementing memory management and protection. While virtual memory management technology addresses many of the drawbacks of running programs directly in physical memory, it also introduces some new problems. For example, existing CPUs (Central Processing Units) are typically 64-bit, meaning that virtual addresses range from 0 to 0xFFFFFFFFFFFFFFFF. However, the range of physical addresses is limited by the specific hardware. The physical address space of a single server typically ranges from tens of GB to several TB, far smaller than the virtual address space. This means that a single server cannot efficiently run extremely large applications (e.g., those requiring tens or hundreds of TB of memory). Developers are forced to restructure their programs and distribute them across multiple servers, further complicating the application framework. Summary of the Invention
[0007] The purpose of this application is to provide a server physical memory expansion architecture, server, method, device and medium, which expand the physical memory space of the server by connecting multiple expansion devices. In this way, even if the physical address space of a single server is limited, a larger range of physical memory space can be achieved by connecting multiple expansion devices. Applications can run in a larger range of physical memory space without changing the application architecture or distributing it on multiple servers, thereby solving the problem that a single server cannot efficiently run very large applications.
[0008] To solve the above technical problems, the present application provides a physical memory expansion architecture for a server, including a local physical memory provided in the server and a central processing unit connected to the local physical memory, the central processing unit including an expansion port, and the physical memory expansion architecture including:
[0009] a first expansion device connected to the expansion port of the central processing unit, the first expansion device comprising a first physical memory, and the first physical memory is configured with a first physical address;
[0010] At least one level of i-th expansion device, the i-th expansion device is connected to the i-1-th expansion device, the i-th expansion device includes an i-th physical memory, and the i-th physical memory is configured with an i-th physical address, where i≥2 and i is an integer;
[0011] The central processing unit is used to determine the target physical address according to the target virtual address when receiving the data processing instruction of the target virtual address, and perform the target operation on the data in the target physical address, where the target physical address is any address from the local physical address to the first physical address to the i-th physical address.
[0012] In some embodiments, the first expansion device further includes at least two device ports, wherein the first device port is connected to the first physical memory corresponding to the first device port, and the second device port is connected to the second expansion device.
[0013] In some embodiments, the first expansion device further includes a first network module, and the i-th expansion device further includes an i-th network module;
[0014] The first network module is connected to the second device port, one end of the i-th network module is connected to the i-th physical memory, and the other end of the i-th network module is connected to an i-1-th network module or at least one i+1-th network module.
[0015] In some embodiments, the first network module and / or the i-th network module is a remote direct address access network module.
[0016] In some embodiments, the central processing unit further includes a controller, and the controller is connected to the first expansion device via an expansion port;
[0017] The controller is used to obtain the target physical address in real time, intercept the data processing instruction when the target physical address is the first physical address or the i-th physical address, and forward the data processing instruction to the first expansion device through the expansion port.
[0018] In some embodiments, the first expansion device is used to, after receiving a data processing instruction, perform a target operation on the data in the target physical address if the target physical address is an address in the first physical address; and forward the data processing instruction to the second expansion device if the target physical address is not an address in the first physical address.
[0019] To solve the above technical problems, the present application also provides a server, including a local physical memory provided in the server and a central processing unit connected to the local physical memory, the central processing unit including an expansion port, and also including the physical memory expansion architecture of the above-mentioned server, the physical memory expansion architecture being connected to the expansion port.
[0020] To solve the above technical problems, the present application further provides a server physical memory expansion method, which is applied to the above server physical memory expansion architecture. The physical memory expansion method includes:
[0021] After the operating system of the server is started, obtaining the first physical memory of the first expansion device and the i-th physical memory of the i-th expansion device;
[0022] Allocate a first physical address to the first expansion device and an i-th physical address to the i-th expansion device according to the first physical memory and the i-th physical memory;
[0023] When a data processing instruction of a target virtual address is received, a target physical address is determined according to the target virtual address, and a target operation is performed on the data in the target physical address, where the target physical address is any address from the local physical address to the first physical address to the i-th physical address.
[0024] In some embodiments, upon receiving a data processing instruction for a target virtual address, determining a target physical address based on the target virtual address and performing a target operation on data at the target physical address include:
[0025] When receiving a data processing instruction for a target virtual address, determining a target physical address based on the target virtual address;
[0026] Determine whether the target physical address is a local physical address;
[0027] If it is a local physical address, the target operation is performed directly on the data in the target physical address;
[0028] If it is not a local physical address, the data processing instruction is forwarded to the first expansion device through the expansion port to trigger the first expansion device to perform a target operation on the data in the target physical address according to the data processing instruction.
[0029] In some embodiments, the central processing unit further includes a controller connected to a first expansion device via an expansion port; after allocating a first physical address to the first expansion device and an i-th physical address to the i-th expansion device based on the first physical memory and the i-th physical memory, the physical memory expansion method further includes:
[0030] Configuring the controller to obtain a target physical address in real time, intercepting a data processing instruction when the target physical address is the first physical address or the i-th physical address, and forwarding the data processing instruction to the first expansion device through the expansion port;
[0031] Forwarding the data processing instruction to the first expansion device through the expansion port to trigger the first expansion device to perform a target operation on the data in the target physical address according to the data processing instruction, including:
[0032] When the controller determines that the target physical address is the first physical address or the i-th physical address, it intercepts the data processing instruction and forwards the data processing instruction to the first expansion device through the expansion port to trigger the first expansion device to perform the target operation on the data in the target physical address according to the data processing instruction.
[0033] In some embodiments, the first expansion device further includes at least two device ports, wherein the first device port is connected to a first physical memory corresponding to the first device port, and the second device port is connected to a second expansion device. The physical memory expansion method further includes:
[0034] A first correspondence between physical addresses and device ports is generated and written into the first expansion device. The first correspondence includes a correspondence between the physical address of the server and the physical address of the physical memory connected to each device port.
[0035] In some embodiments, triggering the first expansion device to perform a target operation on data at a target physical address according to a data processing instruction includes:
[0036] triggering the first expansion device to determine a target physical address according to the data processing instruction;
[0037] Determine, according to the target physical address and the first corresponding relationship, a target device port corresponding to the target physical address and an actual target physical address in a physical memory connected to the target device port;
[0038] The data processing instruction is issued through the target device port to perform the target operation on the data in the actual target physical address.
[0039] In some embodiments, issuing a data processing instruction through a target device port to perform a target operation on data at an actual target physical address includes:
[0040] When the target device port is the first device port, the data processing instruction is sent through the first device port to directly perform the target operation on the data in the actual target physical address;
[0041] When the target device port is the second device port, the data processing instruction is sent through the second device port to trigger the second expansion device to perform a target operation on the data in the actual target physical address according to the data processing instruction.
[0042] In some embodiments, the first expansion device further includes a first network module, and the i-th expansion device further includes an i-th network module; the first network module is connected to the second device port, one end of the i-th network module is connected to the i-th physical memory, and the other end of the i-th network module is connected to an i-1-th network module or at least one i+1-th network module;
[0043] A second correspondence between the device port and at least one second expansion device is generated and written into the first expansion device. The second correspondence includes a correspondence between a physical address of a physical memory connected to the device port, a second physical address corresponding to each second expansion device, and a network address of a second network module corresponding to each second expansion device.
[0044] In some embodiments, when it is determined that the target device port is the second device port, a data processing instruction is issued through the second device port, triggering the second expansion device to perform a target operation on the data in the actual target physical address according to the data processing instruction, including:
[0045] When the target device port is the second device port, determining the target physical address according to the data processing instruction;
[0046] Determine, according to the target physical address and the second corresponding relationship, the target network address of the second network module of the target and the actual target physical address corresponding to the target physical address in the second physical memory connected to the second network module of the target;
[0047] sending the data processing instruction to the first network module through the second device port;
[0048] The first network module is triggered to forward the data processing instruction to the second network module of the target according to the target network address, so as to trigger the second expansion device to perform the target operation on the data in the actual target physical address.
[0049] In some embodiments, when the first network module and the i-th network module are remote direct address access network modules, after sending the data processing instruction to the first network module through the second device port, the physical memory expansion method further includes:
[0050] The first expansion device is triggered to perform a target operation on the data in the actual target physical address through the first network module and the second network module of the target according to the actual target physical address and the target network address.
[0051] In some embodiments, before allocating a first physical address to the first expansion device and an i-th physical address to the i-th expansion device according to the first physical memory and the i-th physical memory, the method further includes:
[0052] Obtain the occupation status of physical addresses in the operating system, and determine the unoccupied physical addresses based on the occupation status;
[0053] Allocating a first physical address to a first expansion device and an i-th physical address to an i-th expansion device according to the first physical memory and the i-th physical memory includes:
[0054] A first physical address is allocated to the first expansion device and an i-th physical address is allocated to the i-th expansion device from unoccupied physical addresses according to the first physical memory and the i-th physical memory.
[0055] In some embodiments, obtaining a first physical memory of a first expansion device and an i-th physical memory of an i-th expansion device includes:
[0056] Obtaining first physical memory initialization information of a first expansion device and i-th physical memory initialization information of an i-th expansion device;
[0057] After the server is started, each expansion device is scanned to obtain the first physical memory actual information and the i-th physical memory actual information;
[0058] The first physical memory is determined according to the first physical memory actual information and the first physical memory initialization information, and the ith physical memory is determined according to the ith physical memory actual information and the ith physical memory initialization information.
[0059] To solve the above technical problems, the present application further provides an electronic device, comprising:
[0060] Memory for storing computer programs;
[0061] The processor is used to implement the steps of the above-mentioned method for expanding the physical memory of the server when executing a computer program.
[0062] To solve the above technical problems, the present application also provides a computer non-volatile readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned server physical memory expansion method are implemented.
[0063] The present application provides a physical memory expansion architecture, server, method, device and medium for a server, which relates to the field of memory management and is used to solve the problem that the physical address space of a single server is limited and cannot efficiently run very large applications. The solution includes a first expansion device connected to the expansion port of the central processing unit and at least one i-th expansion device, each expansion device includes physical memory and is provided with a physical address. The present application expands the physical memory space of the server by connecting multiple expansion devices. In this way, even if the physical address space of a single server is limited, a larger range of physical memory space can be achieved by connecting multiple expansion devices. The application can run in a larger range of physical memory space without changing the application architecture or distributing it on multiple servers, thereby solving the problem that a single server cannot efficiently run very large applications. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the prior art and the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0065] FIG1 is a schematic diagram of an existing system that uses only physical addresses;
[0066] FIG2 is a schematic diagram of an existing system using virtual address management;
[0067] FIG3 is a schematic diagram of a physical memory expansion architecture of a server provided by the present application;
[0068] FIG4 is a schematic diagram of a memory management unit address translation process provided by the present application;
[0069] FIG5 is a flowchart of a program for handling page fault exceptions provided by the present application;
[0070] FIG6 is a schematic diagram of a server provided by the present application;
[0071] FIG7 is a flow chart of a method for expanding the physical memory of a server provided by the present application;
[0072] FIG8 is a schematic diagram of a physical memory expansion architecture provided by the present application;
[0073] FIG9 is a schematic diagram of a query table for accessing a physical address provided by the present application;
[0074] FIG10 is a block diagram of an electronic device provided by the present application;
[0075] FIG11 is a schematic diagram of a computer non-volatile readable storage medium provided in this application. DETAILED DESCRIPTION
[0076] The core of this application is to provide a server physical memory expansion architecture, server, method, device and medium, which expands the physical memory space of the server by connecting multiple expansion devices. In this way, even if the physical address space of a single server is limited, a larger range of physical memory space can be achieved by connecting multiple expansion devices. Applications can run in a larger range of physical memory space without changing the application architecture or distributing it on multiple servers, thereby solving the problem that a single server cannot efficiently run very large applications.
[0077] To make the purpose, technical solutions, and advantages of the embodiments of this application more clear, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0078] In early computers or modern embedded devices using 8-bit or 16-bit microcontrollers, programs ran directly in physical memory. Running directly in physical memory means that all addresses accessed by the program during execution are physical addresses. For example, the value in the program counter register is the address in physical memory where the prefetch instruction is located. This method of running programs directly in physical memory is simple to implement, but it is not suitable for complex systems, especially multi-tasking operating systems. As shown in Figure 1, in early systems that did not use virtual memory management (VM) technology, the address issued by the processor core was sent directly to the external address bus, and then the physical memory (local physical memory connected to the CPU, currently generally DDR) at the corresponding address was read or written.
[0079] As shown in Figure 2, when virtual memory management is used, virtual addresses are not sent directly to the external address bus, but to the MMU (Memory Management Unit), which consists of one or a group of components and whose function is to map virtual addresses to physical addresses. In the solution shown in Figure 2, with limited local physical memory, a single server cannot run large applications.
[0080] To solve the above technical problems, as shown in FIG3 , the present application provides a physical memory expansion architecture for a server, including a local physical memory provided in the server and a central processing unit connected to the local physical memory, the central processing unit including an expansion port, and the physical memory expansion architecture including:
[0081] a first expansion device connected to the expansion port of the central processing unit, the first expansion device comprising a first physical memory, and the first physical memory is configured with a first physical address;
[0082] At least one level of i-th expansion device, the i-th expansion device is connected to the i-1-th expansion device, the i-th expansion device includes an i-th physical memory, and the i-th physical memory is configured with an i-th physical address, where i≥2 and i is an integer;
[0083] The central processing unit is used to determine the target physical address according to the target virtual address when receiving the data processing instruction of the target virtual address, and perform the target operation on the data in the target physical address, where the target physical address is any address from the local physical address to the first physical address to the i-th physical address.
[0084] Specifically, the present application enables the server to access additional physical memory beyond the range of its local physical memory by connecting multiple expansion devices, and can perform data processing operations on these expansion devices. Specifically, this embodiment describes a physical memory expansion architecture that includes at least two levels of expansion devices, each expansion device is connected to a portion of additional physical memory and is configured with a corresponding physical address; wherein the first-level expansion device is the first expansion device, the second expansion device connected to the first expansion device is the second-level expansion device, and so on, the i-th expansion device is the i-th-level expansion device, that is, the expansion devices in the present application are arranged in a multi-level manner. The central processing unit is directly or indirectly connected to these expansion devices through the expansion port. When receiving the data processing instruction of the target virtual address, it determines the target physical address according to the target virtual address and performs the target operation on the data in the target physical address; this means that the central processing unit can freely access and operate data in the local physical memory and the multiple connected expansion devices, thereby realizing the physical memory expansion of the server. It should be understood that when more than one expansion device is included in each level, the expansion devices at the same level are only connected to the expansion devices at the previous level corresponding to themselves, and the expansion devices at the same level are not connected to each other.
[0085] In some embodiments, the central processing unit also includes a controller, which is connected to the first expansion device through an expansion port; the controller is used to obtain the target physical address in real time, intercept the data processing instruction when the target physical address is the first physical address or the i-th physical address, and forward the data processing instruction to the first expansion device through the expansion port.
[0086] Specifically, when a central processing unit (CPU) is connected to a first expansion device via a controller and an expansion port, the controller, as part of the CPU, is responsible for processing data processing instructions from an application and, when necessary, forwarding these data processing instructions to the first expansion device. These data processing instructions may involve operations such as reading and writing physical memory, and the controller, through its connection to the first expansion device, effectively manages and controls the physical memory expansion architecture. The controller may be a PCIe (Peripheral Component Interconnect Express) controller, and the expansion port may be a PCIe expansion port.
[0087] In some embodiments of the present application, the controller obtains the target physical address obtained by the central processing unit based on the target virtual address in real time, thereby implementing interception and forwarding operations on data processing instructions, which helps to optimize the expansion architecture of the server physical memory and improve the operating efficiency and performance of ultra-large applications.
[0088] In some embodiments, the first expansion device is configured to, after receiving a data processing instruction, perform a target operation on the data in the target physical address if the target physical address is an address in the first physical address; and forward the data processing instruction to the second expansion device if the target physical address is not an address in the first physical address. Specifically, when the target physical address is an address in the first physical address, the first expansion device can directly perform the required operation on the data in the target physical address without forwarding the data processing instruction to other expansion devices. On the other hand, when the target physical address is not an address in the first physical address, the first expansion device forwards the data processing instruction to the second expansion device. This approach enables flexible processing of data processing instructions, allowing different physical addresses to be processed by different expansion devices, thereby improving the overall efficiency and performance of the system.
[0089] Figures 4 and 5 illustrate how the CPU accesses the target physical address based on the target virtual address. Figure 4 specifically describes how the MMU uses a first-level page table to translate virtual addresses into physical addresses. The MMU uses the first few bits (i.e., the page number; the specific number depends on the vendor or processor implementation standard) of the virtual address (including the page number and page offset) issued by the processor core (i.e., the CPU core) as an index to search the page table. The page table entry found stores the starting address of the corresponding physical address page. This starting address is then combined with the page frame number and the page offset in the virtual address to form the physical address. As shown in Figure 5, page table maintenance and updating are key components of the MMU's operation. Each application (process) has its own page table, which is created by the operating system at program startup. However, at this point, there are no valid entries in the page table (initializing all entries during page table creation is a waste of time and memory). Only when an application actually accesses a specific address will the operating system's "page fault exception handler" create the relevant entry. The specific process is as follows: when the processor core (central processing unit) issues a data processing instruction and accesses a certain virtual address (such as the target virtual address), it determines whether there is a relevant table entry in the page table; if it is determined that there is a relevant table entry in the page table, the MMU converts the virtual address into a physical address and sends the data processing instruction to the external bus; if it is determined that there is no relevant table entry in the page table, it enters the page fault exception handler, creates a page table entry, and executes the same data processing instruction again.
[0090] In some embodiments, the first expansion device further includes at least two device ports, wherein the first device port is connected to the first physical memory corresponding to the first device port, and the second device port is connected to the second expansion device.
[0091] In some embodiments, the first expansion device is limited to include at least two device ports. Among them, the first device port is connected to the first physical memory corresponding to itself, and the second device port is connected to the second expansion device. This embodiment adds more expansion device ports to the physical memory expansion architecture, and these device ports can be connected to more expansion devices. In this way, the physical memory of the server can be further expanded to accommodate more memory capacity. This helps to solve the problem that the virtual address space of the existing central processing unit is much larger than the physical memory capacity, thereby improving the efficiency and performance of a single server running very large applications. Some embodiments of the present application can also help simplify the program architecture, because the program can run in a larger memory space without being distributed on multiple servers. This will help reduce the complexity of the program and simplify the development and maintenance process. In short, this embodiment provides greater scalability and flexibility for the physical memory expansion architecture of the server, which helps to improve the performance of the server and simplify the deployment of the program.
[0092] In some embodiments, the first expansion device further includes a first network module, and the i-th expansion device further includes an i-th network module; the first network module is connected to the second device port, one end of the i-th network module is connected to the i-th physical memory, and the other end of the i-th network module is connected to an i-1-th network module or at least one i+1-th network module.
[0093] In some embodiments, a first network module can be set in the first expansion device, and an i-th network module can be set in the i-th expansion device. The function of these network modules is to realize the connection between the first device port and the second device port, as well as the i-th network module. Specifically, through the above-mentioned connection relationship, the first network module can realize communication with the second device port, and the i-th network module can connect and communicate with the adjacent network module, and then realize communication with the adjacent physical memory. Such a design can effectively expand the physical memory of the server, so that the server can use multiple physical memories for data storage and processing. At the same time, through the connection of the network modules, data sharing and communication can be realized between these physical memories, further improving the performance and flexibility of the server.
[0094] In some embodiments, the first network module and / or the i-th network module is a remote direct address access network module. RDMA (Remote Direct Memory Access) network module) is a data center network technology that allows the memory of a computer system to directly access the memory of a remote computer system without involving the host central processing unit or operating system, thereby achieving efficient data transmission and low latency. In an embodiment of the present application, the first network module and the i-th network module can be RDMA network modules, which are connected to the device port and physical memory of the expansion device, thereby achieving the expansion of the server memory. By using the RDMA network module, the server can achieve high-performance, low-latency remote memory access, making the distributed deployment program framework simpler and more efficient.
[0095] To solve the above technical problems, as shown in FIG6 , the present application further provides a server comprising local physical memory disposed in the server and a central processing unit connected to the local physical memory, the central processing unit including an expansion port, and further comprising the aforementioned physical memory expansion architecture of the server, the physical memory expansion architecture being connected to the expansion port. The expansion port may be, but is not limited to, a PCIe port, i.e., the physical memory expansion architecture is plugged into a PCIe slot of the central processing unit to connect to the PCIe port.
[0096] To solve the above technical problems, as shown in FIG7 , the present application further provides a physical memory expansion method for a server, which is applied to the physical memory expansion architecture of the above server. The physical memory expansion method includes:
[0097] S11: After the operating system of the server is started, the first physical memory of the first expansion device and the i-th physical memory of the i-th expansion device are obtained.
[0098] This step is to obtain the physical memory information of all connected expansion devices, including their size and location, so as to assign corresponding physical addresses to these expansion devices. After this step, the operating system can manage the entire server's physical memory expansion architecture based on these allocated physical addresses, ensuring that all physical memory can be effectively utilized and accessed.
[0099] In some embodiments, obtaining the first physical memory of a first expansion device and the i-th physical memory of an i-th expansion device includes: obtaining initialization information for the first physical memory of the first expansion device and initialization information for the i-th physical memory of the i-th expansion device; after the server starts, scanning each expansion device to obtain actual information for the first physical memory and actual information for the i-th physical memory; determining the first physical memory based on the actual information for the first physical memory and the initialization information for the first physical memory, and determining the i-th physical memory based on the actual information for the i-th physical memory and the initialization information for the i-th physical memory. In this embodiment, initial memory configuration information for the expansion device must first be obtained. Secondly, after the server starts, actual memory information for the expansion device is proactively detected and obtained, rather than relying solely on initialization information. Finally, the first physical memory and the i-th physical memory are determined based on the actual memory information and the initial memory information. This step involves comparing the obtained actual memory information with the initial memory information to ultimately determine the physical memory to be used. In some embodiments, if the memory capacity corresponding to the actual memory information is greater than or equal to the memory capacity corresponding to the initialization information, the initialization information is determined to be correct, and that initialization information is used as the physical memory to be used when physical addresses are subsequently allocated.
[0100] S12: Allocate a first physical address to the first expansion device and an i-th physical address to the i-th expansion device according to the first physical memory and the i-th physical memory.
[0101] Specifically, this step involves the operating system identifying and initializing the first expansion device and the i-th expansion device after the server is started, and obtaining their physical memory information. This information may include the size and location of the memory. Then, based on this information, the operating system assigns a first physical address to the first expansion device and an i-th physical address to the i-th expansion device. This process may involve the operation of the memory management unit (MMU), which is responsible for managing the conversion between virtual addresses and physical addresses, as well as the allocation and mapping of memory. In this step, the operating system may configure the MMU to ensure that the physical addresses of the first expansion device and the i-th expansion device are correctly allocated and managed.
[0102] In some embodiments, before allocating a first physical address to the first expansion device and an i-th physical address to the i-th expansion device based on the first physical memory and the i-th physical memory, the method further includes: obtaining the physical address occupancy status in the operating system and determining unoccupied physical addresses based on the occupancy status; and allocating the first physical address to the first expansion device and an i-th physical address to the i-th expansion device based on the first physical memory and the i-th physical memory, including: allocating the first physical address to the first expansion device and an i-th physical address to the i-th expansion device from unoccupied physical addresses based on the first physical memory and the i-th physical memory. In this embodiment, by allocating the first physical address to the first expansion device and the i-th physical address to the i-th expansion device from unoccupied physical addresses, the method ensures that the first expansion device and the i-th expansion device can be smoothly added to the physical memory expansion architecture, and that unoccupied physical addresses can be effectively managed and utilized to support physical memory expansion of the server. In this way, the server will be able to run very large applications more efficiently without having to change the program architecture or distribute them across multiple servers.
[0103] S13: When receiving a data processing instruction of a target virtual address, determine a target physical address according to the target virtual address, and perform a target operation on the data in the target physical address, where the target physical address is any address from the local physical address to the first physical address to the i-th physical address.
[0104] In some embodiments, the central processing unit determines the target physical address corresponding to the target virtual address based on the received target virtual address and the mapping relationship in the physical memory expansion architecture. After determining the target physical address, the central processing unit can perform a specified operation on the data at the target physical address, which helps to achieve efficient management and operation of the server's physical memory expansion architecture. This design allows the server to expand the physical memory connected to the expansion device while ensuring the effective management and utilization of this expanded memory.
[0105] In some embodiments, when a data processing instruction for a target virtual address is received, a target physical address is determined based on the target virtual address, and a target operation is performed on the data in the target physical address, including: when a data processing instruction for a target virtual address is received, a target physical address is determined based on the target virtual address; a judgment is made as to whether the target physical address is a local physical address; if it is a local physical address, the target operation is directly performed on the data in the target physical address; if it is not a local physical address, the data processing instruction is forwarded to the first expansion device through the expansion port to trigger the first expansion device to perform the target operation on the data in the target physical address according to the data processing instruction.
[0106] In some embodiments, when a central processing unit receives a data processing instruction containing a target virtual address, it determines a target physical address based on the target virtual address. First, the central processing unit determines whether the target physical address is a local physical address. If it is a local physical address, the central processing unit can directly perform the target operation on the data at the target physical address. If the target physical address is not a local physical address, the central processing unit forwards the data processing instruction to the first expansion device via the expansion port. Through this forwarding, the central processing unit triggers the first expansion device to perform the target operation on the data at the target physical address. The first expansion device can use its own physical address allocation and access mechanism to process the target physical address.
[0107] In some embodiments, the central processing unit also includes a controller, which is connected to the first expansion device through an expansion port; after allocating a first physical address to the first expansion device and an i-th physical address to the i-th expansion device according to the first physical memory and the i-th physical memory, the physical memory expansion method also includes: configuring the controller so that the controller obtains the target physical address in real time, and when the target physical address is an address in the first physical address or the i-th physical address, intercepting the data processing instruction, and forwarding the data processing instruction to the first expansion device through the expansion port; forwarding the data processing instruction to the first expansion device through the expansion port to trigger the first expansion device to perform a target operation on the data in the target physical address according to the data processing instruction, including: when the controller determines that the target physical address is an address in the first physical address or the i-th physical address, intercepting the data processing instruction, and forwarding the data processing instruction to the first expansion device through the expansion port to trigger the first expansion device to perform a target operation on the data in the target physical address according to the data processing instruction.
[0108] In some embodiments, the controller is configured to obtain the target physical address obtained by the central processing unit based on the target virtual address in real time. In this way, the controller can access and operate the physical memory corresponding to the target virtual address. When the controller determines that the target physical address is the first physical address or the address in the i-th physical address, it will intercept the data processing instruction and forward it to the first expansion device through the expansion port, which can trigger the first expansion device to perform the target operation on the data in the target physical address. This ensures that when processing the data processing instruction of the virtual address, the physical memory in the expansion device can be effectively expanded and managed. In this way, the system can handle memory expansion more flexibly, thereby improving server performance and hardware resource utilization.
[0109] In some embodiments, the first expansion device also includes at least two device ports, wherein the first device port is connected to the first physical memory corresponding to itself, and the second device port is connected to the second expansion device. The physical memory expansion method also includes: generating a first correspondence between the physical address and the device port, and writing the first correspondence into the first expansion device, wherein the first correspondence includes the correspondence between the physical address of the server and the physical address of the physical memory connected to each device port.
[0110] Triggering the first expansion device to perform a target operation on data in a target physical address according to a data processing instruction includes: triggering the first expansion device to determine a target physical address according to the data processing instruction; determining a target device port corresponding to the target physical address and an actual target physical address in a physical memory connected to the target device port according to the target physical address and a first corresponding relationship; and sending the data processing instruction through the target device port to perform the target operation on the data in the actual target physical address.
[0111] In some embodiments, a correspondence table is created based on the physical address of the server and the physical address of the physical memory connected to each device port, and these correspondences are written into the first expansion device. In this way, a mapping relationship between the server physical address and the physical memory connected to each device port can be established, so that the first expansion device can determine the target device port and the actual target physical address based on the target physical address of the data processing instruction. Next, when the target operation needs to be performed, the first expansion device is triggered to perform the target operation on the data in the target physical address according to the data processing instruction. This process includes determining the target device port corresponding to the target physical address and the actual target physical address in the physical memory connected to the target device port based on the target physical address and the first correspondence. Then, the data processing instruction is issued through the target device port to perform the target operation on the data in the actual target physical address.
[0112] In some embodiments, a data processing instruction is issued through a target device port to perform a target operation on the data in the actual target physical address, including: when the target device port is a first device port, the data processing instruction is issued through the first device port to directly perform the target operation on the data in the actual target physical address; when the target device port is a second device port, the data processing instruction is issued through the second device port to trigger the second expansion device to perform the target operation on the data in the actual target physical address according to the data processing instruction.
[0113] In some embodiments, different processing methods are adopted for different target device ports to perform operations on the data in the actual target physical address. Specifically, when the target device port is a first device port, the data processing instruction will be sent directly through the first device port to perform the target operation on the data in the actual target physical address; and when the target device port is a second device port, the data processing instruction will be sent through the second device port to trigger the second expansion device to perform the operation on the data in the actual target physical address according to the data processing instruction. This design allows the system to dynamically select the sending path of the data processing instruction according to the different target device ports, thereby realizing flexible management and control of the expansion device. In this way, the physical memory of the server can be effectively expanded, and the expansion device can be effectively scheduled and controlled to meet different application scenarios and needs.
[0114] In some embodiments, the first expansion device further includes a first network module, and the i-th expansion device further includes an i-th network module; the first network module is connected to the second device port, one end of the i-th network module is connected to the i-th physical memory, and the other end of the i-th network module is connected to an i-1-th network module or at least one i+1-th network module; a second correspondence between the device port and at least one second expansion device is generated, and the second correspondence is written into the first expansion device, the second correspondence including the correspondence between the physical address of the physical memory connected to the device port, the second physical address corresponding to each second expansion device, and the network address of the second network module corresponding to each second expansion device.
[0115] In some embodiments, when it is determined that the target device port is a second device port, a data processing instruction is issued through the second device port, triggering the second expansion device to perform a target operation on the data in the actual target physical address according to the data processing instruction, including: when the target device port is the second device port, determining the target physical address according to the data processing instruction; determining the target network address of the target's second network module and the actual target physical address corresponding to the target physical address in the second physical memory connected to the target's second network module according to the target physical address and the second corresponding relationship; sending the data processing instruction to the first network module through the second device port; triggering the first network module to forward the data processing instruction to the target's second network module according to the target network address, so as to trigger the second expansion device to perform the target operation on the data in the actual target physical address.
[0116] In some embodiments, both the first expansion device and the (i)th expansion device include network modules, enabling networked communication between multiple expansion devices. Specifically, the first network module is connected to a second device port, one end of the (i)th network module is connected to the (i)th physical memory, and the other end of the (i)th network module is connected to an (i-1)th network module or at least one (i+1)th network module. In this embodiment, a second correspondence between the device port and at least one second expansion device is generated and written to the first expansion device. The second correspondence includes a correspondence between the physical address of the physical memory connected to the device port, the second physical address corresponding to each second expansion device, and the network address of the second network module corresponding to each second expansion device. Thus, when the target device port is determined to be a second device port, the target network address of the target second network module and the actual target physical address corresponding to the target physical address in the second physical memory connected to the target second network module can be determined based on the second correspondence. When the controller determines that the target physical address is an address in the first physical address or the (i)th physical address, it forwards the data processing instruction to the first expansion device via the expansion port. When the target device port is determined to be the second device port, the data processing instruction is sent to the first network module through the second device port, and the first network module is triggered to forward the data processing instruction to the target second network module according to the target network address, thereby triggering the second expansion device to perform the target operation on the data at the actual target physical address. In summary, some embodiments of the present application achieve collaborative work between expansion devices through the network communication of the network module and the correspondence between the device port and the physical memory, thereby improving the efficiency and reliability of physical memory expansion.
[0117] In some embodiments, when the first network module and the i-th network module are remote direct address access network modules, after sending the data processing instruction to the first network module through the second device port, the physical memory expansion method further includes:
[0118] The first expansion device is triggered to perform a target operation on the data in the actual target physical address through the first network module and the second network module of the target according to the actual target physical address and the target network address.
[0119] In some embodiments, the first network module and the i-th network module are remote direct address access network modules (also known as RDMA, which can directly access memory when transmitting data through the network without the intervention of the CPU, thereby having extremely low latency and high bandwidth.
[0120] In some embodiments, after a data processing instruction is sent to the first network module via the second device port, the physical memory expansion method triggers the first expansion device to directly perform the target operation on the data at the actual target physical address and the target network address via the first network module and the target's second network module. In other words, the data processing instruction directly accesses memory via the RDMA network module, making data transmission faster and more efficient.
[0121] As shown in Figure 8, a schematic diagram of a physical memory expansion architecture provided by the present application is shown. Taking the configuration in Figure 8 as an example, the local physical memory of the server host is 4G, and the server host is connected to a first expansion device (such as FPGA (Field-Programmable Gate Array)) through a PCIe slot. The first physical memory of the FPGA (that is, the local physical memory of the FPGA) is 2G. There are two second expansion devices connected to the first expansion device. The second expansion device can specifically be an FPGA board or other host. The first expansion device is connected to the second expansion device 1 and the second expansion device 2 through an RDMA network (such as an RDMA network card), so the server host has a total of 8G of accessible physical memory.
[0122] In order to present a virtual large memory to the central processing unit (CPU), it is necessary to add a "memory management unit 2" (equipped with a first correspondence table between the physical address of the server host and the physical address corresponding to the physical memory connected to the device port of the first expansion device), a "remote memory access module" (equipped with a second correspondence between the second physical address corresponding to each second expansion device and the network address of the second network module corresponding to each second expansion device) and an "RDMA network module" in the expansion device to assist the CPU in accessing the remote second physical memory.
[0123] Among them, in terms of hardware architecture, in addition to the original central processing unit and local physical memory, at least one expansion device (such as FPGA) needs to be inserted into the slot of the central processing unit (such as PCIe slot), and the processor core of the central processing unit can access the FPGA through the "external address bus PCIe controller". Inside the FPGA, due to the difference in performance between the first physical memory of the local first expansion device and the second physical memory of the remote second expansion device, different ports are set (different local buses can be used in the specific design) for separate access, in order to improve the access speed of the on-board memory. Specifically in Figure 8, port 0 corresponds to the first physical memory (2G in total), and port 1 corresponds to the remote second physical memory 1 and the second physical memory 2 (2G in total). Each remote first sub-expansion device consists of an RDMA network module and a remote second physical memory, and can also be replaced by other hosts carrying RDMA network cards, which is relatively simple to implement.
[0124] For the first physical memory of the first expansion device, the physical path for the central processor to access it is: processor core→memory management unit 1→PCIe controller→memory management unit 2→port 0→FPGA on-board memory.
[0125] For the second physical memory of the remote second expansion device, the physical path for the central processor to access it is: processor core → memory management unit 1 → PCIe controller → memory management unit 2 → port 1 → remote memory access module → RDMA network module → router → RDMA network module of the first sub-expansion device → memory of the first sub-expansion device.
[0126] The initialization process is as follows: (1) After the server's operating system is started, the local physical memory is accessible. Assume that its local physical address is 0 to 4G. (2) Initialization parameters are passed to the driver. The parameters include: the number of accessible expansion devices, the memory capacity of each expansion device (such as the first expansion device: 2G, the second expansion device 1: 1G, the second expansion device 2: 1G) and the RDMA network address of each second expansion device (such as the second expansion device 1: GID1, the second expansion device 2: GID2). (3) The driver starts running, scans the expansion devices, and finds that the available first physical memory is 2G. Then, through the parameters, it is known that the total of the two second physical memories is also 2G. Therefore, the total extended physical memory is calculated to be 4G. (4) The driver queries the system for the used physical addresses, and then allocates 4G of physical memory to the expansion device from the unused physical addresses. In Figure 8, it is assumed that it is 4G to 8G. (5) The driver configures the PCIe controller so that it can intercept data processing instructions from the CPU with addresses 4G to 8G and send them to the first expansion device. (6) The driver writes the first mapping relationship to the inside of the first expansion device (for example, the cache in the component corresponding to the first expansion device, which is not used as the extended memory of the host). The first mapping relationship includes two entries: Entries 1: The server host's physical address "4G to 6G" corresponds to port 0 (output address 0 to 2G). Entries 1: The server host's physical address "6G to 8G" corresponds to port 1 (output address 0 to 2G). The driver can then configure the address of this corresponding relationship to "memory management unit 2". (7) The driver writes the "second mapping relationship" to the inside of the expansion device, which includes two entries. Entries 1: Port 1's address "0 to 1G" corresponds to the second expansion device 1 with RDMA network address GID1; Entries 2: Port 1's address "1G to 2G" corresponds to the second expansion device 2 with RDMA network address GID2. The driver then configures the address of this table to the "remote memory access module". (8) The driver calls the interface provided by the operating system to notify the operating system that an additional 4G of physical memory is available and informs it of its physical address, which is equivalent to adding the extended memory to the system memory pool. Afterwards, the operating system can write the newly added address into the page table in the page fault exception handler and provide it to the application for access.
[0127] For the access process of extended physical memory, if it is the local sub-memory of the extended device. Assume that a page table has been created in the operating system's page fault exception handler, the virtual address is X, and the physical address is 0x100000000, which belongs to the address range of 4G to 6G. Taking the write operation as an example (the read operation is similar), when the program running in the CPU wants to write a value Y to the virtual address X, the hardware has the following processing flow. 1. The memory management unit 1 searches the system page table, obtains the physical address 0x100000000 corresponding to the virtual address X, and then sends the physical address and value Y to the system bus. 2. Since the physical address is in the range of 4G to 8G, the write signal (including the address and data Y) will be obtained by the PCIe controller and then sent to the first extended device. 3. Memory management unit 2 of the first expansion device receives the write signal (address 0x100000000, data Y), searches the first correspondence, converts the address to address 0 of port 0 (because the server host's physical addresses 4G to 6G correspond to port 0 to 2G, and 0x100000000 is the starting address of this range), and sends a write signal (address 0, data Y) from port 0. 4. Data Y is written to the first physical memory of the first expansion device.
[0128] If it is the second physical memory of the second expansion device of the remote device. Assume that a page table has been created in the page fault exception handler of the operating system, the virtual address is A, the physical address is 0x1C0000000 (that is, where 7G starts), and it belongs to the address range of 6G to 8G. Taking the write operation as an example (the read operation is similar), when the program running in the CPU wants to write a value B to the virtual address A, the hardware has the following processing flow. 1. The memory management unit 1 searches the system page table and obtains the physical address 0x1C0000000 corresponding to the virtual address A, and then sends the physical address and value B to the system bus. 2. Since the physical address belongs to the range of 4G to 8G, the write signal (including the address and data B) will be obtained by the PCIe controller and then sent to the first expansion device. 3. Memory Management Unit 2 of the first expansion device receives the write signal (address 0x1C0000000, data B), searches the first correspondence, converts the address to port 1's address 0x40000000 (i.e., where 1G begins, because the server host's physical addresses 6G to 8G correspond to port 1's 0 to 2G, and 0x1C0000000 is exactly in the middle of this range, i.e., port 1's 1G), and sends the write signal (address 0x40000000, data B) from port 1. 4. The "Remote Memory Access Module" of the first expansion device receives the write signal (address 0x40000000, data B), searches the second correspondence, and obtains the RDMA network address GID2 of the second expansion device 2, as well as the device's internal memory address 0 (because port 1's addresses 1G to 2G correspond to memory addresses 0 to 1G of the device with GID2). 5. The remote memory access module of the first expansion device initiates a standard RDMA Write operation to write data B to memory address 0 of the second physical memory.
[0129] Based on Figures 4 and 5, please refer to Figure 9 to describe the process of table lookup when accessing a physical address. Specifically, from the CPU executing the data processing instruction to access the target virtual address to accessing the actual target physical memory, if the target physical memory is located in the local memory of the first expansion device, that is, the first physical memory, two layers of page tables (i.e., the system page table and the table corresponding to the first correspondence mentioned in the above embodiment) are used in sequence; if the target physical memory is located in the remote second expansion device, three layers of page tables are used in sequence, that is, the table corresponding to the second correspondence mentioned in the above embodiment is added on top of the first two layers. In order to make the table lookup process clearer and allow the first expansion device to look up the table as quickly as possible, this application designs the table lookup process shown in Figure 9. When looking up the two layers of tables added by this application, two registers need to be used respectively, namely, the registers (1) and (2) where the table entry number is located. They respectively specify which bits of the physical address are used to look up the two layers of tables. The values of these two registers are configured by the driver while filling in the table. Compared to existing solutions that use fixed bits (i.e., the "page number" for the first-level table in Figures 4 and 9) for table lookups, this approach dynamically adjusts the bit width of the table entry number based on the size of the address range, and thus the number of table entries. By using only the bits that change across the entire address range (excluding the offset) as table indexes, the number of required indexes is reduced, which in turn reduces the number of table entries and, consequently, reduces the consumption of logical resources on the first expansion device.
[0130] The present application also provides an electronic device, as shown in FIG10 , comprising: a processor 1001, a communication interface 1002, a memory 1003, and a communication bus 1004, wherein the processor 1001, the communication interface 1002, and the memory 1003 communicate with each other via the communication bus 1004.
[0131] Memory 1003, used for storing computer programs;
[0132] Processor 1001 is configured to implement the steps of the above-mentioned method for expanding the physical memory of the server when executing a computer program.
[0133] For an introduction to the electronic device, please refer to the above embodiments, and this application will not go into details here.
[0134] As shown in FIG11 , in some embodiments of the present application, a computer non-volatile readable storage medium 1101 is further provided, on which a computer program 1102 is stored. When the computer program 1102 is executed by a processor, the steps of the above-mentioned method for expanding the physical memory of the server are implemented.
[0135] For an introduction to the computer non-volatile readable storage medium 1101 , please refer to the above embodiment, and this application will not go into details here.
[0136] It should also be noted that, in this specification, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus comprising the element.
[0137] The above description of the disclosed embodiments is intended to enable one skilled in the art to implement or use the present application. Various modifications to these embodiments will be readily apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application is not limited to the embodiments shown herein, but is intended to conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A physical memory expansion architecture for a server, characterized in that, Including a local physical memory provided in the server and a central processing unit connected to the local physical memory, the central processing unit includes an expansion port, the local physical memory is configured with a local physical address, and the physical memory expansion architecture includes: A first expansion device connected to the expansion port of the central processing unit, the first expansion device includes a first physical memory, and the first physical memory is configured with a first physical address; At least one level of the i-th expansion device, the i-th expansion device is connected to the (i - 1)-th expansion device, the i-th expansion device includes an i-th physical memory, and the i-th physical memory is configured with an i-th physical address, where i≥2 and i is an integer; The central processing unit is configured to, when receiving a data processing instruction for a target virtual address, determine a target physical address according to the target virtual address, and perform a target operation on the data in the target physical address, where the target physical address is any address among the local physical address, the first physical address to the i-th physical address.
2. The physical memory expansion architecture of the server according to claim 1, characterized in that, The first expansion device further includes at least two device ports, where a first device port is connected to the corresponding first physical memory of itself, and a second device port is connected to a second expansion device.
3. The physical memory expansion architecture of the server according to claim 2, characterized in that, The first expansion device further includes a first network module, and the i-th expansion device further includes an i-th network module; The first network module is connected to the second device port, one end of the i-th network module is connected to the i-th physical memory, and the other end of the i-th network module is connected to an (i - 1)-th network module or at least one (i + 1)-th network module.
4. The physical memory expansion architecture of the server according to claim 3, wherein The first network module and / or the i-th network module is a remote direct memory access network module.
5. The physical memory expansion architecture of the server according to any one of claims 1-4, characterized in that, The central processing unit further includes a controller, and the controller is connected to the first expansion device through the expansion port; The controller is configured to obtain the target physical address in real time. When the target physical address is an address among the first physical address or the i-th physical address, intercept the data processing instruction, and forward the data processing instruction to the first expansion device through the expansion port.
6. The physical memory expansion architecture of the server according to claim 5, characterized in that, The first expansion device is configured to, after receiving the data processing instruction, if the target physical address is an address among the first physical address, perform a target operation on the data in the target physical address; if the target physical address is not an address among the first physical address, forward the data processing instruction to the second expansion device.
7. A server, characterized in that, Including a local physical memory provided in the server and a central processing unit connected to the local physical memory, the central processing unit includes an expansion port, and further includes the physical memory expansion architecture of the server according to any one of claims 1-6, and the physical memory expansion architecture is connected to the expansion port.
8. A method for physically expanding the memory of a server, characterized in that, Applied to the physical memory expansion architecture of the server according to any one of claims 1-6, the physical memory expansion method includes: After the operating system of the server is started, obtain the first physical memory of the first expansion device and the i-th physical memory of the i-th expansion device; Allocate a first physical address for the first expansion device and an i-th physical address for the i-th expansion device according to the first physical memory and the i-th physical memory; When a data processing instruction with a target virtual address is received, determine a target physical address according to the target virtual address, and perform a target operation on the data in the target physical address, where the target physical address is any address among the local physical address, the first physical address to the i-th physical address.
9. The method for physically expanding the memory of the server according to claim 8, wherein, When a data processing instruction with a target virtual address is received, determine a target physical address according to the target virtual address, and perform a target operation on the data in the target physical address, including: When a data processing instruction with a target virtual address is received, determine a target physical address according to the target virtual address; Determine whether the target physical address is the local physical address; If it is the local physical address, directly perform the target operation on the data in the target physical address; If it is not the local physical address, forward the data processing instruction to the first expansion device through the expansion port to trigger the first expansion device to perform the target operation on the data in the target physical address according to the data processing instruction.
10. The physical memory expansion method of the server according to claim 9, wherein The central processing unit further includes a controller, and the controller is connected to the first expansion device through the expansion port; after allocating a first physical address for the first expansion device and an i-th physical address for the i-th expansion device according to the first physical memory and the i-th physical memory, the physical memory expansion method further includes: Configure the controller so that the controller can obtain the target physical address in real time. When the target physical address is an address among the first physical address or the i-th physical address, intercept the data processing instruction, and forward the data processing instruction to the first expansion device through the expansion port; Forward the data processing instruction to the first expansion device through the expansion port to trigger the first expansion device to perform the target operation on the data in the target physical address according to the data processing instruction, including: When the controller determines that the target physical address is an address among the first physical address or the i-th physical address, intercept the data processing instruction, and forward the data processing instruction to the first expansion device through the expansion port to trigger the first expansion device to perform the target operation on the data in the target physical address according to the data processing instruction.
11. The physical memory expansion method of the server according to claim 9, characterized in that, The first expansion device further includes at least two device ports, where the first device port is connected to the corresponding first physical memory of itself, and the second device port is connected to the second expansion device. The physical memory expansion method further includes: Generate a first correspondence between the physical address and the device port, and write the first correspondence into the first expansion device. The first correspondence includes the correspondence between the physical address of the server and the physical addresses of the physical memories connected to each device port.
12. The physical memory expansion method of the server according to claim 11, wherein Triggering the first expansion device to perform the target operation on the data in the target physical address according to the data processing instruction includes: Triggering the first expansion device to determine the target physical address according to the data processing instruction; Determining, according to the target physical address and the first correspondence relationship, the target device port corresponding to the target physical address and the actual target physical address in the physical memory connected to the target device port; Sending the data processing instruction through the target device port to perform the target operation on the data in the actual target physical address.
13. The physical memory expansion method of the server according to claim 12, wherein Sending the data processing instruction through the target device port to perform the target operation on the data in the actual target physical address includes: When the target device port is the first device port, sending the data processing instruction through the first device port to directly perform the target operation on the data in the actual target physical address; When the target device port is the second device port, sending the data processing instruction through the second device port to trigger the second expansion device to perform the target operation on the data in the actual target physical address according to the data processing instruction.
14. The method for physically expanding the memory of the server according to claim 13, characterized in that, The first expansion device further includes a first network module, and the i-th expansion device further includes an i-th network module; the first network module is connected to the second device port, one end of the i-th network module is connected to the i-th physical memory, and the other end of the i-th network module is connected to an (i - 1)-th network module or at least one (i + 1)-th network module; Generating a second correspondence relationship between the device port and at least one second expansion device, and writing the second correspondence relationship into the first expansion device, where the second correspondence relationship includes the correspondence relationship between the physical address of the physical memory connected to the device port, the second physical address corresponding to each second expansion device, and the network address of the second network module corresponding to each second expansion device.
15. The physical memory expansion method of the server according to claim 14, wherein When it is determined that the target device port is the second device port, sending the data processing instruction through the second device port to trigger the second expansion device to perform the target operation on the data in the actual target physical address according to the data processing instruction includes: When the target device port is the second device port, determining the target physical address according to the data processing instruction; Determining, according to the target physical address and the second correspondence relationship, the target network address of the target second network module and the actual target physical address corresponding to the target physical address in the second physical memory connected to the target second network module; Sending the data processing instruction through the second device port to the first network module; Triggering the first network module to forward the data processing instruction to the target second network module according to the target network address to trigger the second expansion device to perform the target operation on the data in the actual target physical address.
16. The physical memory expansion method of the server according to claim 14, characterized in that When the first network module and the i-th network module are remote direct memory access network modules, after sending the data processing instruction to the first network module through the second device port, the physical memory expansion method further includes: Triggering the first expansion device to perform a target operation on the data in the actual target physical address through the first network module and the target second network module according to the actual target physical address and the target network address.
17. The physical memory expansion method of the server according to any one of claims 8-16, characterized in that, Before allocating a first physical address for the first expansion device and an i-th physical address for the i-th expansion device according to the first physical memory and the i-th physical memory, it further includes: Obtaining the occupancy situation of physical addresses in the operating system, and determining the unoccupied physical addresses according to the occupancy situation; Allocating a first physical address for the first expansion device and an i-th physical address for the i-th expansion device according to the first physical memory and the i-th physical memory includes: Allocating a first physical address for the first expansion device and an i-th physical address for the i-th expansion device from the unoccupied physical addresses according to the first physical memory and the i-th physical memory.
18. The physical memory expansion method of the server according to any one of claims 8-16, characterized in that, Obtaining the first physical memory of the first expansion device and the i-th physical memory of the i-th expansion device includes: Obtaining the first physical memory initialization information of the first expansion device and the i-th physical memory initialization information of the i-th expansion device; After the server is started, scanning each expansion device to obtain the actual information of the first physical memory and the actual information of the i-th physical memory; Determining the first physical memory according to the actual information of the first physical memory and the first physical memory initialization information, and determining the i-th physical memory according to the actual information of the i-th physical memory and the i-th physical memory initialization information.
19. An electronic device, characterized in that, Including: A memory configured to store a computer program; A processor configured to, when executing the computer program, implement the steps of the physical memory expansion method of the server according to any one of claims 8-18.
20. A computer non-volatile readable storage medium, characterized in that, A computer program is stored on the computer non-volatile readable storage medium, and when the computer program is executed by a processor, the steps of the physical memory expansion method of the server according to any one of claims 8-18 are implemented.
Citation Information
Patent Citations
Memory space expansion method and device, electronic equipment and storage medium
CN113868155A
Method and device for expanding memory and related equipment
CN115794669A
Physical memory expansion architecture of server, server, method, equipment and medium
CN117827449A
Memory extending method
JP1994124233A