Memory space management method and management equipment
By dividing the logical devices in the extended memory device into multiple memory space fragments and allocating them on demand, the problem of low memory space utilization in the prior art is solved, and a finer-grained memory space management and higher utilization are achieved.
Patent Information
- Application Number
- CN202311385807.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-24
- Publication Date
- 2025-04-25
AI Technical Summary
Due to the limitation of the pin count of the CPU that can be connected to the memory device, it is difficult for the CPU to provide more memory devices. The existing technology can only allocate memory space according to the logical device size and cannot be scheduled on demand, resulting in low memory space utilization.
By further dividing the logical devices in the extended memory device into multiple memory space fragments and establishing data structures to manage these fragments, a fine-grained memory space allocation of computing devices is realized, allowing one logical device to be allocated to multiple computing devices on demand.
A more fine-grained memory space division is achieved, memory space utilization is improved, and the limitation that a single logical device can only be allocated to one computing device.
Smart Images

Figure CN119883584A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of memory space management, and in particular to a memory space management method and management device. Background Art
[0002] Current computing devices are limited by the number of pins that can be connected to memory devices on the central processing unit (CPU), making it difficult to provide more memory devices for the CPU. The Compute Express Link (CXL) protocol proposes that more memory space can be connected using the Peripheral Component Interconnect Express (PCIe) channel through the CXL protocol. A memory device can include one or more logical devices, but currently a logical device can only be allocated to one computing device. That is, it can only be allocated at a fixed granularity according to the size of a logical device, and cannot be better scheduled on demand, resulting in low memory space utilization. Summary of the invention
[0003] The embodiments of the present application provide a memory space management method and a management device, which can achieve more fine-grained memory space division, avoid a single logical device being assigned to only one computing device, and can assign a logical device to multiple computing devices as needed, thereby improving memory space utilization.
[0004] In a first aspect, an embodiment of the present application provides a memory space management method, including:
[0005] Determining that a memory space of a first capacity needs to be allocated to the computing device;
[0006] A target memory segment allocated to the computing device is determined according to a first data structure, wherein the capacity of the target memory segment is greater than or equal to the first capacity, wherein the first data structure includes information of each memory segment in a plurality of memory segments, the plurality of memory segments are memory segments obtained by dividing the memory space of a logical device in an extended memory device, and the plurality of memory segments include the target memory segment.
[0007] The method may be executed or implemented by a management device or a processor in the management device.
[0008] The above method further divides the logical device in the extended memory device to obtain multiple memory space fragments, and allocates the memory space fragments to computing devices on demand, which can achieve more fine-grained memory space division, avoid a single logical device can only be allocated to one computing device, a logical device can be allocated to multiple computing devices on demand, and improve memory space utilization.
[0009] In a possible implementation, the method may further include: before determining that memory space needs to be allocated to the computing device, further including:
[0010] Determine the information of the logical devices contained in the extended memory device;
[0011] Dividing the memory space of the logical device included in the extended memory device into a plurality of memory segments;
[0012] The first data structure is established according to the multiple memory fragments obtained by division.
[0013] The above method further divides the logical device in the extended memory device into multiple memory space segments, which can achieve more fine-grained memory space division.
[0014] In a possible implementation, the information of the memory segment includes an identifier of the memory segment, address information of the memory segment, a capacity of the memory segment, and a usage status of the memory segment, where the usage status of the memory segment is used to indicate whether the memory segment is currently occupied;
[0015] The usage status of the target memory segment indicates that the target memory segment is currently not occupied.
[0016] The above method stores the information of the memory segments in the first data structure, which can facilitate the subsequent management device to allocate the memory segments according to the first data structure.
[0017] In a possible implementation, the method may further include:
[0018] Update the usage status corresponding to the target memory segment in the first data structure to being allocated;
[0019] Sending a first message to the computing device, the first message including address information of the target memory segment, the address information being used to determine a physical address of the target memory segment;
[0020] receiving a second message sent by the computing device, where the second message is used to notify the computing device of binding with the physical address of the target memory segment;
[0021] According to the second message, the information of the target memory segment is updated in the first data structure.
[0022] The above method, on the one hand, after determining the target memory segment to be allocated to the computing device, updates the usage status corresponding to the target memory segment to being allocated in the first data structure to avoid allocating the target memory segment to other computing devices; on the other hand, through the interaction between the management device and the computing device, the physical address of the target memory segment can be bound to the computing device, and the information of the target memory segment can be updated in real time, which facilitates the effective management of the entire allocation process and reduces the probability of errors.
[0023] In a possible implementation, updating the information of the target memory segment in the first data structure according to the second message includes:
[0024] Update the usage status corresponding to the target memory segment in the first data structure to currently occupied;
[0025] The IP address information corresponding to the target memory segment is added to the first data structure, where the IP address information includes the IP address of the computing device.
[0026] The above method, after the computing device is bound to the physical address of the target memory segment, further updates the usage status corresponding to the target memory segment to currently occupied to avoid repeated allocation, and adds the IP address of the computing device occupying the target memory segment to the first data structure, which can facilitate the management of the computing device using the memory segment.
[0027] In a possible implementation, the number of the computing devices is at least two, and the at least two computing devices are computing devices requesting to share the same memory segment;
[0028] The sending a first message to the computing device includes:
[0029] Sending the first message to the at least two computing devices respectively;
[0030] The receiving a second message sent by the computing device includes:
[0031] The second messages sent by the at least two computing devices are received respectively.
[0032] The above method can enable at least two computing devices to share the same memory segment, thereby improving the communication efficiency between the at least two computing devices sharing the same memory segment.
[0033] In a possible implementation, the number of the computing devices is at least two, and the at least two computing devices are computing devices requesting to share the same memory segment;
[0034] The IP address information includes IP addresses of the at least two computing devices.
[0035] In the above method, at least two computing devices share the same memory segment, and the IP addresses of the at least two computing devices are updated into the first data structure, so as to facilitate the determination of the computing devices sharing the same memory segment.
[0036] In a possible implementation, the method further includes:
[0037] receiving a release request sent by the computing device, the release request being used to request the release of a free memory segment, the free memory segment being one or more memory segments allocated to the computing device;
[0038] The usage status of the free memory segment in the first data structure is updated to unoccupied; and the IP address information corresponding to the free memory segment in the first data structure is deleted.
[0039] The above method can release the idle memory segments in time and improve the space utilization of the memory segments.
[0040] In a possible implementation, the method further includes:
[0041] A third message is sent to the computing device, where the third message is used to notify the computing device that the physical address unbinding from the free memory segment is completed.
[0042] The above method can further notify the computing device after the usage status of the free memory segment is updated in the first data structure, thereby improving communication reliability.
[0043] In a possible implementation, the information of the memory segment in the first data structure further includes the number of errors of the memory segment;
[0044] The step of determining a target memory segment allocated to the computing device according to the first data structure comprises:
[0045] Determine from the first data structure a target memory segment whose number of errors is less than or equal to a first threshold and whose capacity is greater than or equal to the first capacity; or,
[0046] The information of the memory segment in the first data structure also includes the number of times the memory segment is allocated;
[0047] The step of determining a target memory segment allocated to the computing device according to the first data structure comprises:
[0048] Determine from the first data structure a target memory segment whose number of allocations is less than or equal to a second threshold and whose capacity is greater than or equal to the first capacity; or,
[0049] The information of the memory segment in the first data structure also includes the number of reads and writes of the memory segment;
[0050] The step of determining a target memory segment allocated to the computing device according to the first data structure includes:
[0051] Determine from the first data structure a target memory segment whose number of read and write times is less than or equal to a third threshold and whose capacity is greater than or equal to the first capacity.
[0052] In a possible implementation, determining that a memory space of a first capacity needs to be allocated to the computing device includes:
[0053] When receiving a memory space application request sent by the computing device, determining that a memory space of a first capacity needs to be allocated to the computing device, the memory space application request including the first capacity that the computing device needs to apply for; or
[0054] When a local operation command is received, it is determined that a memory space of a first capacity needs to be allocated to the computing device, and the local operation command is used to instruct to allocate a memory space of the first capacity to the computing device.
[0055] By implementing this method, the memory management method of the embodiment of the present application can be applied to a variety of scenarios to meet the needs of a variety of scenarios.
[0056] In a possible implementation, before receiving the release request sent by the computing device, the method further includes:
[0057] A reclaim command is sent to the computing device, wherein the reclaim command instructs to reclaim the memory segment allocated to the computing device.
[0058] By implementing this method, the management device can actively request the computing device to reclaim the memory fragment, satisfying the scenario of the management device's active request.
[0059] In a second aspect, an embodiment of the present application further provides a management device, comprising: a processor, a memory, the memory being coupled to the processor; the memory being used to store computer instructions; the processor being used to call the computer instructions to execute:
[0060] Determining that a memory space of a first capacity needs to be allocated to the computing device;
[0061] A target memory segment allocated to the computing device is determined according to a first data structure, wherein the capacity of the target memory segment is greater than or equal to the first capacity, wherein the first data structure includes information of each memory segment in a plurality of memory segments, the plurality of memory segments are memory segments obtained by dividing the memory space of a logical device in an extended memory device, and the plurality of memory segments include the target memory segment.
[0062] In a possible implementation, the processor is further configured to execute:
[0063] Determine the information of the logical devices contained in the extended memory device;
[0064] Dividing the memory space of the logical device included in the extended memory device into a plurality of memory segments;
[0065] The first data structure is established according to the multiple memory fragments obtained by division.
[0066] In a possible implementation, the information of the memory segment includes an identifier of the memory segment, address information of the memory segment, a capacity of the memory segment, and a usage status of the memory segment, where the usage status of the memory segment is used to indicate whether the memory segment is currently occupied;
[0067] The usage status of the target memory segment indicates that the target memory segment is currently not occupied.
[0068] In a possible implementation, the processor is further configured to execute:
[0069] Update the usage status corresponding to the target memory segment in the first data structure to being allocated;
[0070] Sending a first message to the computing device, the first message including address information of the target memory segment, the address information being used to determine a physical address of the target memory segment;
[0071] receiving a second message sent by the computing device, where the second message is used to notify the computing device of binding with the physical address of the target memory segment;
[0072] According to the second message, the information of the target memory segment is updated in the first data structure.
[0073] In a possible implementation, the processor updates the information of the target memory segment in the first data structure according to the second message, including executing:
[0074] Update the usage status corresponding to the target memory segment in the first data structure to currently occupied;
[0075] The IP address information corresponding to the target memory segment is added to the first data structure, where the IP address information includes the IP address of the computing device.
[0076] In a possible implementation, the number of the computing devices is at least two, and the at least two computing devices are computing devices requesting to share the same memory segment; the processor executes sending a first message to the computing devices, including executing:
[0077] Sending the first message to the at least two computing devices respectively;
[0078] The processor executes receiving a second message sent by the computing device, including executing:
[0079] The second messages sent by the at least two computing devices are received respectively.
[0080] In a possible implementation, the number of the computing devices is at least two, and the at least two computing devices are computing devices requesting to share the same memory segment;
[0081] The IP address information includes IP addresses of the at least two computing devices.
[0082] In a possible implementation, the processor is further configured to execute:
[0083] receiving a release request sent by the computing device, the release request being used to request the release of a free memory segment, the free memory segment being one or more memory segments allocated to the computing device;
[0084] The usage status of the free memory segment in the first data structure is updated to unoccupied; and the IP address information corresponding to the free memory segment in the first data structure is deleted.
[0085] In a possible implementation, the processor is further configured to execute:
[0086] A third message is sent to the computing device, where the third message is used to notify the computing device that the physical address unbinding from the free memory segment is completed.
[0087] In a possible implementation, the information of the memory segment in the first data structure also includes the number of errors of the memory segment; the processor determines the target memory segment allocated to the computing device according to the first data structure, including: determining from the first data structure a target memory segment whose number of errors is less than or equal to a first threshold and whose capacity is greater than or equal to the first capacity; or,
[0088] The information of the memory segment in the first data structure also includes the number of times the memory segment is allocated;
[0089] The processor determines, according to the first data structure, a target memory segment allocated to the computing device, including:
[0090] Determine from the first data structure a target memory segment whose number of allocations is less than or equal to a second threshold and whose capacity is greater than or equal to the first capacity; or,
[0091] The information of the memory segment in the first data structure also includes the number of reads and writes of the memory segment;
[0092] The processor determines, according to the first data structure, a target memory segment allocated to the computing device, including:
[0093] Determine from the first data structure a target memory segment whose number of read and write times is less than or equal to a third threshold and whose capacity is greater than or equal to the first capacity.
[0094] In a third aspect, an embodiment of the present application further provides a computer storage medium, comprising computer instructions, which, when executed on a server, enable the server to execute a method as described in the first aspect or any possible implementation of the first aspect.
[0095] In a fourth aspect, an embodiment of the present application further provides a computer program product, which, when executed on a server, enables the server to execute the method described in the first aspect or any possible implementation of the first aspect.
[0096] It can be understood that the management device provided in the second aspect, the computer storage medium provided in the third aspect, and the computer program product provided in the fourth aspect can all implement the method provided in the first aspect. Therefore, the beneficial effects that can be achieved can refer to the corresponding beneficial effects in the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0097] Figure 1a It is a schematic diagram of a system architecture for memory expansion;
[0098] Figure 1b It is a schematic diagram of another system architecture for memory expansion;
[0099] Figure 2 It is a computing system architecture diagram provided by an embodiment of the present application;
[0100] Figure 3 It is a flowchart of a memory space management method provided in an embodiment of the present application;
[0101] Figure 4a It is a flowchart of a memory space management method provided by an embodiment of the present application;
[0102] Figure 4bIt is a flowchart of another memory space management method provided by an embodiment of the present application;
[0103] Figure 4c This is a flowchart of another memory space management method provided by an embodiment of the present application;
[0104] Figure 5a It is a flowchart of a memory space management method provided by an embodiment of the present application;
[0105] Figure 5b It is a flowchart of another memory space management method provided by an embodiment of the present application;
[0106] Figure 6 is a flow chart of a memory space management method provided by an embodiment of the present application;
[0107] Figure 7 It is a structural diagram of a computing device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0108] 1. Compute eXtended Link (CXL) Protocol
[0109] The CXL protocol is a high-speed serial protocol that enables fast and reliable data transmission between different components inside a computing device. For example, between the central processing unit (CPU) and the accelerator, memory buffer, and smart network interface card (Smart NIC). In addition, the CXL protocol can also be used in scenarios such as artificial intelligence machine learning (AI Machine Learning) and high-performance computing. The CXL protocol includes sub-protocols such as the CXL.io protocol, the CXL.cache protocol, and the CXL.memory protocol.
[0110] Current computers are limited by the number of CPU pins that can connect to memory, making it difficult to provide the CPU with more memory devices (including but not limited to volatile memory and non-volatile memory). CXL can be used to expand the CPU's memory and overcome the performance and slot packaging limitations of ordinary Dual-Inline-Memory-Modules (DIMM) memory.
[0111] like Figure 1a As shown in FIG. 1 , a schematic diagram of a system architecture for memory expansion is shown in FIG. Figure 1aAs shown, the system architecture includes two computing devices, namely computing device 1 and computing device 2, wherein each computing device includes a CPU and a local memory. The CPU can not only be connected to the local memory through a pin, but also be connected to one or more extended memory devices through a CXL device. Figure 1a In the example, eight extended memory devices are connected. The CXL device may be a CXL control chip or other device. An extended memory device may be a single logic device (SLD) type or a multi logic device (MLD) type. Of course, in other embodiments, the number of computing devices included in the system architecture may be more than two.
[0112] Currently, when allocating extended memory space to computing devices, it is allocated at the granularity of logical devices, that is, one logical device can only be allocated to one computing device for use. For example, if extended memory device 1 is of SLD type, memory device 1 can only be used by computing device 1 or computing device 2.
[0113] To solve the above technical problems, in the embodiment of the present application, a logical device can be divided into multiple memory segments, so as to share the memory segments at the granularity, so that multiple computing devices can share the same extended memory device, and the multiple computing devices are two or more computing devices. Figure 1b In the example, an extended memory device is shared between computing device 1 and computing device 2.
[0114] like Figure 1b As shown, the memory space of the extended memory devices 1 to 8 extended by the CXL device is pooled and shared, that is, the memory space of each logical device in the extended memory devices 1 to 8 is sliced to obtain multiple memory fragments, and the capacity of each memory fragment can be flexibly determined according to demand. One memory fragment can be shared with the computing device 1 and / or the computing device 2, thereby improving the memory space utilization and realizing finer-grained division and sharing.
[0115] 2. SLD
[0116] An SLD is a memory device that consists of only one logical device. For example, if Figure 1a and Figure 1b The extended memory device in can include only one logical device, and the type of the memory device is SLD.
[0117] 3. Multi Logic Device (MLD)
[0118] MLD is a memory device that contains multiple logical devices. Multiple logical devices can be allocated to multiple computing devices respectively, but one logical device can only be allocated to one computing device.
[0119] 4. Multi Head Single Logic Device (MH-SLD)
[0120] An SLD with multiple ports can be physically connected to multiple computing devices at the same time.
[0121] 5.FM
[0122] FM is used to uniformly manage the CXL memory space of the memory pool composed of one or more extended memory devices. It is responsible for slicing the logical devices of the extended memory devices and then allocating them to various computing devices.
[0123] 6. Local CXL Space Management Daemon (LMD)
[0124] LMD is deployed on a computing device and is used by the computing device to apply for memory space from FM and manage the memory space locally. LMD can provide memory access and use to the application program of the computing device, and can also convert the memory space into the system's non-uniform memory access architecture (NUMA) memory space and transfer it to the operating system kernel for management.
[0125] 7. Physical Logic Device (PLD)
[0126] A CXL device may correspond to a PLD, and a PLD may include a CXL device and multiple extended memory devices extended by the CXL device. Figure 1a or Figure 1b As shown, the CXL device and the extended memory devices 1 to 8 extended by the CXL device are collectively referred to as a PLD.
[0127] 8. Virtual Logic Device (VLD)
[0128] The memory space of a logical device is divided into multiple memory segments, each of which can be called a VLD and is managed as a VLD in FM.
[0129] 9. Virtual Logic Device identification (VID)
[0130] VID is an identifier used to manage the numbering of VLD segments.
[0131] Please refer to Figure 2 , is a computing system architecture diagram provided in an embodiment of the present application, such as Figure 2 As shown, the computing system includes multiple computing devices, CXL devices, and extended memory devices. The extended memory devices are, for example, extended memory devices 1 to M, and the computing devices are, for example, computing devices 1 to N.
[0132] Multiple computing devices may be connected to corresponding extended memory devices via a CXL device, wherein multiple computing devices may be connected to the same extended memory device and use different storage spaces of the extended memory device.
[0133] A computing device is a computing device with data processing, logical operation and storage functions. For example, the computing device may include computing devices such as servers, tablet computers, desktop computers, laptop computers, notebook computers or netbooks. Among them, the server can be different types of servers such as rack servers, blade servers or tower servers. The server can also be a GPU server. The server may include one computing node or multiple computing nodes, each computing node includes at least one central processing unit (CPU). When the server includes multiple computing nodes, multiple CPUs in the multiple computing nodes share a set of operating systems.
[0134] The extended memory device connected to the CXL device may include a CXL control chip and a memory. The memory may include a dual inline memory module (DIMM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a solid state disk (SSD), or a persistent memory (PMEM). The memory is the actual physical carrier that provides storage space for the computing device.
[0135] The CXL control chip is used to write data to the memory in the extended memory device or read data from the memory according to the read / write data request sent by the computing node. The CXL control chip is also called the memory expansion (CXL memory expander) chip, CXL memory controller (CXL memory expander controller) or CXL memory pooling (CXL memory expander pooling) chip.
[0136] The above-mentioned flexible implementation and deployment methods can make the extended memory device compatible with memories of more media types. The embodiments of the present application do not limit the media type, quantity, and deployment method of the memories.
[0137] CXL devices can provide expansion interfaces to connect multiple computing devices to expansion memory devices. CXL devices can be set up independently or integrated into any computing device or memory device.
[0138] Exemplarily, when a CXL device is independently configured, the CXL device may be a CXL switch, which includes a CXL switch chip; or the CXL device may be a multi-head CXL memory expansion card. When the number of extended memory devices is one, the CXL device may be integrated on the extended memory device, and the CXL device may be a multi-head CXL memory expansion card, which may serve as a CXL control chip for the extended memory device. When the CXL device is integrated on a computing device, the CXL device may be a CXL switch, a CXL switch chip, or a multi-head CXL memory expansion card. In addition to the extended function, the CXL Switch also has a processor, which has a processing function, such as being able to run FM.
[0139] Each computing device is deployed with an LMD. The type of the extended memory device can be an SLD type or an MLD type, which is not limited in the present embodiment. The CXL device can connect multiple computing devices and multiple extended memory devices at the same time. Figure 2 In the example, one CXL device is taken as an example. It is understandable that the system architecture may also include multiple CXL devices, and each CXL device may be connected to each computing device of the N computing devices, or to some computing devices of the N computing devices.
[0140] LMD is deployed on a computing device and is used by the computing device to apply for memory space from FM and to manage the applied memory space locally. One LMD is deployed on one computing device.
[0141] In the embodiment of the present application, FM can be run on a computing device, for example, Figure 2 The FM may be a computing device in computing devices 1 to N, or the FM may be run independently in a management system, for example, in a server, or the FM may be run on a CXL device, for example, on a CXL Switch. In the embodiment of the present application, the device deploying the FM is referred to as a management device.
[0142] In some implementations, FM may run in a CPU or baseboard management controller (BMC) of any computing device, or in a processor of a CXL device, or in a CPU, BMC, or controller of an independent device. The embodiments of the present application do not limit the specific running location of FM.
[0143] FM is used to identify all extended memory devices and the capacity space of extended memory devices, and divide the memory space of the logical device in the extended memory device into multiple memory segments. A memory segment can be called a VLD, and an ID is assigned to each VLD. FM manages all assigned VLDs. For example, it includes but is not limited to the following management functions: determining the computing device node currently using the VLD; determining the usage status of the VLD; recording the capacity of the VLD; the starting logical block addressing (Logical Block Addressing, LBA) address and the ending LBA address of the VLD; further optionally, FM can also implement the following management functions for the VLD: numbering the VLD; determining the health status of the VLD; determining the serial number (SerialNumber, SN) of the corresponding CXL device; determining the SN of the corresponding extended memory device.
[0144] FM can allocate VLD's memory space to each computing device, which is managed by LMD on each computing device. LMD can provide memory access and use to the application of this computing device, and can also convert the memory space into the system's numa memory space and transfer it to the operating system kernel for management.
[0145] exist Figure 2 In the embodiment, the number of the extended memory devices connected through the CXL device may be one or more, and the one or more extended memory devices constitute an extended memory pool.
[0146] Please refer to Figure 3 , is a flowchart of a memory space management method provided in an embodiment of the present application, such as Figure 3 As shown, the flowchart of the memory space management method includes but is not limited to the following steps. It can be understood that in some implementations, some steps but not all steps of the following steps may be included:
[0147] 101. A management device determines information of a logical device included in an extended memory device.
[0148] The extended memory device is an extended memory device in an extended memory pool of the computing system.
[0149] In the embodiment of the present application, the computing system may include a computing device, a CXL device, and an extended memory device. A CXL device may be connected to one or more computing devices and one or more extended memory devices. The specific example of the architecture of the computing system may be referred to Figure 2 In the computing system shown, LMD is deployed on each computing device. FM is deployed on the management device, and the management device is connected to the CXL device. After FM is started, the local file is loaded for initialization configuration. After the LMD on each computing device is running, a series of initialization processes are also performed.
[0150] The management device may obtain the extended memory device in a manner that the FM deployed on the management device calls the CXL CLI module interface to scan all CXL devices in the computing system and obtain the information of the CXL device. For example, the CXL CLI Module is used to call the CXL driver of the kernel or the software development kit (SDK) provided by the extended memory device manufacturer to obtain the information of the CXL device. The information of the CXL device may include: the unique identifier of the CXL device, the number of extended memory devices extended by the CXL device, and the information of the extended memory devices extended by the CXL device. Among them, the information of the extended memory device may include the information of the logical device of the extended memory device, for example, the information of the logical device of the extended memory device may include: the extended memory device is of SLD type or MLD type. Further optionally, the information of the extended memory device may also include the physical start address of the memory space of the extended memory device, the memory space capacity of the extended memory device, the physical end address of the memory space of the extended memory device, etc. The information of the logical device of the extended memory device may also include the physical start address of the memory space of the logical device in the extended memory device, the memory space capacity of the logical device, and the physical end address of the memory space of the logical device, etc. If the extended memory device is of MLD type, the information of the logical device of the extended memory device may include information of each logical device in the plurality of logical devices.
[0151] The management device may store the scanned CXL device information in a memory or file in a certain format. In some implementations, the management device may generate a second data structure based on the scanned CXL device information, one CXL device corresponding to one second data structure, and the second data structure includes a correspondence between the CXL device and the extended memory device.
[0152] Exemplarily, the second data structure may be a PLD Table List, one CXL device corresponds to one PLD Table List, and a correspondence between the CXL device and the extended memory device may be established through the PLD Table List. The PLD Table List may include: an identifier of the CXL device, the number of extended memory devices extended through the CXL device, and information of the extended memory devices extended through the CXL device. For a detailed description of the information of the extended memory device, please refer to the description of the aforementioned implementation, which will not be repeated here.
[0153] 102. The management device divides the memory space of the logical device included in the extended memory device into a plurality of memory segments.
[0154] In some embodiments, the memory space of any logical device included in the extended memory device can be divided into multiple memory segments. The physical address of a memory segment can be continuous or discontinuous, which is not limited in this application. The capacity of each memory segment can be the same or different, which is not limited in this application. As an example, the management device can divide the memory space of the logical device of each extended memory device in the extended memory pool into memory segments. As another example, the management device can divide the memory space of some logical devices in the extended memory pool into memory segments.
[0155] As an example, if the extended memory device is of SLD type, that is, the extended memory device includes one logical device, the one logical device included in the extended memory device is divided into memory segments.
[0156] As another example, if the extended memory device is of MLD type, that is, the extended memory device includes multiple logical devices, each of the multiple logical devices is divided into memory segments.
[0157] In one implementation, the memory space of the logical devices in all the extended memory devices extended by a CXL device may be uniformly divided, that is, the memory space of each logical device in all the extended memory devices extended by the CXL device is pooled and divided into multiple memory segments, for example, the capacity of each memory segment may be the same. In this implementation, uniformly dividing the memory space of the logical devices in all the extended memory devices extended by a CXL device may also be understood as uniformly dividing the memory space of all the extended memory devices in each PLD.
[0158] In another implementation, the memory space of the logical devices in all the extended memory devices extended by all the CXL devices may be uniformly divided, that is, the memory space of each logical device in all the extended memory devices extended by all the CXL devices may be divided into multiple memory segments, for example, the capacity of each memory segment may be the same.
[0159] In yet another implementation, the memory space of a logical device in an extended memory device may be divided into a plurality of memory segments. For example, the capacity of each memory segment may be the same.
[0160] For ease of description, in the embodiment of the present application, a memory segment is referred to as a VLD, and each VLD has a VLD identifier, namely, a VID.
[0161] 103. The management device establishes a first data structure according to the multiple memory segments obtained by division, wherein the first data structure includes information of each memory segment in the multiple memory segments.
[0162] After the management device obtains multiple memory segments through division, it can establish a first data structure for managing the multiple memory segments. The first data structure includes information about each memory segment in the multiple memory segments, and the information about each memory segment may include: an identifier of the memory segment (e.g., a VID), a physical starting position offset of the memory segment on the extended memory device, a capacity of the memory segment, and a physical ending position offset of the memory segment on the extended memory device.
[0163] Further optionally, the information of each memory fragment may also include: the IP address of the computing device currently using the memory fragment and the usage status of the memory fragment, where the usage status may include being currently used or not being currently used. Exemplarily, an identification information may be used to identify the usage status of the memory fragment, for example, using "free" to identify that the memory fragment is not currently in use.
[0164] Further optionally, the information of each memory space segment may also include the number of times the memory space segment is allocated, the number of times the memory space segment is read and written, the number of times read and write errors occur in the memory space segment, etc.
[0165] In an embodiment of the present application, the first data structure may include information of multiple memory fragments. When the memory space of all logical devices of all extended memory devices is divided, the multiple memory fragments may be multiple memory fragments obtained by dividing the memory space of all logical devices of all extended memory devices. When the memory space of all logical devices of some extended memory devices is divided, the multiple memory fragments may be multiple memory fragments obtained by dividing the memory space of all logical devices of the part of extended memory devices. When the memory space of some logical devices of some extended memory devices is divided, the multiple memory fragments may be multiple memory fragments obtained by dividing the memory space of some logical devices of the part of extended memory devices.
[0166] Exemplarily, a memory segment is a VLD, and the first data structure can be a VLD Table List, which can include the VID, the physical starting position offset of the VLD on the memory device, the memory space capacity of the VLD, the physical ending position offset of the VLD on the memory device, and the usage status. The usage status of the VLD identifies whether the VLD is currently in use. When the usage status of the VLD is currently in use, the VLD Table List can also include the IP address of the computing device using the VLD. Further optionally, the VLD Table List can also include the number of VLD errors, the number of VLD allocations, the number of VLD reads and writes, etc.
[0167] After the management device obtains the first data structure (e.g., VLD Table List), the FM initialization process on the management device ends, and enters the process of preparing to allocate memory space. After the FM enters the process of preparing to allocate memory space, it sends an indication message to each computing device in the computing system, and the indication message indicates that the management device is ready to allocate memory space. After receiving the indication message from the management device, the computing device ends the initialization process and enters the process of preparing to allocate memory space.
[0168] In the embodiment of the present application, the memory space of the logical device in the extended memory device extended by the CXL device can be flexibly managed by slicing, so as to facilitate the allocation of the divided memory segments to each computing device. Further slicing the memory space of the logical device can achieve more fine-grained memory space division, avoid a single logical device being allocated to only one computing device, and allocate a logical device to multiple computing devices as needed, thereby improving the utilization of memory space.
[0169] Please refer to Figure 4a A memory space management method provided in an embodiment of the present application may include the following steps: Figure 4a The computing device requests the management device to allocate memory space:
[0170] 201, the computing device sends a memory space application request to the management device, the memory space application request including the first capacity that the computing device needs to apply for. Correspondingly, the FM receives the memory space application request.
[0171] The computing device sends a request for CXL memory space to the management device. Exemplarily, when the computing device receives the indication information sent by the management device indicating that the management device is ready to allocate memory space, if the computing device has a memory space application requirement, it sends a memory space application request to the management device.
[0172] In some implementations, the memory space application request may not include the first capacity to be applied for, but is flexibly determined by the management device according to demand.
[0173] 202. The management device determines a target memory segment according to the memory space application request and the first data structure.
[0174] The target memory segment is one or more unoccupied memory segments in the first data structure, and the capacity of the target memory segment is greater than or equal to the first capacity.
[0175] When the target memory segment is one memory segment, the usage status of the memory segment is currently unoccupied. When the target memory segment is multiple memory segments, the usage status of the multiple memory segments are all currently unoccupied. In some implementations, the total memory space size of the target memory segment is greater than or equal to the first capacity that the computing device needs to apply for. That is, the target memory segment is the one or more memory segments that the management device searches for from the first data structure, which are currently unoccupied and can meet the first capacity that the computing device needs to apply for.
[0176] Exemplarily, taking the first data structure as VLD Table List and a memory segment as VLD as an example, after receiving the memory space application request, FM searches for the identifier VID of the VLD in the free state from the VLD Table List according to the first capacity to be applied for, as the target VID.
[0177] Exemplarily, when determining the target memory segment, the management device may also determine the target memory segment to be allocated to the computing device according to the number of errors of each memory segment, for example, using the memory segment with the number of errors less than or equal to the first threshold as the target memory segment. Allocating the memory segment with a relatively small number of errors to the computing device can improve the reliability of the computing device accessing the memory segment.
[0178] Exemplarily, when determining the target memory fragment, the management device may also determine the target memory fragment to be allocated to the computing device according to the number of allocations of each memory fragment, for example, using the memory fragment whose number of allocations is less than or equal to the second threshold as the target memory fragment. Allocating memory fragments with a relatively small number of allocations to the computing device can achieve wear leveling between memory fragments and increase the service life of the memory.
[0179] Exemplarily, when determining the target memory segment, the management device may also determine the target memory segment to be allocated to the computing device according to the number of read and write times of each memory segment, for example, using the memory segment with a read and write number less than or equal to the third threshold as the target memory segment. Allocating memory segments with relatively small read and write times to the computing device can reduce the probability of allocating to a faulty memory segment.
[0180] Further optionally, after determining to allocate the target memory segment for the computing device, the usage status corresponding to the target memory segment in the first data structure can be updated to allocated, thereby avoiding allocating the target memory segment to other computing devices before the management device receives a notification message sent by the computing device indicating that the binding between the computing device and the physical address of the target memory segment is successful.
[0181] 203, the management device sends a response message to the computing device, the response message including the address information of the target memory segment. Correspondingly, the computing device receives the response message.
[0182] The computing device may determine the physical address of the target memory segment according to the address information of the target memory segment. When the target memory segment includes one memory segment, the address information includes the address of one memory segment, and the computing device determines the physical address of the one memory segment according to the address of the one memory segment. When the target memory segment includes multiple memory segments, the address information includes the addresses of multiple memory segments, and the computing device determines the physical address of each memory segment according to the addresses of the multiple memory segments.
[0183] Exemplarily, the address information of the target memory segment may include the physical starting position offset of the target memory segment on the memory device and the memory space capacity of the target memory segment. The computing device may determine the physical address of the target memory segment according to the physical starting position offset of the target memory segment on the memory device and the memory space capacity of the target memory segment.
[0184] Exemplarily, the address information of the target memory segment may include the physical starting position offset and the physical ending position offset of the target memory segment on the memory device, and the computing device may determine the physical address of the target memory segment based on the physical starting position offset and the physical ending position offset of the target memory segment on the memory device.
[0185] Exemplarily, the information of the target memory segment may include the physical start address and / or physical end address of the target memory segment, rather than indicating the physical position offset, so as to facilitate rapid determination of the physical address of the target memory segment.
[0186] Taking the first data structure as VLD Table List and a memory segment as VLD as an example, the target memory segment may include one or more VLDs, and a VLD Detail Table may be generated for each VLD in the target memory segment, and the VLD Detail Table may include the VID number of the VLD, the physical start position offset of the VLD on the memory device, the memory space capacity of the VLD, the physical end position offset of the VLD, etc. The management device sends the VLD Detail Table corresponding to each VLD in the target memory segment to the computing device, so that the computing device can determine the physical address of each VLD.
[0187] 204 , the computing device binds the physical address of the target memory segment to the computing device.
[0188] In the embodiment of the present application, binding the physical address of the target memory segment to the computing device can be understood as the target memory segment is successfully allocated to the computing device for use, and other computing devices have no right to use the target memory segment.
[0189] Exemplarily, after the computing device determines the physical address of the target memory segment, it can create a dax device at the physical address, thereby creating a memory space accessible to the computing device, or the computing device changes the properties of the created dax device to systemram mode to hand over the memory space of the target memory segment to the computing device's operating system kernel for management. The above-mentioned dax device refers to a device managed by the system through the dax mode. In an embodiment of the present application, the dax device is an interface of the driver of the memory segment, and the application can write data to the memory segment corresponding to the dax device through the dax device, or read data in the memory segment corresponding to the dax device.
[0190] If the computing device successfully creates the dax device in the physical address of the target memory segment, the computing device determines that the physical address of the target memory segment is successfully bound to the computing device.
[0191] 205, the computing device sends a notification message to the management device, the notification message is used to notify that the physical address of the target memory segment is successfully bound to the computing device. Correspondingly, the management device receives the notification message.
[0192] 206. The management device updates the information of the target memory segment in the first data structure.
[0193] The management device receives the notification message sent by the computing device, and updates the usage status corresponding to the target memory segment in the first data structure to currently occupied, for example, updates the usage status corresponding to the target memory segment to occupied status, for example, the occupied status can be represented by exclusive. If the target memory segment includes one memory segment, the management device updates the usage status corresponding to the one memory segment. If the target memory segment includes multiple memory segments, the management device updates the usage status corresponding to each memory segment in the multiple memory spaces.
[0194] In some implementations, the management device writes the IP address of the computing device into the computing device IP address field corresponding to the target memory segment to indicate the computing device currently using the target memory segment.
[0195] In the embodiment of the present application, the memory fragments can be bound to each computing device, so that the computing device can flexibly use the memory space expanded by the CXL device and obtain it on demand, avoiding the allocation of only one logical device to one computing device, and improving the utilization of memory space.
[0196] Please refer to Figure 4b The memory space management method provided in the embodiment of the present application may include the following steps: Figure 4b In the process, the management device actively allocates memory space to the computing device:
[0197] 301. A management device receives a local operation command, where the local operation command instructs to allocate a memory space of a first capacity to a first computing device.
[0198] The local operation command may be an operation command triggered by a user, or an operation command triggered by a system application calling an application programming interface (Application Programming Interface, API), or an operation command triggered by a system execution script calling a command line interface (Command Line Interface, CLI).
[0199] The first computing device may be any computing device in the computing system. For example, the local operation command instructs to allocate 50 GB of memory space to the first computing device.
[0200] In some implementations, the local operation command may not indicate the size of the memory space capacity to be allocated, but the management device determines the size of the memory space capacity to be allocated according to demand.
[0201] 302. The management device determines a target memory segment according to the operation command and the first data structure.
[0202] The target memory segment is one or more unoccupied memory segments in the first data structure, and the capacity of the target memory segment is greater than or equal to the first capacity.
[0203] When the target memory segment is one memory segment, the usage status of the memory segment is currently unoccupied. When the target memory segment is multiple memory segments, the time domain status of the multiple memory segments is currently unoccupied. In some implementations, the total memory space capacity of the target memory segment is greater than or equal to the first capacity indicated by the local operation command. That is, the management device searches the first data structure for a target memory segment whose usage status is currently unoccupied and can meet the first capacity.
[0204] The description of step 302 can be found in Figure 4a The description of step 202 is not repeated here.
[0205] 303, the management device sends a response message to the first computing device, the response message including the address information of the target memory segment. Correspondingly, the first computing device receives the response message.
[0206] 304 , the first computing device binds the physical address of the target memory segment to the first computing device.
[0207] 305, the first computing device sends a notification message to the management device, the notification message is used to notify that the physical address of the target memory segment is successfully bound to the first computing device. Correspondingly, the management device receives the notification message.
[0208] 306. The management device updates the information of the target memory segment in the first data structure.
[0209] In the present embodiment, please refer to step 303 to step 306. Figure 4a The description of steps 203 to 206 will not be repeated here.
[0210] In the embodiment of the present application, the memory segments can be bound to each computing device, so that the computing device can flexibly use the memory space expanded by the CXL device and obtain it on demand.
[0211] Please refer to Figure 4c The memory space management method provided in the embodiment of the present application may include the following steps: Figure 4c In , multiple computing devices can share the same memory segment. Figure 4c In the example, the first computing device and the second computing device share the same memory segment:
[0212] 401, a management device determines that a memory space needs to be allocated to a first computing device and a second computing device. The first computing device and the second computing device are computing devices that can share the same memory segment.
[0213] The first computing device and the second computing device may be pre-set computing devices that can share the same memory segment. The management device may determine to allocate memory space to the first computing device and the second computing device upon receiving a local operation command. Alternatively, the management device may determine to allocate memory space to the first computing device and the second computing device upon receiving a memory space application request sent by the first computing device and / or the second computing device.
[0214] 402. The management device determines a target memory segment according to the first data structure.
[0215] The target memory segment is one or more unoccupied memory segments in the first data structure, and the capacity of the target memory segment is greater than or equal to the first capacity requested for allocation.
[0216] When the target memory segment is a memory segment, the usage status of the memory segment is currently unoccupied. When the target memory segment is multiple memory segments, the usage status of the multiple memory segments are all currently unoccupied. In some embodiments, the management device may determine a first capacity that needs to be allocated to the first computing device and the second computing device, and the size of the memory space contained in the searched target memory segment is greater than or equal to the first capacity that needs to be allocated to the first computing device and the second computing device.
[0217] In some implementations, some memory segments in the first data structure can support sharing by multiple computing devices, while some memory segments do not support sharing by multiple computing devices. The target memory segments that the management device searches for from the first data structure are memory segments that support sharing by multiple computing devices.
[0218] For other ways to manage devices to determine target memory segments, see Figure 4a The description of step 202 is not repeated here.
[0219] 403, the management device sends a response message to the first computing device, the response message including the address information of the target memory segment. Correspondingly, the first computing device receives the response message.
[0220] 404, the management device sends a response message to the second computing device, the response message including the address information of the target memory segment. Correspondingly, the second computing device receives the response message.
[0221] The management device may send the address information of the target memory segment to the first computing device and the second computing device respectively. The first computing device and the second computing device may determine the physical address of the target memory segment according to the address information of the target memory segment. Figure 4a The description of step 203 is not repeated here.
[0222] 405 , the first computing device binds the physical address of the target memory segment to the first computing device.
[0223] In the embodiment of the present application, binding the physical address of the target memory segment to the first computing device can be understood as the target memory segment being successfully allocated to the first computing device for use.
[0224] The first computing device determines the physical address of the target memory segment, and may create a dax device at the physical address, thereby creating a memory space accessible to the first computing device. Alternatively, the first computing device changes the properties of the created dax device to systemram mode to hand over the memory space of the target memory segment to the operating system kernel of the first computing device for management.
[0225] If the first computing device successfully creates a dax device in the physical address of the target memory segment, the first computing device determines that the physical address of the target memory segment is successfully bound to the first computing device.
[0226] 406 , the second computing device binds the physical address of the target memory segment to the second computing device.
[0227] In the embodiment of the present application, binding the physical address of the target memory segment to the second computing device can be understood as successfully allocating the target memory segment to the second computing device for use. In the embodiment of the present application, the same memory segment can be allocated to multiple different computing devices for sharing.
[0228] The second computing device determines the physical address of the target memory segment, and may create a dax device at the physical address, thereby creating a memory space accessible to the second computing device. Alternatively, the second computing device changes the properties of the created dax device to systemram mode to hand over the memory space of the target memory segment to the operating system kernel of the second computing device for management.
[0229] If the second computing device successfully creates a dax device in the physical address of the target memory segment, the second computing device determines that the physical address of the target memory segment is successfully bound to the second computing device.
[0230] 407, the first computing device sends a notification message to the management device, the notification message is used to notify that the physical address of the target memory segment is successfully bound to the first computing device. Correspondingly, the management device receives the notification message.
[0231] 408, the second computing device sends a notification message to the management device, the notification message is used to notify that the physical address of the target memory segment is successfully bound to the second computing device. Correspondingly, the management device receives the notification message.
[0232] 409. The management device updates the information of the target memory segment in the first data structure.
[0233] The management device receives the notification message sent by the first computing device and the second computing device, and updates the usage status corresponding to the target memory segment in the first data structure to currently occupied, for example, updates the usage status corresponding to the target memory segment to an occupied status, for example, the occupied status can be represented by exclusive. In some implementations, the management device writes the IP address of the first computing device and the IP address of the second computing device into the computing device IP address field corresponding to the target memory segment to indicate that the computing devices currently using the target memory segment are the first computing device and the second computing device.
[0234] In this embodiment, the management device can simultaneously allocate and bind the same memory segment to multiple computing devices in the computing system to enable multiple computing devices to share access to the memory space of the same memory segment. Multiple computing devices can share access to the same memory space segment to achieve information interaction among the multiple computing devices and improve information transmission efficiency.
[0235] Please refer to Figure 5a The memory space management method provided in the embodiment of the present application may include the following steps: Figure 5a In the example, the computing device requests the management device to reclaim memory space:
[0236] 501, when the computing device determines that there is an idle memory segment, the computing device sends a release request to the management device, wherein the release request is used to request to release the memory space of the idle memory segment. Correspondingly, the management device receives the release request.
[0237] Among them, the free memory segment is one or more memory segments allocated to the computing device, and the free memory segment is not occupied by any program of the computing device, or the free memory segment is not currently occupied by any program of the computing device and will not be occupied in the future, thereby ensuring the normal operation of the computing device.
[0238] Exemplarily, when a computing device detects a free memory segment, the computing device may destroy a dax device of the free memory segment and send a release request to a management device to request the release of the free memory segment.
[0239] 502. The management device updates the information of the free memory segment in the first data structure according to the release request.
[0240] After receiving the release request, the management device may search for information of the free memory segment from the first data structure, and modify the usage status of the free memory segment to be currently unoccupied.
[0241] In some embodiments, the management device may also delete the IP address of the computing device currently using the free memory segment from the information of the free memory segment.
[0242] Taking the first data structure as VLD Table List and a memory segment as VLD as an example, the management device searches for the corresponding VLD information according to the VID of the idle VLD, thereby modifying the usage status field of the VLD to currently unoccupied, and deleting the IP address of the computing device currently using the VLD.
[0243] 503. The management device sends a notification message to the computing device, where the notification message indicates that the unbinding between the free memory segment and the computing device is completed.
[0244] After the management device updates the information of the free memory segment in the first data structure, the management device may indicate through a notification message that the unbinding between the free memory segment and the computing device is complete.
[0245] Please refer to Figure 5b The memory space management method of the embodiment of the present application may include the following steps: Figure 5b In the process, the management device actively sends a command to the computing device to reclaim memory space:
[0246] 601. A management device sends a reclaim command to a computing device. The reclaim command instructs to reclaim a memory segment allocated to the computing device.
[0247] The management device may actively send a recovery command to the computing device based on the memory space demand. For example, when the management device detects that the remaining free memory space capacity of the system is lower than a set threshold, or when other computing devices initiate a memory space application request to the management device, and the memory space capacity requested in the memory space application request exceeds the memory space capacity that the management device can currently provide, the management device may actively send a recovery command to the computing device.
[0248] 602, when the computing device determines that there is an idle memory segment, the computing device sends a release request to the management device, wherein the release request is used to request to release the memory space of the idle memory segment. Correspondingly, the management device receives the release request.
[0249] 603. The management device updates the information of the free memory segment in the first data structure according to the release request.
[0250] 604. The management device sends a notification message to the computing device, where the notification message indicates that the unbinding between the free memory segment and the computing device is complete.
[0251] Please refer to step 602 to step 604 of this embodiment of the application. Figure 5a Steps 501 to 503 of the embodiment are not described in detail here.
[0252] Please refer to Figure 6 , is a flowchart of a memory space management method provided in an embodiment of the present application, which may include but is not limited to step 701 and step 702, such as Figure 6 As shown;
[0253] 701. A management device determines that a memory space of a first capacity needs to be allocated to a computing device.
[0254] In one implementation, the management device may determine that a memory space of a first capacity needs to be allocated to the computing device upon receiving a memory space application request, wherein the memory space application request includes the first capacity that the computing device needs to apply for. Figure 4a The description of step 201 is not repeated here.
[0255] In another implementation, the management device may determine that a memory space of the first capacity needs to be allocated to the computing device upon receiving a local operation command, wherein the local operation command instructs the memory space of the first capacity to be allocated to the computing device. Figure 4b The description of step 301 is not repeated here.
[0256] 702. The management device determines a target memory segment to be allocated to the computing device according to the first data structure, wherein the capacity of the target memory segment is greater than or equal to the first capacity.
[0257] The first data structure includes information of each memory segment in a plurality of memory segments, the plurality of memory segments are memory segments obtained by dividing the memory space of a logical device in an extended memory device, and the plurality of memory segments include a target memory segment.
[0258] The management device may allocate a target memory segment for the computing device, where the target memory segment is one or more unoccupied memory segments in the first data structure, and the capacity of the target memory segment is greater than or equal to the first capacity. Figure 4a Step 202, and Figure 4b In some implementations, if multiple computing devices share the same memory segment, the target memory segment allocated by the management device may be allocated to the first computing device and the second computing device. Figure 4c The description of step 402 is not repeated here.
[0259] See also Figure 7 , Figure 7 It is a structural diagram of a computing device provided in an embodiment of the present application. The computing device may be a terminal device such as a server, a laptop, a desktop computer, a tablet computer, a mobile phone, etc. Among them, the server may be a file server, a domain control server, a database server, a mail server, a web server, a multimedia server, a communication server, a terminal server, an infrastructure server, a virtualization server, a GPU server, etc. The server may be a tower, a rack, a blade, etc. The computing device may be, but is not limited to, an X86 architecture, a reduced instruction set computer (RISC) architecture, an advanced reduced instruction set machine (ARM) architecture, etc.
[0260] like Figure 7 As shown, the computing device 800 may include but is not limited to: a processor 810, a communication interface 820, and a memory 830, and the processor 810, the communication interface 820, and the memory 830 are interconnected via an internal bus 840. It should be understood that the computing device 800 may be a computing device in cloud computing, or a computing device in an edge environment.
[0261] The processor 810 may be composed of one or more general-purpose processors, such as a central processing unit (CPU), or a combination of a CPU and a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.
[0262] The bus 840 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus 840 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 7 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0263] The memory 830 may include a volatile memory, such as a random access memory (RAM); the memory 830 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD); the memory 830 may also include a combination of the above types.
[0264] It should be noted that the memory 830 of the computing device 800 stores codes for executing various method embodiments of the present application. The processor 810 executes these codes to implement at least one of the functions of memory segment generation, memory space allocation, and memory space recycling of the present application, that is, the method of steps 101-103 is executed, and / or the method of steps 201-206 is executed, and / or the method of steps 301-306 is executed, and / or the method of steps 401-409 is executed, and / or the method of steps 501-503 is executed, and / or the method of steps 601-604 is executed.
[0265] The present application also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it can implement part or all of the steps of any one of the above method embodiments.
[0266] An embodiment of the present invention further provides a computer program, which includes instructions. When the computer program is executed by a computer, the computer can execute part or all of the steps of any method for service expansion and contraction.
[0267] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0268] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described action sequence, because according to the present application, some steps may be performed in other sequences or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0269] The terms used in the above embodiments are only for the purpose of describing specific embodiments and are not intended to be used as limitations on the present application. As used in the specification and appended claims of the present application, the singular expressions "one", "a kind", "said", "above", "the" and "this" are intended to also include plural expressions unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used in the present application refers to and includes any or all possible combinations of one or more of the listed items.
[0270] As used in the above embodiments, the term "when..." may be interpreted to mean "if..." or "after..." or "in response to determining..." or "in response to detecting...", depending on the context. Similarly, the phrases "upon determining..." or "if (the stated condition or event) is detected" may be interpreted to mean "if determining..." or "in response to determining..." or "upon detecting (the stated condition or event)" or "in response to detecting (the stated condition or event)", depending on the context.
[0271] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that contains one or more available media integration. The available medium can be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk), etc.
[0272] Those skilled in the art can understand that to implement all or part of the processes in the above-mentioned embodiments, the processes can be completed by computer programs to instruct related hardware, and the programs can be stored in computer-readable storage media. When the programs are executed, they can include the processes of the above-mentioned method embodiments. The aforementioned storage media include: ROM or random access memory RAM, magnetic disk or optical disk and other media that can store program codes.
Claims
1. A memory space management method, characterized in that: include: Determining that a memory space of a first capacity needs to be allocated to the computing device; A target memory segment allocated to the computing device is determined according to a first data structure, wherein the capacity of the target memory segment is greater than or equal to the first capacity, wherein the first data structure includes information of each memory segment in a plurality of memory segments, the plurality of memory segments are memory segments obtained by dividing the memory space of a logical device in an extended memory device, and the plurality of memory segments include the target memory segment.
2. The method according to claim 1, characterized in that Before determining that memory space needs to be allocated to the computing device, the method further includes: Determine the information of the logical devices contained in the extended memory device; Dividing the memory space of the logical device included in the extended memory device into a plurality of memory segments; The first data structure is established according to the multiple memory fragments obtained by division.
3. The method according to claim 2, characterized in that The information of the memory segment includes an identifier of the memory segment, address information of the memory segment, a capacity of the memory segment, and a usage status of the memory segment, where the usage status of the memory segment is used to indicate whether the memory segment is currently occupied; The usage status of the target memory segment indicates that the target memory segment is currently not occupied.
4. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: Update the usage status corresponding to the target memory segment in the first data structure to being allocated; Sending a first message to the computing device, the first message including address information of the target memory segment, the address information being used to determine a physical address of the target memory segment; receiving a second message sent by the computing device, where the second message is used to notify the computing device of binding with the physical address of the target memory segment; According to the second message, the information of the target memory segment is updated in the first data structure.
5. The method according to claim 4, characterized in that The updating the information of the target memory segment in the first data structure according to the second message comprises: Update the usage status corresponding to the target memory segment in the first data structure to currently occupied; The IP address information corresponding to the target memory segment is added to the first data structure, where the IP address information includes the IP address of the computing device.
6. The method according to claim 4, characterized in that The number of the computing devices is at least two, and the at least two computing devices are computing devices requesting to share the same memory segment; The sending a first message to the computing device includes: Sending the first message to the at least two computing devices respectively; The receiving a second message sent by the computing device includes: The second messages sent by the at least two computing devices are received respectively.
7. The method according to claim 5, characterized in that The number of the computing devices is at least two, and the at least two computing devices are computing devices requesting to share the same memory segment; The IP address information includes IP addresses of the at least two computing devices.
8. The method according to any one of claims 1 to 7, characterized in that: The method further comprises: receiving a release request sent by the computing device, the release request being used to request the release of a free memory segment, the free memory segment being one or more memory segments allocated to the computing device; The usage status of the free memory segment in the first data structure is updated to unoccupied; and the IP address information corresponding to the free memory segment in the first data structure is deleted.
9. The method according to claim 3, characterized in that The information of the memory segment in the first data structure also includes the number of errors of the memory segment; The step of determining a target memory segment allocated to the computing device according to the first data structure includes: Determine from the first data structure a target memory segment whose number of errors is less than or equal to a first threshold and whose capacity is greater than or equal to the first capacity; or, The information of the memory fragment in the first data structure also includes the number of times the memory fragment is allocated; The step of determining a target memory segment allocated to the computing device according to the first data structure includes: Determine from the first data structure a target memory segment whose number of allocations is less than or equal to a second threshold and whose capacity is greater than or equal to the first capacity; or, The information of the memory segment in the first data structure also includes the number of reads and writes of the memory segment; The step of determining a target memory segment allocated to the computing device according to the first data structure includes: Determine from the first data structure a target memory segment whose number of read and write times is less than or equal to a third threshold and whose capacity is greater than or equal to the first capacity.
10. A management device, characterized in that: include: A processor, a memory, the memory being coupled to the processor; The memory is used to store computer instructions; The processor is used to call the computer instruction to execute: Determining that a memory space of a first capacity needs to be allocated to the computing device; A target memory segment allocated to the computing device is determined according to a first data structure, wherein the capacity of the target memory segment is greater than or equal to the first capacity, wherein the first data structure includes information of each memory segment in a plurality of memory segments, the plurality of memory segments are memory segments obtained by dividing the memory space of a logical device in an extended memory device, and the plurality of memory segments include the target memory segment.