Memory expansion method and apparatus, server system, electronic device, and storage medium
By adding a memory server and multiple memory expansion devices to the server system, flexible allocation of server memory is achieved, and the problem of insufficient flexibility in memory expansion in the existing technology is solved, and the flexibility and resource utilization of server memory expansion are improved.
Patent Information
- Application Number
- PCT/CN2024/133955
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-11-23
- Filing Date
- 2024-11-22
- Publication Date
- 2025-05-30
AI Technical Summary
The prior art has poor flexibility in memory expansion in server systems and cannot meet the changing needs of server memory.
By adding a memory server to the server system, including switches and multiple memory expansion devices, the memory expansion device is connected to the server in the server system through a switch, and the main server allocates multiple memory expansion devices, and each memory expansion device no longer corresponds to a fixed server.
Improves the flexibility of server memory expansion, meets the ever-changing needs of server memory, and avoids waste of resources.
Smart Images

Figure CN2024133955_30052025_PF_FP_ABST
Abstract
Description
Memory expansion method, device, server system, electronic device and storage medium
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application claims priority to the Chinese patent application filed with the China Patent Office on November 23, 2023, with application number 202311572671.0, and application name “Memory Expansion Method, Device, Server System, Electronic Device and Storage Medium”, all contents of which are incorporated by reference into this application. Technical Field
[0003] The present application relates to the field of computer technology, and more specifically, to a memory expansion method, device, server system, electronic device, and non-volatile readable storage medium. Background Art
[0004] In server systems, server memory can be expanded based on application requirements. In related technologies, this is achieved by inserting a memory expansion device into the server. However, server application scenarios are constantly changing, and the memory requirements are also changing. These memory expansion solutions are unable to meet the ever-changing server memory requirements and lack flexibility. Summary of the Invention
[0005] The purpose of this application is to provide a memory expansion method, device, server system, electronic device and non-volatile readable storage medium, which improve the flexibility of server memory expansion.
[0006] To achieve the above-mentioned object, the present application provides a memory expansion method, which is applied to a main server in a server system, wherein the server system includes multiple servers and a memory server, the server includes a main server and multiple sub-servers, the memory server includes a switch and multiple memory expansion devices, the multiple memory expansion devices are connected to the switch, the multiple servers are connected to the switch, and the memory expansion device includes an extended memory;
[0007] Methods include:
[0008] Receive memory application request from child server;
[0009] Determine a target memory expansion device from among multiple memory expansion devices according to the requested memory size in the memory request;
[0010] The resource information of the target memory expansion device is sent to the sub-server so that the sub-server can use the expanded memory in the target memory expansion device.
[0011] Before receiving the memory application request from the child server, the following steps are also included:
[0012] Scan the memory server to obtain resource information of all memory expansion devices in the memory server;
[0013] Create a resource master table and add resource information of all memory expansion devices to the resource master table.
[0014] The method of determining a target memory expansion device from among multiple memory expansion devices according to the requested memory size in the memory application request includes:
[0015] A target memory expansion device is determined from among multiple memory expansion devices according to the requested memory size in the memory request and the resource master table.
[0016] After determining a target memory expansion device from a plurality of memory expansion devices according to the memory application size in the memory application request and the resource master table, the method further includes:
[0017] Delete the resource information of the target memory expansion device from the resource master table.
[0018] After sending the resource information of the target memory expansion device to the sub-server so that the sub-server can use the extended memory in the target memory expansion device, the method further includes:
[0019] A memory release request for releasing a target memory expansion device is received from the child server, and resource information of the target memory expansion device is added back to the resource master table.
[0020] The extended memory includes a plurality of memory blocks of preset sizes, and determining a target memory expansion device from a plurality of memory expansion devices according to the requested memory size in the memory application request includes:
[0021] A target memory block in a target memory expansion device is determined according to the requested memory size in the memory request.
[0022] The step of sending the resource information of the target memory expansion device to the sub-server so that the sub-server can use the extended memory in the target memory expansion device includes:
[0023] The resource information of the target memory block in the target memory expansion device is sent to the sub-server, so that the sub-server uses the target memory block in the target memory expansion device.
[0024] The memory expansion device includes expansion memories of different memory types, each type of expansion memory includes multiple memory blocks of preset sizes, and determining a target memory expansion device from the multiple memory expansion devices according to the requested memory size in the memory application request includes:
[0025] A target memory block in a target memory expansion device is determined according to a requested memory size and a requested memory type in a memory request.
[0026] The step of sending the resource information of the target memory expansion device to the sub-server so that the sub-server can use the extended memory in the target memory expansion device includes:
[0027] The resource information of the target memory block in the target memory expansion device is sent to the sub-server, so that the sub-server uses the target memory block in the target memory expansion device.
[0028] The main server and multiple sub-servers are connected via a network port, and resource information of the target memory expansion device is sent to the sub-servers, including:
[0029] The resource information of the target memory expansion device is sent to the sub-server through the network port between the main server and the sub-server.
[0030] The memory expansion device includes a computing fast link device.
[0031] To achieve the above-mentioned object, the present application provides a memory expansion method, which is applied to a sub-server in a server system. The server system includes multiple servers and a memory server. The server includes a main server and multiple sub-servers. The multiple servers are connected to the memory server. The memory server includes a switch and multiple memory expansion devices. The multiple memory expansion devices are connected via the switch. The memory expansion device includes an extended memory.
[0032] Methods include:
[0033] Send a memory application request to the main server; wherein the memory application request includes the memory size to be applied for;
[0034] The system receives resource information of the target memory expansion device sent by the master server, so as to use the extended memory in the target memory expansion device.
[0035] The extended memory in the target memory expansion device is used, including:
[0036] Create a resource sub-table and add the resource information of the target memory expansion device to the resource sub-table;
[0037] A non-uniform memory access node is created based on resource information of the target memory expansion device to use the extended memory in the target memory expansion device.
[0038] After receiving the resource information of the target memory expansion device sent by the main server and using the extended memory in the target memory expansion device, the method further includes:
[0039] After the extended memory in the target memory expansion device is completely used, a memory release request for releasing the target memory expansion device is sent to the primary server.
[0040] Before sending the memory release request to the main server to release the target memory expansion device, the method further includes:
[0041] Delete the resource information of the target memory expansion device from the local resource subtable.
[0042] Receiving resource information of a target memory expansion device sent by a main server to use extended memory in the target memory expansion device includes:
[0043] The system receives resource information of the target memory block in the target memory expansion device sent by the main server, so as to use the target memory block in the target memory expansion device.
[0044] The memory application request also includes the memory type to be applied for, and receiving resource information of the target memory expansion device sent by the host server to use the extended memory in the target memory expansion device, including:
[0045] The target memory block in the target memory expansion device is received from the main server and matches the memory type. The target memory block in the target memory expansion device is used.
[0046] To achieve the above-mentioned object, the present application provides a memory expansion device, which is applied to a main server in a server system. The server system includes multiple servers and a memory server. The server includes a main server and multiple sub-servers. The multiple servers are connected to the memory server. The memory server includes a switch and multiple memory expansion devices. The multiple memory expansion devices are connected to the switch. The memory expansion device includes an extended memory.
[0047] The device includes:
[0048] A first receiving module is used to receive a memory application request from a sub-server;
[0049] A determination module, configured to determine a target memory expansion device from among a plurality of memory expansion devices according to a requested memory size in a memory application request;
[0050] The first sending module is used to send resource information of the target memory expansion device to the sub-server so that the sub-server can use the extended memory in the target memory expansion device.
[0051] To achieve the above-mentioned object, the present application provides a memory expansion device, which is applied to a sub-server in a server system. The server system includes multiple servers and a memory server. The server includes a main server and multiple sub-servers. The multiple servers are connected to the memory server. The memory server includes a switch and multiple memory expansion devices. The multiple memory expansion devices are connected via the switch. The memory expansion device includes an extended memory.
[0052] The device includes:
[0053] The second sending module is used to send a memory application request to the main server; wherein the memory application request includes the memory size to be applied for;
[0054] The second receiving module is configured to receive resource information of the target memory expansion device sent by the main server, so as to use the extended memory in the target memory expansion device.
[0055] To achieve the above-mentioned objectives, the present application provides a server system, including multiple servers and a memory server, the server includes a main service and multiple sub-servers, multiple servers are connected to the memory server, the memory server includes a switch and multiple memory expansion devices, multiple memory expansion devices are connected to the switch, multiple servers are connected to the switch, and the memory expansion device includes extended memory.
[0056] To achieve the above objectives, the present application provides an electronic device, comprising:
[0057] memory for storing computer programs;
[0058] A processor is used to implement the steps of the above-mentioned memory expansion method when executing a computer program.
[0059] To achieve the above objectives, the present application 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 memory expansion method are implemented.
[0060] From the above scheme, it can be seen that a memory expansion method provided by the present application is applied to a main server in a server system, the server system includes multiple servers and a memory server, the server includes a main service and multiple sub-servers, the memory server includes a switch and multiple memory expansion devices, the multiple memory expansion devices are connected to the switch, and the multiple servers are connected to the switch, and the memory expansion device includes extended memory; the method includes: receiving a memory application request from a sub-server; determining a target memory expansion device from multiple memory expansion devices according to the requested memory size in the memory application request; and sending resource information of the target memory expansion device to the sub-server so that the sub-server can use the extended memory in the target memory expansion device.
[0061] This application adds a memory server to a server system, comprising a switch and multiple memory expansion devices. The memory expansion devices are connected to the servers in the server system via the switch. Multiple memory expansion devices are allocated by a master server, so each memory expansion device no longer corresponds to a fixed server. This meets the ever-changing memory needs of the server and improves the flexibility of server memory expansion. This application also discloses a memory expansion device, a server system, an electronic device, and a non-volatile computer-readable storage medium, all of which can achieve the aforementioned technical effects.
[0062] It should be understood that the foregoing general description and the following detailed description are merely illustrative and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following will briefly introduce the drawings required for the embodiments or the description of the prior art. 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. The drawings are used to provide a further understanding of the present disclosure and constitute part of the specification. Together with the following specific embodiments, they are used to explain the present disclosure, but do not constitute a limitation of the present disclosure. In the drawings:
[0064] FIG1 is an architecture diagram of a server system in related art;
[0065] FIG2 is an architecture diagram of a server system according to an exemplary embodiment;
[0066] FIG3 is an architecture diagram of another server system according to an exemplary embodiment;
[0067] FIG4 is a flow chart showing a memory expansion method according to an exemplary embodiment;
[0068] FIG5 is an architecture diagram of another server system according to an exemplary embodiment;
[0069] FIG6 is a flow chart showing another memory expansion method according to an exemplary embodiment;
[0070] FIG7 is a structural diagram of a memory expansion device according to an exemplary embodiment;
[0071] FIG8 is a structural diagram of another memory expansion device according to an exemplary embodiment;
[0072] Fig. 9 is a structural diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0073] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application. In addition, in the embodiments of the present application, "first", "second", etc. are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0074] CXL (Compute Express Link) is a high-performance, low-latency interconnect technology used to connect processors, accelerators, and memory devices. CXL's Type 3 device is a group of memory modules that provide persistent, volatile, or combined memory. The architecture diagram of the server system in the related art is shown in Figure 1. The server in the system expands memory according to the needs of the application scenario. For example, a CXL board can expand 64G of memory. If the application scenario of server 0 requires 64G of memory expansion, a CXL board is inserted into server 0. If the application scenario of server 1 requires 96G of memory expansion, two CXL boards are inserted into server 1. And so on, the corresponding CXL boards are inserted into the corresponding servers according to the needs of the servers.
[0075] After the CXL card is inserted into the server, it is configured in Type 3 mode and the expanded memory is used to create a new numa (Non-Uniform Memory Access) node, allowing host programs to use the expanded memory. For example, if server 0's local memory is a numa0 node, a CXL card expands the memory to create a new numa1 node. Server 1's local memory is a numa1 node, and two CXL cards expand the memory to create new numa1 and numa2 nodes. After these new numa nodes are formed, the server's host programs can use the expanded memory.
[0076] The memory expansion method of inserting CXL boards into the server lacks flexibility. Server application scenarios are constantly changing, and the memory requirements are also changing. The memory expansion capacity of a single CXL board is fixed and cannot meet the ever-changing server memory needs. For example, a single CXL board can expand 64GB of memory. If the server application scenario 1 requires 64GB of memory expansion, inserting a CXL board can meet the demand. However, if the server switches to application scenario 2 and requires 128GB of memory expansion, two CXL boards will be required to meet the demand. At this point, when the server application scenario switches back to application scenario 1, only one CXL board is required, and the other CXL board is wasted, resulting in wasted resources. Another example is that a single CXL board can expand 64GB of memory, but the server application scenario 1 only requires 32GB of memory expansion. Inserting a CXL board results in 32GB of wasted memory expansion. When the server application scenario 2 requires 96G of expanded memory, two CXL boards need to be inserted, and 32G of expanded memory will be wasted. This usage mode also causes a waste of resources.
[0077] Therefore, the present application adds a memory server to the server system, including a switch and multiple memory expansion devices. The memory expansion device is connected to the server in the server system through the switch, and multiple memory expansion devices are allocated through the main server. Each memory expansion device no longer corresponds to a fixed server, which meets the ever-changing needs of server memory and improves the flexibility of server memory expansion.
[0078] An embodiment of the present application provides a server system, as shown in Figure 2, including multiple servers and a memory server, the server includes a main service and multiple sub-servers, the multiple servers are connected to the memory server, the memory server includes a switch and multiple memory expansion devices, the multiple memory expansion devices are connected to the switch, the multiple servers are connected to the switch, and the memory expansion device includes extended memory.
[0079] A server system can be understood as a collection of multiple servers. In this embodiment, a memory server is added to the server system. Specifically, the server system in this embodiment includes multiple servers and memory servers. The memory server includes a switch and multiple memory expansion devices. Each memory expansion device is connected to the switch, and each server is connected to each memory expansion device via the switch. The memory expansion device is used to provide expanded memory for the server. A master server role exists in the server. The master server and multiple sub-servers are connected via network ports. The master server is responsible for allocating and reclaiming the expanded memory provided by the memory expansion devices, enabling the flexible provision of the expanded memory provided by each memory expansion device to each server.
[0080] The memory expansion device in this embodiment can be a CXL device, but it can also be other types of memory expansion devices, which are not specifically limited here. Taking the memory expansion device as a CXL device as an example, the architecture diagram of the server system is shown in Figure 3. The memory server in the server system includes a CXL board and a CXL switch. The CXL board and the servers in the system are connected via the CXL switch. The servers are connected via a network and can exchange information. The memory server can be placed in the middle of the system to reduce the distance between the server and the memory server connection line, thereby reducing the delay in accessing the CXL board.
[0081] The system has a server that acts as the master server. The resource allocation program running on it scans all devices in the memory server and records the parameters of each CXL board. Based on this CXL board information, it creates a general table of device resources and fills the table with the information of each CXL board. When the server application requires memory expansion, the resource allocation subroutine running on it sends a message to the resource allocation main program on the master server requesting CXL board resources. The resource allocation main program on the master server then receives the message from the resource allocation subroutine, retrieves unused CXL boards from the device resource main table, and sends this CXL board information to the resource allocation subroutine. The resource allocation subroutine then creates a local device resource subtable to store the CXL board information. The application then calls the CXL board information from the device resource subtable and uses this board to create a new local NUMA node for use. When the server's application no longer requires the CXL card's memory expansion, the resource allocation subroutine removes the CXL card from the local device resource subtable and sends a CXL card release message to the resource allocation main program. Upon receiving the device resource release message, the resource allocation main program adds the CXL card back to the device resource main table, completing the update of the device resource main table. This completes the CXL card application and release process.
[0082] The embodiment of the present application discloses a memory expansion method, which improves the flexibility of server memory expansion.
[0083] 4 is a flowchart of a memory expansion method according to an exemplary embodiment. As shown in FIG4 , the method includes:
[0084] S101: receiving a memory request from a sub-server;
[0085] The execution subject of this embodiment is the main server in the above-mentioned server system. As an implementation method, before receiving the memory application request of the sub-server, it also includes: scanning the memory server to obtain the resource information of all memory expansion devices in the memory server; creating a resource master table, and adding the resource information of all memory expansion devices to the resource master table. In a specific implementation, the resource allocation main program of the main server scans the memory server, obtains the resource information of all memory expansion devices, and then creates a resource master table, and writes the resource information of all memory expansion devices into the resource master table. An example of a resource master table is shown in Table 1:
[0086] Table 1
[0087] The master server's resource allocation routine waits for a memory request from the slave server's resource allocation routine. When a slave server requires memory expansion, its resource allocation routine sends a memory request to the master server's resource allocation routine, including at least the size of the requested memory expansion, and waits for feedback from the resource allocation routine. It should be noted that when the master server requires memory expansion, the resource allocation routine in the master server also needs to send a memory request to the resource allocation routine.
[0088] S102: determining a target memory expansion device from a plurality of memory expansion devices according to the memory application size in the memory application request;
[0089] In a specific implementation, the master server's resource allocation program determines a target memory expansion device from among multiple memory expansion devices based on the requested memory size in the memory request and the resource master table, and allocates the corresponding expanded memory size to the child server. The memory expansion device in this embodiment can be a CXL device, but other types of memory expansion devices are also possible and are not specifically limited here.
[0090] S103: Sending resource information of the target memory expansion device to the sub-server so that the sub-server can use the extended memory in the target memory expansion device.
[0091] In a specific implementation, the main resource allocation program of the main server deletes the resource information of the target memory expansion device from the main resource table and sends the resource information of the target memory expansion device to the sub-server via the network port between the main server and the sub-server. After receiving the resource information of the target memory expansion device from the main resource allocation program, the resource allocation sub-program of the sub-server creates a local resource sub-table and populates the resource information of the target memory expansion device into this table. An example of a resource sub-table is shown in Table 2:
[0092] Table 2
[0093] The resource allocation subroutine of the subserver manages the target memory expansion device and enables its memory expansion function, creates a local new NUMA node to complete the memory expansion of the local server, and then the application of the subserver can use the extended memory normally.
[0094] Based on this embodiment, as an implementation method, after the resource information of the target memory expansion device is sent to the sub-server so that the sub-server can use the extended memory in the target memory expansion device, it also includes: receiving a memory release request from the sub-server to release the target memory expansion device, and re-adding the resource information of the target memory expansion device to the resource master table.
[0095] In a specific implementation, after the sub-server application completes its work, it notifies the resource allocation sub-program that the target memory expansion device has been used up. The resource allocation sub-program then removes the target memory expansion device's resource information from the device resource sub-table and sends a message to the resource allocation main program, notifying it that the target memory expansion device has been used up. Upon receiving the resource reclaim message, the main server's resource allocation main program fills the target memory expansion device's resource information back into the resource master table, replies to the resource allocation sub-program, notifying it that the target memory expansion device has been reclaimed, and updates the device resource master table. The sub-server's resource allocation sub-program then receives feedback from the resource allocation main program.
[0096] An embodiment of the present application adds a memory server to the server system, including a switch and multiple memory expansion devices. The memory expansion device is connected to the server in the server system through the switch, and the multiple memory expansion devices are allocated through the main server. Each memory expansion device no longer corresponds to a fixed server, which meets the ever-changing needs of the server memory and improves the flexibility of the server memory expansion.
[0097] Based on the above embodiment, as an implementation method, the extended memory includes multiple memory blocks of preset sizes, and the target memory expansion device is determined among multiple memory expansion devices according to the requested memory size in the memory application request, including: determining the target memory block in the target memory expansion device according to the requested memory size in the memory application request.
[0098] In a specific implementation, the memory expansion device can be implemented using an FPGA (Field Programmable Gate Array) board. For example, the CXL functionality can be implemented using an FPGA board, as shown in Figure 5. First, the CXL logic module is implemented in the FPGA board, supporting the CXL Type 3 memory expansion mode. Multi-channel RAM and PMEM persistent memory types are supported, facilitating user application selection. The expanded memory is divided into multiple memory blocks according to a preset size, which can be flexibly set based on user needs, such as 32GB. After the area division is completed, access rights are assigned based on the user. This logic is implemented in the FPGA, which determines access rights based on the server device node accessing the area. After allocation, the resource information for these memory blocks is written to the resource master table for use by servers requesting expanded memory. Extended Memory 0 and Extended Memory 1 in Figure 5 are different memory blocks. The master server can flexibly allocate expanded memory at the memory block level. That is, the master server can allocate different memory blocks from the same memory expansion device to different sub-servers, further enhancing the flexibility of server memory expansion.
[0099] The server's main resource allocation program determines the target memory block in the target memory expansion device based on the requested memory size in the memory request and the resource master table, and allocates the corresponding extended memory size to the sub-server. The server's main resource allocation program deletes the resource information of the target memory expansion device from the resource master table and sends the resource information of the target memory block in the target memory expansion device to the sub-server. The sub-server's resource allocation sub-program adds the received resource information of the target memory block in the target memory expansion device to the locally created resource sub-table, thereby using the target memory block in the target memory expansion device.
[0100] Based on the above embodiment, as an implementation method, the memory expansion device includes extended memories of different memory types, each type of extended memory includes multiple memory blocks of preset sizes, and the target memory expansion device is determined from multiple memory expansion devices according to the requested memory size in the memory application request, including: determining the target memory block in the target memory expansion device according to the requested memory size and the requested memory type in the memory application request.
[0101] In specific implementations, the memory expansion device can support extended memory of different memory types, such as RAM (Random Access Memory) and PMEM (Persistent Memory). Extended memory of different memory types can also be divided into multiple memory blocks according to preset sizes. For example, an FPGA CXL extended memory card has 128GB of RAM and 256GB of PMEM. Based on the default block memory size, the RAM memory is divided into four blocks: Region0-Ram, Region1-Ram, Region2-Ram, and Region3-Ram. The PMEM memory is divided into eight blocks: Regino0-Pmem, Regino1-Pmem, Regino2-Pmem, Regino3-Pmem, Regino4-Pmem, Regino5-Pmem, Regino6-Pmem, and Regino7-Pmem. If sub-server 1 applies for 32GB of RAM, the main server will allocate Region0-Ram to it. If sub-server 2 applies for 64GB of RAM, the main server will allocate Region1-Ram and Region2-Ram to it, and so on.
[0102] The server's main resource allocation program determines the target memory block in the target memory expansion device based on the requested memory size and type in the memory request and the resource master table, and allocates the corresponding extended memory to the sub-server. The server's main resource allocation program deletes the resource information of the target memory expansion device from the resource master table and sends the resource information of the target memory block in the target memory expansion device to the sub-server. The sub-server's resource allocation sub-program adds the received resource information of the target memory block in the target memory expansion device to the locally created resource sub-table, allowing it to use the target memory block in the target memory expansion device.
[0103] An example of a resource master table is shown in Table 3:
[0104] Table 3
[0105] An example of a resource sub-table is shown in Table 4:
[0106] Table 4
[0107] As can be seen, in this embodiment, the expanded memory of each memory expansion device is divided into multiple memory blocks based on the smallest unit, providing users with more precise memory areas and corresponding memory sizes. A single memory expansion device can provide more precise memory areas based on user needs and support multiple users simultaneously using different areas of the same board, thereby improving board allocation efficiency.
[0108] An embodiment of the present application discloses a memory expansion method. Referring to FIG6 , a flowchart of another memory expansion method according to an exemplary embodiment is shown. As shown in FIG6 , the method includes:
[0109] S201: Sending a memory application request to the main server; wherein the memory application request includes the memory size to be applied for;
[0110] The execution subject of this embodiment is a sub-server in the server system described above. In a specific implementation, when a sub-server needs to expand its memory, its resource allocation subroutine sends a memory request to the main resource allocation program of the main server, which includes at least the amount of expanded memory to be requested, and then waits for feedback from the main resource allocation program.
[0111] S202: Receive resource information of the target memory expansion device sent by the host server to use the extended memory in the target memory expansion device.
[0112] In a specific implementation, the main resource allocation program of the master server determines a target memory expansion device from among multiple memory expansion devices based on the requested memory size in the memory request and the resource master table, and allocates the corresponding extended memory size to the sub-server. The main resource allocation program of the master server deletes the resource information of the target memory expansion device from the resource master table and sends the resource information of the target memory expansion device to the sub-server via the network port between the main server and the sub-server.
[0113] As a feasible implementation method, using the extended memory in the target memory expansion device includes: creating a resource sub-table and adding the resource information of the target memory expansion device to the resource sub-table; creating a non-consistent memory access node based on the resource information of the target memory expansion device to use the extended memory in the target memory expansion device. In a specific implementation, after the resource allocation subroutine of the sub-server receives the resource information of the target memory expansion device sent by the resource allocation main program, it creates a local resource sub-table and adds the resource information of the target memory expansion device to the resource sub-table. The resource allocation subroutine of the sub-server manages the target memory expansion device and enables its memory expansion function, creates a local new NUMA node to complete the memory expansion of the local server, and then the application of the sub-server can use the extended memory normally.
[0114] Based on this embodiment, as an implementation method, after receiving the resource information of the target memory expansion device sent by the main server to use the extended memory in the target memory expansion device, it also includes: when the extended memory in the target memory expansion device is used up, sending a memory release request to the main server to release the target memory expansion device.
[0115] In a specific implementation, after the sub-server application completes its work, it notifies the resource allocation sub-program that the target memory expansion device has been used up. The resource allocation sub-program then deletes the target memory expansion device's resource information from the device resource sub-table and sends a message to the resource allocation main program, notifying it that the target memory expansion device has been used up. Upon receiving the resource reclaim message, the main server's resource allocation main program backfills the target memory expansion device's resource information into the resource master table, replies to the resource allocation sub-program, notifying it that the target memory expansion device has been reclaimed, and updates the device resource master table. The sub-server's resource allocation sub-program then receives feedback from the resource allocation main program.
[0116] Based on the above embodiment, as an implementation method, receiving resource information of the target memory expansion device sent by the main server to use the extended memory in the target memory expansion device includes: receiving resource information of the target memory block in the target memory expansion device sent by the main server to use the target memory block in the target memory expansion device.
[0117] In a specific implementation, the server's main resource allocation program determines the target memory block in the target memory expansion device based on the requested memory size in the memory request and the resource master table, and allocates the corresponding extended memory size to the sub-server. The server's main resource allocation program deletes the resource information of the target memory expansion device from the resource master table and sends the resource information of the target memory block in the target memory expansion device to the sub-server. The sub-server's resource allocation sub-program adds the received resource information of the target memory block in the target memory expansion device to the locally created resource sub-table, thereby using the target memory block in the target memory expansion device.
[0118] Based on the above embodiment, as an implementation method, the memory application request also includes the memory type to be applied for, and receiving the resource information of the target memory expansion device sent by the main server to use the extended memory in the target memory expansion device, including: receiving the resource information of the target memory block that meets the memory type in the target memory expansion device sent by the main server to use the target memory block in the target memory expansion device.
[0119] In a specific implementation, the server's main resource allocation program determines the target memory block in the target memory expansion device based on the requested memory size and type in the memory request and the resource master table, and allocates the corresponding extended memory to the sub-server. The server's main resource allocation program deletes the resource information of the target memory expansion device from the resource master table and sends the resource information of the target memory block in the target memory expansion device to the sub-server. The sub-server's resource allocation sub-program then adds the received resource information of the target memory block in the target memory expansion device to the locally created resource sub-table, thereby utilizing the target memory block in the target memory expansion device.
[0120] The following describes an application embodiment provided by this application, which specifically includes the following steps:
[0121] Step 1: The resource allocation main program of server 0 scans the memory server and obtains the resource information of all cxl boards:
[0122] device_num=scan_cxl_devices();
[0123] cxl0_attr=scan_cxl_device(cxl0);
[0124] cxl1_attr=scan_cxl_device(cxl1).
[0125] Step 2: The resource allocation main program of server 0 creates the device resource main table and writes all CXL board information into this table:
[0126] creat_table(cxl0_attr,cxl1_attr,....).
[0127] Step 3: The resource allocation main program of server 0 waits for the application message of cxl board from other servers. If server 0 needs to apply for cxl board, the device resource allocation subroutine on server 0 also needs to send an application message to the device resource main program of the local machine:
[0128] wait_msg().
[0129] Step 4: When the application on server 1 requires memory expansion, the resource allocation subroutine on the local machine will send the size of the memory expansion application to the resource allocation main program on server 0 through the network link and wait for feedback from the resource allocation main program.
[0130] ram_size=get_app_ram_size();
[0131] send_msg(ram_size);
[0132] wait_msg().
[0133] Step 5: After receiving the request for memory expansion from the resource allocation subroutine of server 1, the resource allocation main program of server 0 sends the corresponding CXL board information to the resource allocation subroutine based on the size of the requested memory expansion and the CXL board information on the device resource main table, and removes the CXL board from the device resource main table:
[0134] cxl0=Get_device_from_table(ram_size);
[0135] send_msg(cxl0);
[0136] update_table(cxl0).
[0137] Step 6: After receiving the CXL0 board message from the resource allocation main program, the resource allocation subroutine of server 1 creates a local device resource subtable, fills the CXL0 board information into this table, manages the CXL0 board and enables its memory expansion function, creates a local new NUMA node to complete the memory expansion of the local server, and the application can now use the extended memory normally:
[0138] create_table();
[0139] add_device_to_table(cxl0);
[0140] enable_device(cxl0).
[0141] Step 7: After the application on server 1 completes its work, it notifies the resource allocation subroutine that the cxl0 board is ready for use. The resource allocation subroutine removes cxl0 from the device resource subtable and sends a message to the resource allocation main program, notifying it that the cxl0 board is ready for use:
[0142] remove_device_from_table(cxl0);
[0143] send_msg(cxl0).
[0144] Step 8: After receiving the resource recovery message, the resource allocation main program of server 0 fills the cxl0 device back into the device resource main table and replies to the resource allocation subroutine that the cxl0 device has been recovered and updates the device resource main table:
[0145] free_device_to_table(cxl0);
[0146] send_msg(cxl0);
[0147] update_table(cxl0).
[0148] Step 9: After receiving feedback from the resource allocation main program, the resource allocation subroutine of server 1 completes the overall workflow.
[0149] A memory expansion device provided in an embodiment of the present application is introduced below. The memory expansion device described below and the memory expansion method described above can be referenced to each other.
[0150] Referring to FIG. 7 , a structural diagram of a memory expansion device according to an exemplary embodiment is shown. As shown in FIG. 7 , the device includes:
[0151] The first receiving module 701 is used to receive a memory application request from a sub-server;
[0152] A determination module 702 is configured to determine a target memory expansion device from among a plurality of memory expansion devices according to the memory application size in the memory application request;
[0153] The first sending module 703 is configured to send the resource information of the target memory expansion device to the sub-server so that the sub-server can use the extended memory in the target memory expansion device.
[0154] The executor of this embodiment is the main server in the server system. The embodiment of the present application adds a memory server to the server system, including a switch and multiple memory expansion devices. The memory expansion device is connected to the server in the server system through the switch. The multiple memory expansion devices are allocated through the main server. Each memory expansion device no longer corresponds to a fixed server, which meets the ever-changing needs of the server memory and improves the flexibility of the server memory expansion.
[0155] Based on the above embodiment, as an implementation method, the following is further included:
[0156] A scanning module, used for scanning the memory server to obtain resource information of all memory expansion devices in the memory server;
[0157] Add a module to create a resource master table and add resource information of all memory expansion devices to the resource master table.
[0158] Based on the above embodiment, as an implementation mode, the determination module 702 is specifically configured to determine a target memory expansion device from a plurality of memory expansion devices according to the requested memory size in the memory application request and the resource master table.
[0159] Based on the above embodiment, as an implementation method, the following is further included:
[0160] The first deleting module is used to delete the resource information of the target memory expansion device from the resource master table.
[0161] Based on the above embodiment, as an implementation method, the following is further included:
[0162] The third receiving module is configured to receive a memory release request from the sub-server to release the target memory expansion device, and re-add the resource information of the target memory expansion device to the resource master table.
[0163] Based on the above embodiment, as an implementation method, the extended memory includes multiple memory blocks of preset sizes, and the determination module 702 is specifically used to determine the target memory block in the target memory expansion device according to the requested memory size in the memory application request.
[0164] Based on the above embodiment, as an implementation mode, the first sending module 703 is specifically used to: send resource information of the target memory block in the target memory expansion device to the sub-server so that the sub-server can use the target memory block in the target memory expansion device.
[0165] Based on the above embodiment, as an implementation method, the memory expansion device includes extended memories of different memory types, each type of extended memory includes multiple memory blocks of preset sizes, and the determination module 702 is specifically used to: determine the target memory block in the target memory expansion device according to the requested memory size and the requested memory type in the memory application request.
[0166] Based on the above embodiment, as an implementation mode, the first sending module 703 is specifically used to: send resource information of the target memory block in the target memory expansion device to the sub-server so that the sub-server can use the target memory block in the target memory expansion device.
[0167] Based on the above embodiment, as an implementation method, the main server and multiple sub-servers are connected through a network port, and the first sending module 703 is specifically used to: send the resource information of the target memory expansion device to the sub-server through the network port between the main server and the sub-server.
[0168] Based on the above embodiment, as an implementation method, the memory expansion device includes a computing fast link device.
[0169] Another memory expansion device provided in an embodiment of the present application is introduced below. The memory expansion device described below and the other memory expansion method described above can be referenced to each other.
[0170] Referring to FIG8 , a structural diagram of another memory expansion device according to an exemplary embodiment is shown. As shown in FIG8 , the device includes:
[0171] The second sending module 801 is configured to send a memory application request to the primary server; wherein the memory application request includes the memory size to be applied for;
[0172] The second receiving module 802 is configured to receive resource information of a target memory expansion device sent by the host server, so as to use the extended memory in the target memory expansion device.
[0173] The execution subject of this embodiment is the sub-server in the above-mentioned server system.
[0174] Based on the above embodiments, as an implementation method, the second receiving module 802 is specifically used to: receive resource information of the target memory expansion device sent by the main server, create a resource sub-table, and add the resource information of the target memory expansion device to the resource sub-table; create a non-consistent memory access node based on the resource information of the target memory expansion device to use the extended memory in the target memory expansion device.
[0175] Based on the above embodiment, as an implementation method, the following is further included:
[0176] The third sending module is configured to send a memory release request for releasing the target memory expansion device to the main server after the extended memory in the target memory expansion device is completely used.
[0177] Based on the above embodiment, as an implementation method, the following is further included:
[0178] The second deleting module is used to delete the resource information of the target memory expansion device from the local resource sub-table.
[0179] Based on the above embodiment, as an implementation mode, the second receiving module 802 is specifically used to: receive resource information of the target memory block in the target memory expansion device sent by the main server, so as to use the target memory block in the target memory expansion device.
[0180] Based on the above embodiment, as an implementation method, the memory application request also includes the memory type that needs to be applied for, and the second receiving module 802 is specifically used to: receive resource information of the target memory block that meets the memory type in the target memory expansion device sent by the main server, so as to use the target memory block in the target memory expansion device.
[0181] Regarding the apparatus in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0182] Based on the hardware implementation of the above program modules, and in order to implement the method of the embodiment of the present application, the embodiment of the present application further provides an electronic device. FIG9 is a structural diagram of an electronic device according to an exemplary embodiment. As shown in FIG9 , the electronic device includes:
[0183] Communication interface 1, capable of exchanging information with other devices such as network devices;
[0184] The processor 2 is connected to the communication interface 1 to implement information exchange with other devices and is used to execute the memory expansion method provided by one or more of the above technical solutions when running a computer program. The computer program is stored in the memory 3.
[0185] Of course, in actual applications, the various components in the electronic device are coupled together via bus system 4. It will be appreciated that bus system 4 is used to enable communication between these components. In addition to a data bus, bus system 4 also includes a power bus, a control bus, and a status signal bus. However, for clarity, in FIG9 , all of these buses are labeled as bus system 4.
[0186] The memory 3 in the embodiment of the present application is used to store various types of data to support the operation of the electronic device. Examples of such data include: any computer program used to operate on the electronic device.
[0187] It is understood that the memory 3 can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), or a non-volatile memory.
[0188] (EPROM, Erasable Programmable Read-Only Memory), Electrically Erasable Programmable Read-Only Memory
[0189] Volatile memory can be Electrically Erasable Programmable Read-Only Memory (EEPROM), Ferromagnetic Random Access Memory (FRAM), Flash Memory, Magnetic Surface Storage, Optical Disc, or Compact Disc Read-Only Memory (CD-ROM); Magnetic surface storage can be magnetic disk storage or magnetic tape storage. Volatile memory can be Random Access Memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), synchronous static random access memory (SSRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct rambus random access memory (DRRAM). The memory 3 described in the embodiments of the present application is intended to include, but is not limited to, these and any other suitable types of memory.
[0190] The method disclosed in the above-mentioned embodiment of the present application can be applied to processor 2 or implemented by processor 2. Processor 2 may be an integrated circuit with signal processing capabilities. During implementation, each step of the above-mentioned method can be completed by the hardware integrated logic circuit in processor 2 or instructions in software form. The above-mentioned processor 2 can be a general-purpose processor, DSP, or other programmable logic device, discrete gate or transistor logic device, discrete hardware component, etc. Processor 2 can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiment of the present application. A general-purpose processor can be a microprocessor or any conventional processor, etc. The steps of the method disclosed in the embodiment of the present application can be directly embodied as being executed by a hardware decoding processor, or being executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a non-volatile readable storage medium, which is located in memory 3. Processor 2 reads the program in memory 3 and completes the steps of the above-mentioned method in combination with its hardware.
[0191] When the processor 2 executes the program, the corresponding processes in each method of the embodiment of the present application are implemented. For the sake of brevity, they are not repeated here.
[0192] In an exemplary embodiment, the present application also provides a non-volatile readable storage medium, specifically a computer-readable non-volatile storage medium, such as a memory 3 storing a computer program. The computer program can be executed by a processor 2 to perform the aforementioned method steps. The computer-readable non-volatile storage medium can be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface mount storage, optical disk, CD-ROM, or the like.
[0193] Those skilled in the art will understand that all or part of the steps of implementing the above-mentioned method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer non-volatile readable storage medium. When the program is executed, it executes the steps of the above-mentioned method embodiment; and the aforementioned non-volatile readable storage medium includes: mobile storage devices, ROM, RAM, magnetic disks or optical disks, etc. Various media that can store program codes.
[0194] Alternatively, if the above-mentioned integrated unit of the present application is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer non-volatile readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a non-volatile readable storage medium and includes a number of instructions for enabling an electronic device (which can be a personal computer, server, network device, etc.) to execute all or part of the methods of each embodiment of the present application. The aforementioned non-volatile readable storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, RAM, magnetic disks or optical disks.
[0195] The above are only specific embodiments of the present application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
Claims
1. A memory expansion method, characterized in that: A main server applied to a server system, the server system comprising a plurality of servers and a memory server, the server comprising the main server and a plurality of sub-servers, the memory server comprising a switch and a plurality of memory expansion devices, the plurality of memory expansion devices being connected to the switch, the plurality of servers being connected to the switch, and the memory expansion device comprising an extended memory; The method comprises: receiving a memory application request from the sub-server; Determining a target memory expansion device from among the plurality of memory expansion devices according to the requested memory size in the memory application request; The resource information of the target memory expansion device is sent to the sub-server so that the sub-server can use the extended memory in the target memory expansion device.
2. The memory expansion method according to claim 1, characterized in that: Before receiving the memory application request of the sub-server, the method further includes: Scanning the memory server to obtain resource information of all the memory expansion devices in the memory server; A resource master table is created, and resource information of all the memory expansion devices is added to the resource master table.
3. The memory expansion method according to claim 2, characterized in that: The step of determining a target memory expansion device from among the plurality of memory expansion devices according to the requested memory size in the memory application request includes: A target memory expansion device is determined from among the plurality of memory expansion devices according to the memory application size in the memory application request and the resource master table.
4. The memory expansion method according to claim 3, characterized in that: After determining the target memory expansion device from the plurality of memory expansion devices according to the memory application size in the memory application request and the resource master table, the method further includes: The resource information of the target memory expansion device is deleted from the resource master table.
5. The memory expansion method according to claim 2, characterized in that: After sending the resource information of the target memory expansion device to the sub-server so that the sub-server uses the extended memory in the target memory expansion device, the method further includes: A memory release request for releasing the target memory expansion device is received from the sub-server, and resource information of the target memory expansion device is added to the resource master table again.
6. The memory expansion method according to claim 1, characterized in that: The extended memory includes a plurality of memory blocks of preset sizes, and determining a target memory expansion device from the plurality of memory expansion devices according to the requested memory size in the memory application request includes: A target memory block in a target memory expansion device is determined according to the requested memory size in the memory request.
7. The memory expansion method according to claim 6, characterized in that: Sending resource information of the target memory expansion device to the sub-server so that the sub-server uses the extended memory in the target memory expansion device includes: The resource information of the target memory block in the target memory expansion device is sent to the sub-server so that the sub-server uses the target memory block in the target memory expansion device.
8. The memory expansion method according to claim 1, characterized in that: The memory expansion device includes expansion memories of different memory types, each type of expansion memory includes a plurality of memory blocks of preset sizes, and determining a target memory expansion device from the plurality of memory expansion devices according to the application memory size in the memory application request includes: The target memory block in the target memory expansion device is determined according to the requested memory size and the requested memory type in the memory request.
9. The memory expansion method according to claim 8, characterized in that: Sending resource information of the target memory expansion device to the sub-server so that the sub-server uses the extended memory in the target memory expansion device includes: The resource information of the target memory block in the target memory expansion device is sent to the sub-server so that the sub-server uses the target memory block in the target memory expansion device.
10. The memory expansion method according to claim 1, characterized in that: The main server and the plurality of sub-servers are connected via a network port, and the resource information of the target memory expansion device is sent to the sub-server, including: sending the resource information of the target memory expansion device to the sub-server via the network port between the main server and the sub-server.
11. The memory expansion method according to claim 1, characterized in that: The memory expansion device includes a computing fast link device.
12. A memory expansion method, characterized in that: A sub-server applied to a server system, wherein the server system includes multiple servers and a memory server, wherein the server includes a main server and multiple sub-servers, wherein multiple servers are connected to the memory server, wherein the memory server includes a switch and multiple memory expansion devices, wherein multiple memory expansion devices are connected via the switch, and wherein the memory expansion device includes an extended memory; The method comprises: Sending a memory application request to the main server; wherein the memory application request includes the memory size to be applied for; receiving resource information of the target memory expansion device sent by the main server to use the extended memory in the target memory expansion device.
13. The memory expansion method according to claim 12, characterized in that: The step of using the extended memory in the target memory expansion device comprises: Creating a resource sub-table, and adding resource information of the target memory expansion device to the resource sub-table; A non-uniform memory access node is created based on the resource information of the target memory expansion device to use the extended memory in the target memory expansion device.
14. The memory expansion method according to claim 12, characterized in that: After receiving the resource information of the target memory expansion device sent by the main server to use the extended memory in the target memory expansion device, it also includes: when the extended memory in the target memory expansion device is used up, sending a memory release request to the main server to release the target memory expansion device.
15. The memory expansion method according to claim 14, characterized in that: Before sending the memory release request for releasing the target memory expansion device to the main server, the method further includes: The resource information of the target memory expansion device is deleted from the local resource sub-table.
16. The memory expansion method according to claim 12, characterized in that: The receiving resource information of the target memory expansion device sent by the main server to use the extended memory in the target memory expansion device includes: Receive resource information of a target memory block in a target memory expansion device sent by the main server to use the target memory block in the target memory expansion device.
17. The memory expansion method according to claim 12, characterized in that: The memory application request also includes a memory type to be applied for. The receiving of resource information of the target memory expansion device sent by the host server to use the extended memory in the target memory expansion device includes: The resource information of the target memory block in the target memory expansion device that meets the memory type is received from the main server, so as to use the target memory block in the target memory expansion device.
18. A memory expansion device, characterized in that: A main server applied to a server system, the server system comprising a plurality of servers and a memory server, the server comprising the main server and a plurality of sub-servers, a plurality of the servers being connected to the memory server, the memory server comprising a switch and a plurality of memory expansion devices, a plurality of the memory expansion devices being connected to the switch, and the memory expansion device comprising an extended memory; The device comprises: A first receiving module is configured to receive a memory application request from the sub-server; A determination module, configured to determine a target memory expansion device from among the plurality of memory expansion devices according to the requested memory size in the memory application request; The first sending module is configured to send the resource information of the target memory expansion device to the sub-server so that the sub-server can use the extended memory in the target memory expansion device.
19. A memory expansion device, characterized in that: A sub-server applied to a server system, wherein the server system includes multiple servers and a memory server, wherein the server includes a main server and multiple sub-servers, wherein multiple servers are connected to the memory server, wherein the memory server includes a switch and multiple memory expansion devices, wherein multiple memory expansion devices are connected via the switch, and wherein the memory expansion device includes an extended memory; The device comprises: A second sending module is configured to send a memory application request to the main server; wherein the memory application request includes a memory size to be applied for; The second receiving module is configured to receive resource information of the target memory expansion device sent by the main server, so as to use the extended memory in the target memory expansion device.
20. A server system, characterized in that: It includes multiple servers and a memory server, wherein the server includes a main service and multiple sub-servers, multiple servers are connected to the memory server, the memory server includes a switch and multiple memory expansion devices, multiple memory expansion devices are connected to the switch, multiple servers are connected to the switch, and the memory expansion device includes extended memory.
21. An electronic device, characterized in that: include: a memory configured to store a computer program; A processor, configured to implement the steps of the memory expansion method as claimed in any one of claims 1 to 17 when executing the computer program.
22. A computer non-volatile readable storage medium, characterized in that: The computer non-volatile readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the memory expansion method according to any one of claims 1 to 17 are implemented.
Citation Information
Patent Citations
Method, device and system for achieving memory access
CN106155910A
Extended-memory device, extended-memory system, and memory access method of extended-memory
CN109189700A
Switching chip, memory expansion module and memory expansion system
CN116886644A
Server system, configuration method, CPU, control module and storage medium
CN117033001A
Memory extension method and device, server system, electronic equipment and storage medium
CN117555687A