Physical memory expansion architecture for servers, servers, methods, devices, and media

By expanding the server's physical memory through connecting expansion devices and using the central processing unit and controller to intercept and forward data instructions, the problem of limited physical addresses of a single server is solved, achieving the effect of running ultra-large applications efficiently.

CN117827449BActive Publication Date: 2026-03-24INSPUR (BEIJING) ELECTRONICS INFORMATION IND CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-29
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

The physical address space of a single server is limited, making it impossible to run very large applications efficiently. Existing virtual memory management technologies also suffer from problems such as physical address uncertainty and low memory utilization.

Method used

The server's physical memory space is expanded by connecting multiple expansion devices. The central processing unit and the expansion devices are connected through expansion ports to achieve direct access and operation of the target physical address. The controller intercepts and forwards data processing instructions, and the network module is used to realize memory expansion and management.

Benefits of technology

It enables the expansion of server physical memory space without changing the application architecture or distributed deployment, improving the running efficiency and performance of ultra-large applications and simplifying the program framework.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117827449B_ABST
    Figure CN117827449B_ABST
Patent Text Reader

Abstract

The application discloses a physical memory expansion architecture of a server, a server, a method, equipment and a medium, relates to the field of memory management, and is used for solving the problem that a single server physical address space is limited and thus cannot efficiently run a super-large application program. The scheme comprises a first expansion device connected with an expansion port of the central processor and at least one level of an i-th expansion device, each expansion device comprises physical memory and is provided with a physical address. The 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 realized by connecting multiple expansion devices, and an application program can run in the larger range of physical memory space without changing the application program architecture or being distributed on multiple servers, so that the problem that a single server cannot efficiently run a super-large application program is solved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of memory management, and in particular to a physical memory expansion architecture of a server, a server, a method, a device and a medium. BACKGROUND

[0002] Early computer devices, programs are directly run on physical memory, specifically refers to the address accessed by the program when running are physical addresses; this way is simple to implement, but is not suitable for complex systems, especially with multi-task operating system.

[0003] The above physical memory is insufficient when running programs, which is a big problem. If a program needs to use 64K of memory, and there is only 32K of physical memory on the machine, it will cause the program to be unable to run. Secondly, the physical address of program running is uncertain, the same program may not be the same physical address each time it is loaded into the physical memory, which makes it difficult to debug and optimize the program. In addition, the low utilization rate of physical memory is also a problem, the entire program needs to be loaded into physical memory to run, but only part of the program may be used during actual running. Finally, in a multi-task OS, the address space between processes is not isolated, which is also a serious problem. If a task fails, it may affect other tasks, and even cause the entire system to crash.

[0004] In order to solve these problems, virtual memory management technology is introduced. Virtual memory management technology can combine physical memory and storage space on disk into a unified address space, and programs can access memory as if they are running directly on physical memory, but in fact they are accessing virtual addresses. The operating system converts virtual addresses to physical addresses through the virtual memory management unit (MMU, Memory Management Unit), thereby achieving memory management and protection. Virtual memory management technology solves many defects of directly running programs on physical memory, but also introduces some new problems. For example, existing CPUs (Central Processing Unit, Central Processing Unit) are generally 64-bit, which means the range of virtual addresses is 0-0xFFFFFFFFFFFFFFFF, but the range of physical addresses is limited by the specific hardware, and the physical address of a single server is generally in the range of several tens of GB to several TB, which is much smaller than the virtual address space. This means that a single server cannot efficiently run large-scale applications (such as applications that require tens / hundreds of TB of memory), and developers have to change the architecture of the program and distribute it across multiple servers, which makes the program framework more complex. SUMMARY

[0005] The purpose of this application is to provide a physical memory expansion architecture, server, method, device, and medium for a server. By connecting multiple expansion devices, the physical memory space of the server can be expanded. 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 them across multiple servers, thereby solving the problem that a single server cannot efficiently run very large applications.

[0006] To address the aforementioned technical problems, this application provides a physical memory expansion architecture for a server, including local physical memory located in the server and a central processing unit connected to the local physical memory. The central processing unit includes an expansion port. The physical memory expansion architecture includes:

[0007] A first expansion device connected to the expansion port of the central processing unit, the first expansion device including a first physical memory, and the first physical memory being configured with a first physical address;

[0008] 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 the i-th physical memory, and the i-th physical memory is configured with the i-th physical address, i ≥ 2 and i is an integer;

[0009] The central processing unit is configured to, upon receiving a data processing instruction for a target virtual address, determine a target physical address based on the target virtual address, and perform a target operation on the data in the target physical address, wherein the target physical address is any address among the local physical address, the first physical address, and the i-th physical address.

[0010] In one embodiment, 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 itself, and the second device port is connected to the second expansion device.

[0011] In one embodiment, the first extension device further includes a first network module, and the i-th extension device further includes an i-th network module;

[0012] 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 an i+1-th network module.

[0013] In one embodiment, the first network module and / or the i-th network module is a remote direct address access network module.

[0014] In one embodiment, the central processing unit further includes a controller, which is connected to the first expansion device via the expansion port;

[0015] The controller is configured to acquire the target physical address in real time, and when the target physical address is the first physical address or an address among the i-th physical addresses, intercept the data processing instruction and forward the data processing instruction to the first extended device through the extended port.

[0016] In one embodiment, the first extended device is configured to, upon receiving the 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 extended device if the target physical address is not an address in the first physical address.

[0017] To address the aforementioned technical problems, this application also provides a server, including local physical memory disposed in the server and a central processing unit connected to the local physical memory. The central processing unit includes an expansion port and also includes the physical memory expansion architecture of the server described above, wherein the physical memory expansion architecture is connected to the expansion port.

[0018] To address the aforementioned technical problems, this application also provides a method for expanding the physical memory of a server, applied to the physical memory expansion architecture of the server described above. The physical memory expansion method includes:

[0019] After the operating system of the server starts, the first physical memory of the first extended device and the i-th physical memory of the i-th extended device are obtained;

[0020] Assign a first physical address to the first extended device and an i-th physical address to the i-th extended device based on the first physical memory and the i-th physical memory;

[0021] Upon receiving a data processing instruction for a target virtual address, 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. The target physical address is any address among the local physical address, the first physical address, and the i-th physical address.

[0022] In one embodiment, upon receiving a data processing instruction for a target virtual address, 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:

[0023] Upon receiving a data processing instruction for a target virtual address, the target physical address is determined based on the target virtual address;

[0024] Determine whether the target physical address is a local physical address;

[0025] If it is the local physical address, then the target operation is performed directly on the data in the target physical address;

[0026] If it is not the local physical address, the data processing instruction is forwarded to the first extended device through the extended port to trigger the first extended device to perform the target operation on the data in the target physical address according to the data processing instruction.

[0027] In one embodiment, the central processing unit further includes a controller connected to the first expansion device via the 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:

[0028] Configure the controller to obtain the target physical address in real time, and when the target physical address is the first physical address or an address among the i-th physical addresses, intercept the data processing instruction and forward the data processing instruction to the first extended device through the extended port;

[0029] The data processing instruction is forwarded to the first extended device through the extended port to trigger the first extended device to perform the target operation on the data in the target physical address according to the data processing instruction, including:

[0030] When the controller determines that the target physical address is the first physical address or an address in the i-th physical address, it intercepts the data processing instruction and forwards the data processing instruction to the first extended device through the extended port, so as to trigger the first extended device to perform the target operation on the data in the target physical address according to the data processing instruction.

[0031] In one embodiment, 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 itself, and the second device port is connected to the second expansion device, and the physical memory expansion method further includes:

[0032] A first correspondence between physical addresses and device ports is generated, and the first correspondence is written into the first extended device. 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.

[0033] In one embodiment, triggering the first extended device to perform the target operation on data in the target physical address according to the data processing instruction includes:

[0034] The first extended device is triggered to determine the target physical address according to the data processing instruction;

[0035] Based on the target physical address and the first correspondence, determine 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;

[0036] The data processing instruction is sent through the target device port to perform the target operation on the data in the actual target physical address.

[0037] In one embodiment, 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, including:

[0038] 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;

[0039] 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 extended device to perform the target operation on the data in the actual target physical address according to the data processing instruction.

[0040] In one embodiment, 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 port of the second device, 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 an (i+1)-th network module;

[0041] A second correspondence is generated between the device port and at least one of the second extended devices, and the second correspondence is written into the first extended device. The second correspondence includes the physical address of the physical memory connected to the device port, the second physical address of each of the second extended devices, and the network address of the second network module of each of the second extended devices.

[0042] In one embodiment, when the target device port is determined to be the second device port, the data processing instruction is sent through the second device port to trigger the second extended device to perform the target operation on the data in the actual target physical address according to the data processing instruction, including:

[0043] When the target device port is the second device port, the target physical address is determined according to the data processing instruction;

[0044] Based on the target physical address and the second correspondence, determine the target network address of the target's second network module and the actual target physical address in the second physical memory connected to the target's second network module that corresponds to the target physical address;

[0045] The data processing instruction is sent to the first network module through the second device port;

[0046] The first network module is triggered to forward the data processing instruction to the second network module of the target based on the target network address, so as to trigger the second extended device to perform the target operation on the data in the actual target physical address.

[0047] In one embodiment, 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:

[0048] The first extended device is triggered to perform target operations on the data in the actual target physical address through the first network module and the second network module of the target, based on the actual target physical address and the target network address.

[0049] In one embodiment, before allocating a first physical address to the first extended device and allocating an i-th physical address to the i-th extended device based on the first physical memory and the i-th physical memory, the method further includes:

[0050] Obtain the physical address occupancy status in the operating system, and determine the unoccupied physical addresses based on the occupancy status;

[0051] Allocating a first physical address to the first extended device and allocating an i-th physical address to the i-th extended device based on the first physical memory and the i-th physical memory includes:

[0052] Based on the first physical memory and the i-th physical memory, allocate a first physical address to the first extended device from the unoccupied physical addresses, and allocate an i-th physical address to the i-th extended device.

[0053] In one embodiment, obtaining the first physical memory of the first extended device and the i-th physical memory of the i-th extended device includes:

[0054] Obtain the first physical memory initialization information of the first extended device and the i-th physical memory initialization information of the i-th extended device;

[0055] After the server starts, it scans each of the extended devices to obtain the first physical memory actual information and the i-th physical memory actual information;

[0056] The first physical memory is determined based on the actual information of the first physical memory and the initialization information of the first physical memory, and the i-th physical memory is determined based on the actual information of the i-th physical memory and the initialization information of the i-th physical memory.

[0057] To address the aforementioned technical problems, this application also provides an electronic device, comprising:

[0058] Memory, used to store computer programs;

[0059] A processor, configured to implement the steps of the physical memory expansion method for a server as described above when executing a computer program.

[0060] To address the aforementioned technical problems, this application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the aforementioned method for expanding the physical memory of a server.

[0061] This application provides a physical memory expansion architecture, server, method, device, and medium for a server, relating to the field of memory management, to solve the problem that a single server's limited physical address space prevents the efficient running of very large applications. The solution includes a first expansion device connected to an expansion port of the central processing unit (CPU) and at least one i-th level of expansion devices, each expansion device including physical memory and having physical addresses. This application expands the server's physical memory space by connecting multiple expansion devices. Thus, even if the physical address space of a single server is limited, connecting multiple expansion devices allows for a larger physical memory space, enabling applications to run within a wider range of physical memory without requiring changes to the application architecture or distributed deployment across multiple servers, thereby solving the problem of a single server's inability to efficiently run very large applications. Attached Figure Description

[0062] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the prior art and embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0063] Figure 1 This is a schematic diagram of an existing system that only uses physical addresses;

[0064] Figure 2 This is a schematic diagram of an existing system that uses virtual address management;

[0065] Figure 3 A schematic diagram of a physical memory expansion architecture for a server provided in this application;

[0066] Figure 4 A schematic diagram illustrating a memory management unit address translation process provided in this application;

[0067] Figure 5 A flowchart of a page fault handling procedure provided in this application;

[0068] Figure 6 A schematic diagram of a server provided in this application;

[0069] Figure 7 A flowchart illustrating a method for expanding the physical memory of a server provided in this application;

[0070] Figure 8 A schematic diagram illustrating a specific embodiment of a physical memory expansion architecture provided in this application;

[0071] Figure 9 This application provides a query representation for accessing a physical address;

[0072] Figure 10 This is a schematic diagram of a computer-readable storage medium provided in this application. Detailed Implementation

[0073] The core of this application is to provide a physical memory expansion architecture, server, method, device, and medium for a server. By connecting multiple expansion devices, the physical memory space of the server can be expanded. 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 them across multiple servers, thereby solving the problem that a single server cannot efficiently run very large applications.

[0074] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0075] Early computers, or even embedded devices using 8-bit / 16-bit microcontrollers today, run programs directly in physical memory. This means that the addresses accessed by the program during runtime are all physical addresses. For example, the value in the program counter register is the address of the physical memory location where the prefetched instructions reside. This method of running programs directly in physical memory is simple to implement, but it is not suitable for complex systems, especially multitasking operating systems. Figure 1 As shown, in early systems without virtual memory management technology, the address issued by the processor core was sent directly to the external address bus, and then the physical memory at the corresponding address (the local physical memory connected to the central processing unit, which is currently generally DDR) was read and written.

[0076] like Figure 2 As shown, when virtual memory management is used, the virtual address is not sent directly to the external address bus, but to the MMU (Memory Management Unit), which consists of one or a group of chips. Its function is to map the virtual address to the physical address. Figure 2 The proposed solution, given limited local physical memory, cannot support large applications on a single server.

[0077] To solve the above technical problems, such as Figure 3 As shown, this application provides a physical memory expansion architecture for a server, including local physical memory located in the server and a central processing unit connected to the local physical memory. The central processing unit includes an expansion port. The physical memory expansion architecture includes:

[0078] A first expansion device connected to an expansion port of a central processing unit, the first expansion device including a first physical memory, and the first physical memory being configured with a first physical address;

[0079] 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 the i-th physical memory, and the i-th physical memory is configured with the i-th physical address, i ≥ 2 and i is an integer;

[0080] The central processing unit (CPU) is used to determine the target physical address based on the target virtual address when it receives a data processing instruction for the target virtual address, and to perform the target operation on the data in the target physical address. The target physical address can be any address among the local physical address, the first physical address, and the i-th physical address.

[0081] Specifically, this application enables a server to access additional physical memory beyond its local physical memory range by connecting multiple expansion devices, and allows data processing operations to be performed on these expansion devices. Specifically, this embodiment describes a physical memory expansion architecture including at least two levels of expansion devices. Each expansion device is connected to a portion of additional physical memory and configured with a corresponding physical address. The first-level expansion device is the first expansion device, the second-level expansion device connected to the first expansion device is the second-level expansion device, and so on, with the i-th expansion device being the i-th level expansion device. That is, the expansion devices in this application are configured in a multi-level manner. The central processing unit (CPU) connects directly or indirectly to these expansion devices through expansion ports. When it receives a data processing instruction for a target virtual address, it determines the target physical address based on the target virtual address and performs the target operation on the data at the target physical address. This means that the CPU can freely access and manipulate data in its local physical memory and on the multiple connected expansion devices, thereby realizing the physical memory expansion of the server. It is important to understand that when each level includes more than one expansion device, these expansion devices at the same level only connect to the expansion device at the level above them, and these expansion devices at the same level do not connect to each other.

[0082] In one embodiment, the central processing unit further includes a controller, which is connected to a first extended device via an extension port; the controller is configured to acquire the target physical address in real time, and when the target physical address is the first physical address or an address in the i-th physical address, intercept data processing instructions and forward the data processing instructions to the first extended device via the extension port.

[0083] Specifically, when the central processing unit (CPU) is connected to the 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 the application and forwarding these instructions to the first expansion device when necessary. These data processing instructions may involve operations such as reading and writing physical memory, and the controller, through its connection with the first expansion device, achieves effective management and control of the physical memory expansion architecture. The controller can be a PCIe (Peripheral Component Interconnect Express) controller, and the expansion port can be a PCIe expansion port.

[0084] In this embodiment, the controller obtains the target physical address obtained by the central processing unit based on the target virtual address in real time, thereby realizing the interception and forwarding of data processing instructions. This helps to optimize the expansion architecture of the server's physical memory and improve the running efficiency and performance of ultra-large applications.

[0085] In one embodiment, a first extended device, upon receiving a data processing instruction, performs a target operation on the data at the target physical address if the target physical address is an address within the first physical address set; otherwise, it forwards the data processing instruction to a second extended device. Specifically, when the target physical address is an address within the first physical address set, the first extended device can directly perform the required operation on the data at the target physical address without forwarding the data processing instruction to other extended devices. Conversely, when the target physical address is not an address within the first physical address set, the first extended device forwards the data processing instruction to the second extended device. This approach enables flexible processing of data processing instructions, allowing different physical addresses to be processed by different extended devices, thereby improving the overall efficiency and performance of the system.

[0086] The principle by which the central processing unit accesses the target physical address based on the target virtual address is as follows: Figure 4 and Figure 5 As shown, Figure 4 This section describes in detail how the MMU uses a first-level page table to translate virtual addresses to physical addresses. The MMU uses the first few bits of the virtual address (including the page number and page offset) issued by the processor core (i.e., the processor core in the central processing unit) as an index to look up 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. Figure 5 In the MMU's operation, page table maintenance / updating becomes a crucial aspect of the system. Each application (process) has its own page table, created by the operating system when the program starts. However, at this time, the page table has no valid entries (initializing all entries when the page table is created is both time-consuming and wastes the memory space occupied by the page table itself). Only when the application actually accesses a certain address will the relevant entry be created by the "page fault handler" in the operating system. The specific process is as follows: When the processor core (central processing unit) issues a data processing instruction to access a certain virtual address (such as the target virtual address), it checks whether there is already a relevant entry in the page table; if so, the MMU translates the virtual address into a physical address and sends the data processing instruction to the external bus; if not, it enters the page fault handler, creates a page table entry, and executes the same data processing instruction again.

[0087] Based on the above embodiments:

[0088] In one embodiment, the first expansion device further includes at least two device ports, wherein the first device port is connected to its corresponding first physical memory, and the second device port is connected to the second expansion device.

[0089] In this embodiment, the first expansion device may include at least two device ports. The first device port is connected to its corresponding first physical memory, while 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 ports can connect to more expansion devices. In this way, the server's physical memory can be further expanded, enabling it to accommodate more memory capacity. This helps solve the problem that the virtual address space of existing central processing units is much larger than the physical memory capacity, thereby improving the efficiency and performance of a single server running very large applications. This embodiment also helps simplify program architecture because programs can run in a larger memory space without needing to be distributed across multiple servers. This helps reduce program complexity and simplify the development and maintenance process. In summary, this embodiment provides greater scalability and flexibility to the server's physical memory expansion architecture, contributing to improved server performance and simplified program deployment.

[0090] In one embodiment, 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 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 an i+1-th network module.

[0091] In this embodiment, a first network module can be configured in the first expansion device, and an i-th network module can be configured in the i-th expansion device. The function of these network modules is to enable connections between the first device port and the second device port, as well as the i-th network module. Specifically, through these connections, the first network module can communicate with the second device port, and the i-th network module can connect and communicate with adjacent network modules, thereby enabling communication with adjacent physical memory. This design effectively expands the server's physical memory, allowing the server to utilize multiple physical memory modules for data storage and processing. Simultaneously, through the connection of the network modules, these physical memory modules can share data and communicate with each other, further improving the server's performance and flexibility.

[0092] In one embodiment, the first network module and / or the i-th network module are remote direct memory access (RDMA) network modules. RDMA is a data center networking technology that allows a computer system's memory to directly access the memory of a remote computer system without involving the host CPU or operating system, thereby achieving efficient data transfer and low latency. In the embodiments of this application, the first network module and the i-th network module can be RDMA network modules, which are connected to the device ports and physical memory of the expansion device, thereby enabling the expansion of server memory. By using RDMA network modules, the server can achieve high-performance, low-latency remote memory access, making distributed deployment program frameworks simpler and more efficient.

[0093] To solve the above technical problems, such as Figure 6 As shown, this application also provides a server, including local physical memory disposed in the server and a central processing unit connected to the local physical memory. The central processing unit includes an expansion port and 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; that is, the physical memory expansion architecture is inserted into the PCIe slot of the central processing unit to connect to the PCIe port.

[0094] To solve the above technical problems, such as Figure 7 As shown, this application also provides a method for expanding the physical memory of a server, applied to the aforementioned server physical memory expansion architecture. The physical memory expansion method includes:

[0095] S11: After the server's operating system starts, obtain the first physical memory of the first extended device and the i-th physical memory of the i-th extended device.

[0096] This step is to obtain the physical memory information of all connected expansion devices, including their size and location, in order to allocate appropriate 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.

[0097] In one embodiment, obtaining the first physical memory of the first extended device and the i-th physical memory of the i-th extended device includes: obtaining the first physical memory initialization information of the first extended device and the i-th physical memory initialization information of the i-th extended device; after the server starts, scanning each extended 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 based on the actual information of the first physical memory and the first physical memory initialization information, and determining the i-th physical memory based on the actual information of the i-th physical memory and the i-th physical memory initialization information. In this embodiment, it is first necessary to obtain the initial memory configuration information of the extended device. Secondly, after the server starts, the actual memory information of the extended device is actively detected and obtained, rather than relying solely on the 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 compares the obtained actual memory information with the initial memory information and finally determines the physical memory to be used. In an optional embodiment, when the memory capacity corresponding to the actual memory information is greater than or equal to the memory capacity of 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 need to be allocated later.

[0098] S12: Allocate a first physical address to the first extended device and an i-th physical address to the i-th extended device based on the first physical memory and the i-th physical memory.

[0099] Specifically, this step involves the operating system identifying and initializing the first and i-th extended devices after the server starts, obtaining their physical memory information. This information may include the size and location of the memory. Then, the operating system allocates a first physical address to the first extended device and an i-th physical address to the i-th extended device based on this information. This process may involve the operation of the Memory Management Unit (MMU), which is responsible for managing the translation between virtual and physical addresses, as well as memory allocation and mapping. In this step, the operating system may configure the MMU to ensure the correct allocation and management of the physical addresses of the first and i-th extended devices.

[0100] In one embodiment, before allocating a first physical address to the first extended device and an i-th physical address to the i-th extended 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; allocating the first physical address to the first extended device and an i-th physical address to the i-th extended device based on the first physical memory and the i-th physical memory includes: allocating the first physical address to the first extended device and an i-th physical address to the i-th extended device from the unoccupied physical addresses in the first physical memory and the i-th physical memory. In this embodiment, by allocating the first physical address to the first extended device and an i-th physical address to the i-th extended device from the unoccupied physical addresses, it ensures that the first extended device and the i-th extended device can be smoothly added to the physical memory expansion architecture and that unoccupied physical addresses can be effectively managed and utilized to support the physical memory expansion of the server. In this way, the server can run very large applications more efficiently without changing the program architecture or distributing it across multiple servers.

[0101] S13: When receiving a data processing instruction for a target virtual address, determine the target physical address based on the target virtual address, and perform the target operation on the data in the target physical address. The target physical address can be any address from the local physical address to the first physical address to the i-th physical address.

[0102] In this step, the CPU determines the target physical address corresponding to the received target virtual address based on the mapping relationship in the physical memory expansion architecture. After determining the target physical address, the CPU can perform specified operations on the data at that physical address, which helps to efficiently manage and operate the server's physical memory expansion architecture. This design allows the server to expand its physical memory through expansion devices, while ensuring effective management and utilization of this expanded memory.

[0103] Based on the above embodiments:

[0104] In one embodiment, upon receiving a data processing instruction for a target virtual address, the 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. This includes: upon receiving a data processing instruction for a target virtual address, determining the target physical address based on the target virtual address; determining whether the target physical address is a local physical address; if it is a local physical address, directly performing the target operation on the data in the target physical address; if it is not a local physical address, forwarding the data processing instruction to a first extended device through an extended port to trigger the first extended device to perform the target operation on the data in the target physical address according to the data processing instruction.

[0105] In this embodiment, when the central processing unit (CPU) receives a data processing instruction containing a target virtual address, it determines the target physical address based on the target virtual address. First, the CPU determines whether the target physical address is a local physical address. If it is a local physical address, it 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 CPU forwards the data processing instruction to the first extended device through an extended port. Through this forwarding, the CPU triggers the first extended device to perform the target operation on the data at the target physical address. The first extended device can use its own physical address allocation and access mechanism to process the target physical address.

[0106] In one embodiment, 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: configuring the controller to obtain a target physical address in real time; when the target physical address is an address in the first physical address or the i-th physical address, intercepting a data processing instruction and forwarding the data processing instruction to the first expansion device via the expansion port; forwarding the data processing instruction to the first expansion device via 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 via 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.

[0107] In this step, the controller is configured to acquire the target physical address obtained by the central processing unit (CPU) from the target virtual address in real time. This allows the controller to access and manipulate the physical memory corresponding to the target virtual address. When the controller determines that the target physical address is either the first physical address or an address within the i-th physical address range, it intercepts data processing instructions and forwards them to the first extended device via an extended port. This triggers the first extended device to execute the target operation on the data at the target physical address. This ensures effective expansion and management of the physical memory in the extended device while processing data processing instructions for the virtual address. In this way, the system can handle memory expansion more flexibly, thereby improving server performance and hardware resource utilization.

[0108] In one embodiment, the first expansion device further includes at least two device ports, wherein the first device port is connected to its corresponding first physical memory, and the second device port is connected to the second expansion device. The physical memory expansion method further includes: generating a first correspondence between physical addresses and device ports, and writing the first correspondence into the first expansion device. 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.

[0109] Triggering the first extended device to perform a target operation on the data in the target physical address according to the data processing instructions includes: triggering the first extended device to determine the target physical address according to the data processing instructions; 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 according to the target physical address and the first correspondence; and sending the data processing instructions through the target device port to perform the target operation on the data in the actual target physical address.

[0110] In this embodiment, a mapping table is created based on the server's physical address and the physical addresses of the physical memory connected to each device port. This mapping table is then written into the first extended device. This establishes a mapping between the server's physical address and the physical memory connected to each device port, allowing the first extended device to determine the target device port and the actual target physical address based on the target physical address of the data processing instruction. Next, when a target operation needs to be executed, the first extended device is triggered to perform the target operation on the data at 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 mapping table. Then, the data processing instruction is sent through the target device port to execute the target operation on the data at the actual target physical address.

[0111] In one embodiment, sending a data processing instruction through a target device port to perform a target operation on data in the actual target physical address includes: when the target device port is a 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 a second device port, sending the data processing instruction through the second device port to trigger a second extended device to perform the target operation on the data in the actual target physical address according to the data processing instruction.

[0112] In this embodiment, 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 the first device port, the data processing instruction is sent directly through the first device port to perform the target operation on the data in the actual target physical address; while 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 extended device to perform operations 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 achieving flexible management and control of the extended devices. In this way, the physical memory of the server can be effectively expanded, and the extended devices can be effectively scheduled and controlled to meet different application scenarios and needs.

[0113] In one embodiment, 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 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 an 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, wherein the second correspondence includes 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.

[0114] In one embodiment, when the target device port is determined to be the second device port, a data processing instruction is sent through the second device port to trigger the second extended device to perform a target operation on the data in the actual target physical address according to the data processing instruction. This includes: 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 a second correspondence; sending the data processing instruction to the first network module through the second device port; and 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 extended device to perform a target operation on the data in the actual target physical address.

[0115] In this embodiment, both the first expansion device and the i-th expansion device include network modules, enabling network communication between multiple expansion devices. Specifically, the first network module is connected to the port of the second device, 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 an (i+1)-th network module. In this embodiment, a second correspondence between the device port and at least one second expansion device is also generated and written into the first expansion device. The second correspondence includes 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. Thus, when the target device port is determined to be a second device port, 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 can be determined based on the second correspondence. When the controller determines that the target physical address is the first physical address or an address in the i-th physical address, it forwards the data processing instructions to the first expansion device through the expansion port. When the target device port is determined to be the second device port, the data processing command is sent to the first network module through the second device port. This triggers the first network module to forward the data processing command to the target's second network module based on the target network address, thereby triggering the second extended device to execute the target operation on the data at the actual target physical address. In summary, this embodiment achieves collaborative work between extended devices through the network module's network communication and the correspondence between device ports and physical memory, thereby improving the efficiency and reliability of physical memory expansion.

[0116] In one embodiment, when the first network module and the i-th network module are remote direct address access network modules, after sending the data processing instructions to the first network module through the second device port, the physical memory expansion method further includes:

[0117] The first extended device is triggered to perform target operations on the data in the actual target physical address through the first network module and the target's second network module, based on the actual target physical address and the target network address.

[0118] In this embodiment, the first network module and the i-th network module are remote direct address access network modules (i.e., RDMA, which can directly access memory when transmitting data over the network without the intervention of the CPU, thus having extremely low latency and high bandwidth).

[0119] In this embodiment, after the data processing instruction is sent to the first network module through 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 through the first network module and the target's second network module, based on the actual target physical address and the target network address. In other words, the data processing instruction will directly access memory through the RDMA network module, thereby making data transmission faster and more efficient.

[0120] A specific implementation of this application is as follows: Figure 8 As shown, with Figure 8 Taking the configuration in the example, the server host has 4GB of local physical memory. The server host is connected to a first expansion device (such as an FPGA (Field-Programmable Gate Array)) through a PCIe slot. The FPGA's first physical memory (i.e., the FPGA's local physical memory) is 2GB. There are two second expansion devices connected to the first expansion device. The second expansion device can 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). Thus, the server host has a total of 8GB of accessible physical memory.

[0121] To present 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 of the physical address of the server host and the physical address of the physical memory connected to the device port of the first expansion device), a "Remote Memory Access Module" (equipped with a second correspondence table of the second physical address of each second expansion device and the network address of the second network module of each second expansion device), and an "RDMA Network Module" to the expansion device to assist the CPU in performing access to the remote second physical memory.

[0122] In terms of hardware architecture, in addition to the existing central processing unit (CPU) chip and local physical memory, at least one expansion device (such as an FPGA) needs to be inserted into the CPU's slot (such as a PCIe slot). The CPU core can access the FPGA via the "external address bus → PCIe controller". Inside the FPGA, because the performance of the first physical memory of the first expansion device and the second physical memory of the remote second expansion device differs, different ports (different local buses can be used in specific designs) are set up to access them separately, aiming to improve the access speed of the on-board memory. Specifically... Figure 8In this configuration, port 0 corresponds to the first physical memory (2GB total), and port 1 corresponds to the second physical memory 1 and the second physical memory 2 at the remote end (2GB total). Each first sub-extension device at the remote end consists of an RDMA network module and the second physical memory at the remote end. It can also be replaced by other hosts carrying RDMA network cards, making implementation relatively simple.

[0123] For the first physical memory of the first expansion device, the physical path for the central processing unit to access it is: processor core → memory management unit 1 → PCIe controller → memory management unit 2 → port 0 → memory on the FPGA board.

[0124] For the second physical memory of the remote second expansion device, the physical path for the central processing unit 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.

[0125] The initialization process is as follows: (1) After the server's operating system starts, the local physical memory is accessible. Assume that its local physical address ranges from 0 to 4G. (2) Pass initialization parameters to the driver. The parameters include: the number of accessible extended devices, the memory capacity of each extended device (e.g., first extended device: 2G, second extended device 1: 1G, second extended device 2: 1G), and the RDMA network address of each second extended device (e.g., second extended device 1: GID1, second extended device 2: GID2). (3) The driver starts running, scans the extended devices, and finds that the available first physical memory is 2G. Then, through the parameters, it is learned that the two second physical memories are also 2G ​​in total. Thus, the total extended physical memory is calculated to be 4G. (4) The driver queries the system for the physical addresses that have been used, and then allocates 4G of the unused physical addresses to the physical memory of the extended devices. Figure 8(5) The driver configures the PCIe controller to intercept data processing instructions from the central processing unit at addresses 4G to 8G and send them to the first expansion device. (6) The driver writes the first mapping relationship into the first expansion device (e.g., the cache in the chip corresponding to the first expansion device, which is not used as the host's extended memory). The first mapping relationship includes two entries: Entry 1: The physical address of the server host "4G to 6G" corresponds to port 0 (output address is 0 to 2G). Entry 2: The physical address of the server host "6G to 8G" corresponds to port 1 (output address is 0 to 2G). Then the driver can configure the address of this mapping relationship to "Memory Management Unit 2". (7) The driver writes the "second mapping relationship" into the expansion device, which includes two entries. Entry 1: The address of port 1 "0 to 1G" corresponds to the second expansion device 1 with RDMA network address GID1; Entry 2: The address of port 1 "1G to 2G" corresponds to the second expansion device 2 with RDMA network address GID2. Then the driver 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 there is an additional 4G of physical memory available and tells it the physical address, which is equivalent to adding the extended memory to the system memory pool. After that, the operating system can write the newly added address here into the page table in the page fault exception handler for the application to access.

[0126] For accessing extended physical memory, if it's the local sub-memory of the extended device, assuming the operating system's page fault handler has already created a page table with virtual address X and physical address 0x100000000, falling within the 4GB to 6GB address range. Taking a write operation as an example (read operations are similar), when a program running in the CPU wants to write a value Y to virtual address X, the hardware processes it as follows: 1. The memory management unit 1 searches the system page table, obtains the physical address 0x100000000 corresponding to virtual address X, and then sends the physical address and value Y to the system bus. 2. Since the physical address falls within the 4GB to 8GB range, the write signal (including address and data Y) is acquired by the PCIe controller and then sent to the first extended device. 3. The memory management unit 2 of the first extended device receives a write signal (address 0x100000000, data Y), looks up the first correspondence, converts the address to address 0 of port 0 (because the physical address of the server host is 4G to 6G, which corresponds to 0 to 2G of port 0, and 0x100000000 is the starting address of this range), and sends the write signal (address 0, data Y) from port 0. 4. Data Y is written to the first physical memory of the first extended device.

[0127] If this is the second physical memory of a second expansion device on a remote device, assuming the operating system's page fault handler has already created a page table with virtual address A and physical address 0x1C0000000 (starting at 7G), falling within the 6G to 8G address range, taking a write operation as an example (read operations are similar), when a program running in the CPU wants to write a value B to virtual address A, the hardware processes it as follows: 1. Memory Management Unit 1 searches the system page table, obtains the physical address 0x1C0000000 corresponding to virtual address A, and then sends the physical address and value B to the system bus. 2. Since the physical address falls within the 4G to 8G range, the write signal (including address and data B) is acquired by the PCIe controller and then sent to the first expansion device. 3. The memory management unit 2 of the first extended device receives a write signal (address 0x1C0000000, data B), looks up the first correspondence, and converts the address to the address 0x40000000 of port 1 (i.e., starting at 1G, because the physical address of the server host from 6G to 8G corresponds to 0 to 2G of port 1, and 0x1C0000000 is the middle position of this interval, i.e., 1G of port 1), and sends the write signal (address 0x40000000, data B) from port 1. 4. The "remote memory access module" of the first extended device receives the write signal (address 0x40000000, data B), looks up the second correspondence, obtains the RDMA network address GID2 of the second extended device 2, and the internal memory address 0 of the device (because the address from 1G to 2G of port 1 corresponds to the memory address from 0 to 1G of the device with GID2). 5. The "remote memory access module" of the first extended device initiates a standard RDMA Write operation to write data B to memory address 0 of the second physical memory.

[0128] exist Figure 4 and Figure 5 Based on this, please refer to Figure 9 This describes the table lookup process 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 extended device, i.e., in the first physical memory, two levels of page tables are used sequentially (i.e., the system page table and the table corresponding to the first correspondence mentioned in the above embodiment); if the target physical memory is located in a remote second extended device, three levels of page tables are used sequentially, i.e., the table corresponding to the second correspondence mentioned in the above embodiment is added to the first two levels. To make the table lookup process clearer and to allow the first extended device to look up the table as quickly as possible, this invention designs... Figure 9The table lookup process is shown. When looking up the two-level tables added in this invention, two registers are needed, namely the registers (1) and (2) for the table entry number bits. These registers specify which bits of the physical address are used to look up the two-level tables. The values ​​of these two registers are configured by the driver when filling in the tables. Compared with the existing scheme that uses fixed bits (i.e., ... Figure 4 or Figure 9 The table lookup method (using the "page number" of the first-level table) dynamically adjusts the bit width of the table entry number based on the size of the address range, and also dynamically adjusts the number of table entries. Using only the bits that change throughout the entire address range (excluding offsets) as the table index effectively reduces the number of indexes required, and also reduces the number of table entries, thus reducing the consumption of logical resources of the first extended device.

[0129] This application also provides an electronic device, including:

[0130] Memory, used to store computer programs;

[0131] A processor, used to implement the steps of the above-described method for expanding the physical memory of a server when executing a computer program.

[0132] For a description of the electronic device, please refer to the above embodiments; this application will not repeat it here.

[0133] like Figure 10 As shown, this application also provides a computer-readable storage medium 101, on which a computer program 102 is stored, and when the computer program 102 is executed by a processor, it implements the steps of the above-described method for expanding the physical memory of a server.

[0134] For a description of the computer-readable storage medium 101, please refer to the above embodiments; this application will not repeat it here.

[0135] It should also be noted that, in this specification, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0136] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded 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, The physical memory includes local physical memory located 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 local physical addresses. The physical memory expansion architecture includes: A first expansion device connected to the expansion port of the central processing unit, the first expansion device including a first physical memory, and the first physical memory being configured with a first physical address; 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 the i-th physical memory, and the i-th physical memory is configured with the i-th physical address, i ≥ 2 and i is an integer; The central processing unit is configured to, upon receiving a data processing instruction for a target virtual address, determine a target physical address based on the target virtual address, and perform a target operation on the data in the target physical address, wherein the target physical address is the local physical address, any address from the first physical address to the i-th physical address; The central processing unit also includes a controller, which is connected to the first extended device through the expansion port; the controller is used to obtain the target physical address in real time, and when the target physical address is the first physical address or an address in the i-th physical address, intercept the data processing instruction and forward the data processing instruction to the first extended device through the expansion port. The first extended device is configured to, upon receiving the data processing instruction, perform a target operation on the data in the first physical memory if the target physical address is an address in the first physical address; and forward the data processing instruction to the i-th extended device to trigger the i-th extended device to perform the target operation on the data in the i-th physical memory if the target physical address is not an address in the first physical address.

2. The physical memory expansion architecture of the server as described in claim 1, characterized in that, 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.

3. The physical memory expansion architecture of the server as described in claim 2, characterized in that, The first extension device further includes a first network module, and the i-th extension 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 an i+1-th network module.

4. The physical memory expansion architecture of the server as described in claim 3, characterized in that, The first network module and / or the i-th network module is a remote direct address access network module.

5. A server, characterized in that, The server includes local physical memory located in the server and a central processing unit connected to the local physical memory. The central processing unit includes an expansion port. The server also includes a physical memory expansion architecture as described in any one of claims 1-4, wherein the physical memory expansion architecture is connected to the expansion port.

6. A method for expanding the physical memory of a server, characterized in that, The physical memory expansion architecture applied to the server according to any one of claims 1-4, the physical memory expansion method comprising: After the operating system of the server starts, the first physical memory of the first extended device and the i-th physical memory of the i-th extended device are obtained; Assign a first physical address to the first extended device and an i-th physical address to the i-th extended device based on the first physical memory and the i-th physical memory; Upon receiving a data processing instruction for a target virtual address, the target physical address is determined based on the target virtual address, and the target operation is performed on the data in the target physical address. Configure the controller to obtain the target physical address in real time. When the target physical address is the first physical address or an address in the i-th physical address, intercept the data processing instruction and forward the data processing instruction to the first extended device through the extended port. After receiving the data processing instruction, if the target physical address is an address in the first physical address, the first extended device performs the target operation on the data in the first physical memory; if the target physical address is not an address in the first physical address, the first extended device forwards the data processing instruction to the i-th extended device to trigger the i-th extended device to perform the target operation on the data in the i-th physical memory. The target physical address is any address among the local physical address, the first physical address, and the i-th physical address.

7. The method for expanding the physical memory of a server as described in claim 6, characterized in that, Upon receiving a data processing instruction for a target virtual address, the system determines the target physical address based on the target virtual address and performs a target operation on the data in the target physical address, including: Upon receiving a data processing instruction for a target virtual address, the target physical address is determined based on the target virtual address; Determine whether the target physical address is a local physical address; If it is the local physical address, then the target operation is performed directly on the data in the target physical address.

8. The method for expanding the physical memory of a server as described in claim 6, characterized in that, 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 itself, and the second device port is connected to the second expansion device. The physical memory expansion method further includes: A first correspondence between physical addresses and device ports is generated, and the first correspondence is written into the first extended device. 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.

9. The method for expanding the physical memory of a server as described in claim 8, characterized in that, Triggering the first extended device to perform the target operation on the data in the target physical address according to the data processing instruction includes: The first extended device is triggered to determine the target physical address according to the data processing instruction; Based on the target physical address and the first correspondence, determine 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; The data processing instruction is sent through the target device port to perform the target operation on the data in the actual target physical address.

10. The method for expanding the physical memory of a server as described in claim 9, characterized in that, 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, 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; 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 extended device to perform the target operation on the data in the actual target physical address according to the data processing instruction.

11. The method for expanding the physical memory of a server as described in claim 10, 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 port of the second device, 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 an (i+1)-th network module; A second correspondence is generated between the device port and at least one of the second extended devices, and the second correspondence is written into the first extended device. The second correspondence includes the physical address of the physical memory connected to the device port, the second physical address of each of the second extended devices, and the network address of the second network module of each of the second extended devices.

12. The method for expanding the physical memory of a server as described in claim 11, characterized in that, When the target device port is determined to be the second device port, the data processing instruction is sent through the second device port, triggering the second extended device to perform the 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, the target physical address is determined according to the data processing instruction; Based on the target physical address and the second correspondence, determine the target network address of the target's second network module and the actual target physical address in the second physical memory connected to the target's second network module that corresponds to the target physical address; The data processing instruction is sent to the first network module through the second device port; The first network module is triggered to forward the data processing instruction to the second network module of the target based on the target network address, so as to trigger the second extended device to perform the target operation on the data in the actual target physical address.

13. The method for expanding the physical memory of a server as described in claim 12, characterized in that, 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: The first extended device is triggered to perform target operations on the data in the actual target physical address through the first network module and the second network module of the target, based on the actual target physical address and the target network address.

14. The method for expanding the physical memory of a server as described in any one of claims 6-13, characterized in that, Before allocating a first physical address to the first extended device and an i-th physical address to the i-th extended device based on the first physical memory and the i-th physical memory, the method further includes: Obtain the physical address occupancy status in the operating system, and determine the unoccupied physical addresses based on the occupancy status; Allocating a first physical address to the first extended device and allocating an i-th physical address to the i-th extended device based on the first physical memory and the i-th physical memory includes: Based on the first physical memory and the i-th physical memory, allocate a first physical address to the first extended device from the unoccupied physical addresses, and allocate an i-th physical address to the i-th extended device.

15. The method for expanding the physical memory of a server as described in any one of claims 6-13, characterized in that, Obtaining the first physical memory of the first extended device and the i-th physical memory of the i-th extended device includes: Obtain the first physical memory initialization information of the first extended device and the i-th physical memory initialization information of the i-th extended device; After the server starts, it scans each of the extended devices to obtain the first physical memory actual information and the i-th physical memory actual information; The first physical memory is determined based on the actual information of the first physical memory and the initialization information of the first physical memory, and the i-th physical memory is determined based on the actual information of the i-th physical memory and the initialization information of the i-th physical memory.

16. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, configured to, when executing a computer program, implement the steps of the physical memory expansion method for a server as described in any one of claims 6-15.

17. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the physical memory expansion method for a server as described in any one of claims 6-15.

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