Storage space management method and computing device

By dividing the storage space of the CXL storage device into storage segments with fixed storage capacity and dynamically allocating it, the problem of lack of storage space management methods in the prior art is solved, and efficient storage space management and resource utilization are achieved.

CN119512976APending Publication Date: 2025-02-25XFUSION DIGITAL TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311075121.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-08-24
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

The lack of storage space management methods for CXL storage devices in the prior art leads to the inability to effectively manage and allocate storage space, resulting in storage fragmentation and waste of resources.

Method used

A storage space management method is proposed, by dividing the storage space of the CXL storage device into storage segments with fixed storage capacity, and dynamically allocating storage segments that meet the needs to the target application, reducing storage fragmentation and improving management efficiency.

Benefits of technology

This method effectively solves the problems of storage fragmentation and resource waste, improves the management efficiency and utilization of storage space, and supports the storage needs of multiple applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119512976A_ABST
    Figure CN119512976A_ABST
Patent Text Reader

Abstract

The invention discloses a storage space management method and computing equipment, relates to the technical field of computers, and can realize management of a storage space of CXL storage equipment. The method is applied to the computing device and comprises the steps that a first request sent by a target application program in the computing device is received; the first request is used for requesting to allocate a storage space of a first storage capacity for a target application program; determining a first storage segment meeting the first storage capacity from the first storage space; the first storage space is a storage space allocated to the computing device by the CXL storage device, the first storage space comprises one or more logic units, and the first storage segment is a storage segment with available storage capacity in a plurality of storage segments divided by the computing device from the logic units; the available storage capacity of the first storage segment is greater than or equal to the first storage capacity; sending a first response to the target application program; the first response is used for indicating a first storage segment allocated to the target application program.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a storage space management method and a computing device. Background Art

[0002] With the development of technologies such as cloud computing, artificial intelligence, and high-performance computing, the computing power of processors continues to increase, and the number of processor cores is also increasing, which brings about an increase in the demand for memory resources. In order to meet the demand for large-capacity and high-bandwidth memory for computing devices in data centers, a compute express link (CXL) is proposed. CXL is an open interconnection protocol standard that aims to provide an efficient, high-speed, and low-latency interface between processors (such as central processing units, CPUs) and dedicated accelerators and high-performance storage systems to meet the needs of resource sharing, memory pooling, and efficient computing scheduling.

[0003] The related art proposes a CXL storage device based on CXL, which can meet the needs of data centers for resource sharing, memory pooling and efficient computing scheduling. For CXL storage devices, the related art does not propose a specific management method. Therefore, it is urgent to propose a management method for the storage space of CXL storage devices, so that CXL storage devices can be widely used. Summary of the invention

[0004] The embodiments of the present application provide a storage space management method and a computing device, which can manage the storage space of a CXL storage device.

[0005] In order to achieve the above technical objectives, the embodiments of the present application adopt the following technical solutions:

[0006] In a first aspect, an embodiment of the present application provides a memory management method, which is applied to a computing device, and the method includes: receiving a first request sent by a target application in the computing device; the first request is used to request allocation of a storage space of a first storage capacity for the target application; determining a first storage segment that meets the first storage capacity from the first storage space; the first storage space is a storage space allocated to the computing device by a CXL storage device, the first storage space includes one or more logical units, the first storage segment is a storage segment with available storage capacity among multiple storage segments into which the computing device divides the logical units, and the available storage capacity of the first storage segment is greater than or equal to the first storage capacity; sending a first response to the target application; the first response is used to indicate allocation of the first storage segment for the target application, and the first response includes the first storage segment address.

[0007] It is understandable that the computing device manages the CXL storage space (first storage space) allocated to the computing device in segments, selects a first storage segment of a first storage capacity that meets the requirements of the target application from multiple storage segments, and allocates it to the target application. It is understandable that the method proposed in the embodiment of the present application can solve the problem that there is no specific management method for the storage space of the CXL storage device in the related art. In addition, the method divides the first storage space into storage segments of fixed storage capacity and allocates them to the target application, which can reduce the storage fragmentation generated by allocating storage space based on the requirements of the application in the related art and improve management efficiency.

[0008] In a possible implementation, the storage capacity of each storage segment in the multiple storage segments is the same, or the storage capacity of at least some of the storage segments in the multiple storage segments is different.

[0009] It is understandable that the storage capacity of each storage segment of multiple storage segments can be the same or different, or can be partially the same and partially different. Flexible setting of the storage capacity of the storage segments can meet the needs of various applications and improve the efficiency of subsequent allocation of storage space.

[0010] In another possible implementation, the storage capacities of any two storage segments in the storage segments having at least partial different storage capacities satisfy an integer multiple relationship.

[0011] It can be understood that setting the storage capacity of the storage segment to satisfy an integer multiple relationship facilitates the subsequent merging management of the storage segments and improves the efficiency of storage segment management.

[0012] In another possible implementation, determining a first storage segment that meets a first storage capacity from a first storage space includes: determining at least one candidate storage segment from the first storage space; the storage capacity of each storage segment in the at least one candidate storage segment is greater than or equal to the first storage capacity; determining the first storage segment from the at least one candidate storage segment; the storage capacity of the first storage segment is less than the storage capacity of other storage segments in the at least one candidate storage segment.

[0013] It can be understood that allocating the storage segment of the first storage space with the minimum storage capacity that satisfies the first storage capacity to the target application can avoid the waste of storage space and save storage resources.

[0014] In another possible implementation, the above-mentioned determining the first storage segment from at least one candidate storage segment includes: splitting the second storage segment in the at least one candidate storage segment into multiple sub-storage segments; the storage capacity of at least one sub-storage segment among the multiple sub-storage segments is greater than or equal to the first storage capacity; the storage capacity of the second storage segment is less than the storage capacity of other storage segments in the at least one candidate storage segment; and determining a sub-storage segment among the multiple sub-storage segments whose storage capacity is greater than or equal to the first storage capacity as the first storage segment.

[0015] It is understandable that further splitting the candidate storage segment with the available minimum storage capacity into multiple sub-storage segments and selecting the sub-storage segment that can meet the first storage capacity can further improve the allocation efficiency of the storage capacity of the storage segment.

[0016] In another possible implementation, the method further includes: when the number of available storage segments with the same storage capacity and continuous addresses among the multiple storage segments is greater than a preset threshold, merging the available storage segments with the same storage capacity and continuous addresses in pairs.

[0017] It can be understood that when the number of available storage segments with the same storage capacity and continuous addresses is greater than a preset threshold, the storage segments are merged into storage segments with larger storage capacity to provide storage services for applications with greater storage capacity requirements. This method implements dynamic management of storage segments, splits storage segments when necessary, and merges storage segments when there are surplus storage segments. This management method is more flexible.

[0018] In another possible implementation, the computing device and the CXL storage device are both communicatively connected to a management unit, the management unit is used to manage a second storage space of the CXL storage device, the second storage space includes a plurality of logical units, the first storage space is allocated to the computing device by the management unit, and the second storage space includes the first storage space, and the above method further includes: sending a second request to the management unit; the management unit is used to manage a plurality of logical units in the CXL storage space of the CXL storage device, the second request is used to request allocation of storage space of a second storage capacity for the computing device; receiving a second response from the management unit; the second response is used to indicate a third storage space allocated to the computing device, the third storage space includes one or more logical units, the second response includes identifiers of the one or more logical units and storage capacities of the one or more logical units, the sum of the storage capacities of the one or more logical units is greater than or equal to the second storage capacity; the first storage space includes the storage space previously allocated to the computing device and the third storage space.

[0019] It is understandable that by applying for CXL storage space for a computing device in advance, when an application of the computing device subsequently requests allocation of CXL storage space, the storage space required by the application can be directly allocated to the application from the pre-applied logical unit, without the need to apply for storage space across nodes, thus reducing waiting time and improving storage space allocation efficiency.

[0020] In another possible implementation, after receiving the first request sent by the target application in the computing device and before sending the first response to the target application, the method also includes: when there is no available storage space with a storage capacity greater than or equal to the first storage capacity in the first storage space, sending a third request to the management unit; wherein the third request is used to request to apply for storage space with the first storage capacity for the computing device; receiving a third response from the management unit; the third response is used to indicate a fourth storage space allocated to the computing device, the fourth storage space includes a first logical unit, the third response includes an identifier of the first logical unit and the storage capacity of the first logical unit, the storage capacity of the first logical unit is greater than or equal to the first storage capacity; sending the first response to the target application includes: sending the first response to the target application, the first response is used to indicate a first storage segment allocated to the target application, the first storage segment includes at least part of the storage space of the first logical unit.

[0021] It is understandable that when the available storage space in the managed logical unit cannot meet the needs of the target application, a new logical unit can be requested from the management unit to allocate the required storage space for the target application. This method can dynamically manage CXL storage space and has high flexibility.

[0022] In another possible implementation, the method further includes: receiving a return request sent by the target application, wherein the return request includes a first identifier, and the first identifier is an identifier of the first storage segment; and in response to the return request, reclaiming the first storage segment.

[0023] It can be understood that the above method is a possible implementation method for reclaiming storage segments, and the method is simple to operate and easy to implement.

[0024] In another possible implementation, the method further includes: recycling the first identifier; and when allocating the third storage segment for the application, allocating the first identifier for the third storage segment.

[0025] It is understandable that the identifier is obtained from the identifier queue. After the computing device recycles the first storage segment, the computing device also recycles the first identifier assigned to the first storage segment. The first identifier can also be subsequently assigned to other storage segments, such as the third storage segment. Since the length of the identifier queue is limited, timely recycling of the identifier can recycle the identifier to improve the identifier utilization rate and avoid identifier queue data overflow.

[0026] In another possible implementation, the method further includes: when determining that there are idle logical units in the first storage space of the computing device, sending a return request to the management unit; the return request is used to request the return of the idle logical units, where the idle logical units are logical units that have not been used within a preset time period.

[0027] It is understandable that when an application stops running, timely recovery of the storage space allocated to the application can avoid the stopped application occupying the storage space, resulting in insufficient storage space capacity in the first storage space, and the need to apply for storage space from the management unit. Therefore, timely recovery of the storage space can continue to allocate this part of the storage space to other applications for use, and can avoid applying for storage space across nodes when the storage capacity of the first storage space is insufficient, thereby improving storage space utilization and allocation efficiency and reducing allocation delays.

[0028] In a second aspect, an embodiment of the present application provides a computing device, wherein the computing device is applied to various modules of the storage space management method of the first aspect or any possible implementation of the first aspect.

[0029] In a third aspect, an embodiment of the present application provides a computing device, including a memory and a processor. The memory and the processor are coupled; the memory is used to store computer program code, and the computer program code includes computer instructions. When the processor executes the computer instructions, the computing device executes the storage space management method as described in the first aspect and any possible implementation thereof.

[0030] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, the computer-readable storage medium comprising computer instructions, wherein when the computer instructions are executed on a computing device, the computing device executes the storage space management method of the first aspect and any possible implementation thereof.

[0031] In a fifth aspect, an embodiment of the present application provides a computer program product, which includes computer instructions. When the computer instructions are executed on a computing device, the computing device executes the storage space management method of the first aspect and any possible implementation thereof.

[0032] For the specific description of the second to fifth aspects and their various implementations in the embodiments of the present application, reference can be made to the detailed description in the first aspect and its various implementations; and for the beneficial effects of the second to fifth aspects and their various implementations, reference can be made to the analysis of the beneficial effects in the first aspect and its various implementations, which will not be repeated here.

[0033] These and other aspects of the embodiments of the present application will be more clearly understood in the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1 A schematic diagram of a system architecture involved in the storage space management method proposed in an embodiment of the present application;

[0035] Figure 2 A flowchart of a storage space management method provided in an embodiment of the present application;

[0036] Figure 3 A flowchart of another storage space management method provided in an embodiment of the present application;

[0037] Figure 4 A schematic diagram of a logic unit provided in an embodiment of the present application;

[0038] Figure 5 Another logic unit schematic diagram provided for an embodiment of the present application;

[0039] Figure 6 A flowchart of another storage space management method provided in an embodiment of the present application;

[0040] Figure 7 Another logic unit schematic diagram provided for an embodiment of the present application;

[0041] Figure 8 Another logic unit schematic diagram provided for an embodiment of the present application;

[0042] Fig. 9 Another logic unit schematic diagram provided for an embodiment of the present application;

[0043] Fig.10 A flowchart of another storage space management method provided in an embodiment of the present application;

[0044] Fig.11 A schematic diagram of an identification queue provided in an embodiment of the present application;

[0045] Fig.12 A flowchart of another storage space management method provided in an embodiment of the present application;

[0046] Fig.13 A schematic diagram of the structure of a computing device provided in an embodiment of the present application;

[0047] Fig.14 A schematic diagram of the structure of another computing device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0048] In the following, the terms "first", "second", "third", etc. are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first", "second", or "third", etc. may explicitly or implicitly include one or more of the features.

[0049] In the description of the embodiments of the present application, unless otherwise specified, " / " means "or", for example, A / B can mean A or B. "And / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, "at least one" means one or more, and "a plurality" means two or more.

[0050] In the related art, the storage space (such as memory) is managed (such as applying for, returning or interacting with applications) by the operating system kernel of the computing device. When the operating system kernel manages the storage space, in order to meet the storage space requirements of various applications in the computing device, the storage space is allocated according to the requirements of the applications. Some applications have a larger storage capacity requirement for the storage space, while some applications have a smaller storage capacity requirement for the storage space. In this case, for some applications with a smaller storage capacity requirement for the storage space, after the application returns the storage space, if this part of the storage space is not reasonably used subsequently, more storage fragments will be generated, which will cause a waste of storage resources and bring inconvenience to the management of the storage space.

[0051] Based on this, an embodiment of the present application proposes a storage space management method, which is applied to a computing device. The computing device manages the CXL storage space (first storage space) allocated to the computing device in segments, selects a first storage segment with a first storage capacity that meets the needs of a target application from multiple storage segments, and allocates it to the target application. It can be understood that the method proposed in the embodiment of the present application can solve the problem that there is no specific management method for the storage space of the CXL storage device in the related art. In addition, in the method, the computing device divides the first storage space into storage segments with fixed storage capacity and allocates them to the target application, which can reduce the storage fragmentation generated by allocating storage space based on the needs of the application in the related art and improve management efficiency.

[0052] The implementation of the embodiments of the present application will be described in detail below with reference to the accompanying drawings.

[0053] Please refer to Figure 1 , which shows a schematic diagram of a system architecture involved in the storage space management method provided in the embodiment of the present application. Figure 1As shown, the system architecture may include a computing device 110 , a CXL storage device 120 , and a CXL connection device 130 .

[0054] The computing device 110 and the CXL storage device 120 are communicatively connected via a CXL connection device 130 .

[0055] The computing device 110 is a computing device with data processing, logic operation and storage functions. For example, the computing device 110 may include computing devices such as servers, tablet computers, desktop computers, laptop computers, notebook computers or netbooks. The server may be a rack server, a blade server or a tower 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.

[0056] In the embodiment of the present application, there may be more than one computing device 110 . When there are more than one computing device, each computing device 110 is connected to the CXL storage device 120 via the CXL connection device 130 .

[0057] In this embodiment, the number of the CXL storage device 120 may be one or more. When there is one CXL storage device 120, such as Figure 1 The storage space of one CXL storage device 120 may be referred to as the second storage space. When there are multiple CXL storage devices 120, the storage spaces of the multiple CXL storage devices 120 together constitute the second storage space. The following description assumes that the number of CXL storage devices 120 is one.

[0058] The CXL storage device 120 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 an actual physical carrier that provides storage space for the computing device 110.

[0059] The CXL control chip is used to write data to the memory in the CXL storage device 120 or read data from the memory according to the read / write data request sent by the computing node 110. The CXL control chip is also called a memory expansion (CXL memory expander) chip, a CXL memory controller (CXL memory expander controller) or a CXL memory pooling (CXL memory expander pooling) chip.

[0060] In the embodiment of the present application, the number of memories in the above-mentioned CXL storage device 120 can be one or more. When there is one memory, the memory can be a DIMM or an SSD. When there are multiple memories, the multiple memories can all be DIMMs, or the multiple memories can all be SSDs, or a part of the multiple memories can be DIMMs and a part can be SSDs. Of course, in other embodiments, when there is one memory, the memory can also be other types of memories such as SDRAM or PMEM. When the number of memories is multiple, the multiple memories can all be other types of memories such as SDRAM or PMEM, or the multiple memories include at least two of SDRAM, PMEM, DIMM or SSD. The above-mentioned flexible implementation and deployment methods can make the CXL storage device 120 compatible with memories of more media types. The embodiment of the present application does not limit the media type, number and deployment method of the memory.

[0061] The CXL connection device 130 can provide an expansion interface to connect multiple computing devices 110 to the CXL storage device 120. The CXL connection device 130 can be independently configured or integrated into any computing device 110 or the CXL storage device 120.

[0062] Exemplarily, when the CXL connection device 130 is independently provided, the CXL connection device 130 may be a CXL switch, which includes a CXL switch chip; or the CXL connection device 130 may be a multi-head CXL memory expansion card. In the case that the number of CXL storage devices 120 is one, the CXL connection device 130 may be integrated on the CXL storage device 120, and the CXL connection device 130 may be a multi-head CXL memory expansion card, which may serve as a CXL control chip of the CXL storage device 120. When the CXL connection device 130 is integrated on a computing device, the CXL connection device 130 may be a CXL switch, a CXL switch chip, or a multi-head CXL memory expansion card. In addition to the expansion function, the CXL Switch also has a processor, and has a processing function, such as being able to run FM.

[0063] In the embodiment of the present application, the computing device 110 can be operated by a management process (eg, Figure 1 In the example, the local CXL space management daemon (LMD) is used to manage the CXL storage space (i.e., the first storage space) on the computing device 110. For example, the management process allocates storage space to an application (APP) running in the operating system of the computing device 110, or reclaims the storage space allocated to the application. In addition, the management process can send a request to the management unit (e.g., Figure 1 Middle: The fabric manager (FM) applies for or returns storage space, wherein the management unit is used to manage all storage spaces (ie, the second storage space) in the CXL storage device 120 .

[0064] Exemplarily, the LMD includes a storage space management module and a processing module. The storage space management module uses the logical unit in the CXL storage space of the computing device 110 as the basic storage management unit, and manages the continuous storage space of each logical unit in segments. For example, if the storage capacity of a logical unit is 16GB, the LMD can divide the logical unit into multiple storage segments according to the storage capacity of 256MB, 512MB, 1GB, 2GB, 4GB, 8GB and 16GB memory segments. The processing module interacts with the application in the computing device 110 through the software development kit (SDK) interface to allocate the storage segment with the divided capacity in the logical unit to the application. The processing module also interacts with the FM to apply for or reclaim the logical unit for the computing device 110. Optionally, the LMD can directly interact with the CXL storage device 120 to query the health status, alarm information or log information of the CXL storage device 120.

[0065] Exemplarily, SDK is a software, and SDK provides multiple interfaces, such as: CXL_malloc interface for applying for storage space, CXL_free for returning storage space, CXL_dd interface for performing IO write operations on device files, CXL_open interface for opening device files corresponding to storage space, CXL_read interface for reading device files, CXL_write interface for writing device files, and CXL_close interface for closing device files.

[0066] In the embodiment of the present application, the FM is a process for managing the storage space of the CXL storage device 120. The FM may run in a CPU or a baseboard management controller (BMC) of any computing device 110, or in a processor of the CXL connection device 130. Alternatively, the FM may also run in a CPU, a BMC, or a controller of an independent device. The embodiment of the present application does not limit the specific running location of the FM.

[0067] It should be noted that different computing devices have different names for BMC, for example, some computing devices are called BMC, some computing devices are called iLO (Integrated lights-out), and some computing devices are called Integrated Dell Remote Access Controller (iDRAC). Whether it is called BMC, iLO or iDRAC, it can be understood as the BMC in the embodiment of the present invention.

[0068] In some embodiments, FM can also be used to abstract the storage space (second storage space) in the CXL storage device 120 into multiple logical units (logical devices, LD). For example, when there is one CXL storage device 120, FM can divide the storage space (second storage space) of one CXL storage device 120 into multiple sub-storage spaces, which can be called logical units. When there are multiple CXL storage devices 120, FM can uniformly manage the storage space (second storage space) of multiple CXL storage devices and divide them into multiple sub-storage spaces, which can be called logical units. Optionally, the capacity of multiple logical units can be the same or different. Generally, for ease of management, FM divides the second storage space into multiple logical units of the same capacity. The storage capacity of the logical unit can be flexibly set based on demand.

[0069] In some embodiments, FM uses the above logical units as the minimum allocation granularity, allocates one or more logical units to one or more computing devices 110, or reclaims one or more logical units allocated to computing devices 110. Optionally, FM records metadata of the above multiple logical units, including the identification, usage, and storage capacity of the logical units. Optionally, FM can also query information such as the media type (e.g., DIMM or SSD) of the CXL storage device 120.

[0070] For example, assuming that the storage space (second storage space) of the CXL storage device is 128 GB, and the capacity of each logical unit is set to 16 GB, FM divides the second storage space into 8 logical units, and sets an identifier for each logical unit, for example: LD-0, LD-1...LD-7. FM can allocate one or more logical units in LD-0, LD-1...LD-7 to the computing device 110, so that the computing device 110 can use the storage space corresponding to one or more logical units to read and write data.

[0071] In some embodiments, the FM may be run on any one of the plurality of computing devices 110, and the other computing devices 110 are connected to the computing device running the FM via a network and / or a 485 link (a link using the RS-485 serial bus standard), etc. The CXL connection device 130 connects the plurality of computing devices 110 and the CXL storage device 120 respectively via a bus (e.g., UART, universal asynchronous receiver / transmitter (UART) integrated circuit bus (inter-integrated circuit, IIC) or system management bus (system management bus, SMBus)).

[0072] In another possible implementation, if the CXL connection device 130 is a CXL Switch, the FM may run in the CXL connection device 130 , and the CXL connection device 130 is connected to the plurality of computing devices 110 and the CXL storage device 120 via a bus (eg, UART, IIC, or SMBUS bus).

[0073] For example, in the embodiment of the present application, the CXL connection device 130 may also abstract the storage space (second storage space) in the CXL storage device 120 into multiple logical units, and allocate one or more logical units to one or more computing devices 110 with the logical unit as the minimum granularity. Optionally, the capacity of the multiple logical units may be the same or different. Generally, for ease of management, the CXL connection device 130 divides the second storage space into multiple logical units of the same capacity.

[0074] The following is an explanation of the storage space management method provided by the embodiment of the present application:

[0075] Please refer to Figure 2, is a flow chart of a storage space management method provided in an embodiment of the present application. The method is applied to a computing device, where both the computing device and the CXL storage device are in communication connection with a management unit (FM), and the management unit is used to manage a second storage space (all CXL storage spaces) of the CXL storage device, where the second storage space includes multiple logical units, and the management unit can be run on the computing device or other devices.

[0076] It can be understood that the storage space management method provided in the embodiment of the present application mainly includes two stages:

[0077] Phase 1: The computing device interacts with the management unit to apply for or return storage space in the CXL storage device for the computing device.

[0078] Phase 2: The computing device interacts with the target application in the computing device and allocates CXL storage space of the computing device to the target application.

[0079] Optionally, the computing device can interact with the application or the management unit through a management process. The management process is a user state process in the computing device for managing a first storage space of the computing device. The first storage space is a storage space allocated to the computing device in the CXL storage device. The first storage space includes one or more logical units. The first storage space is allocated to the computing device by the management unit, and the second storage space includes the first storage space.

[0080] The following embodiments are described by taking the interaction between a management process and a management unit or an application program in a computing device as an example.

[0081] First, the storage space management method provided by the embodiment of the present application is described from the perspective of the interaction between the management process and the management unit. Figure 2 As shown, the method may include S101-S103.

[0082] S101: The management process sends a second request to the management unit.

[0083] The management unit is used to manage multiple logical units in the CXL storage space of the CXL storage device, and the second request is used to request allocation of a storage space with a second storage capacity for the computing device.

[0084] Exemplarily, the second request carries second storage capacity information.

[0085] In one case, after the computing device is powered on, the CPU of the computing device runs an initialization program, which includes a management process. During the initialization process, the management process triggers sending a second request to the management unit based on a configuration file.

[0086] Configuration file: A computer file that can configure parameters and initial settings for some computer programs. For example, the configuration file is pre-configured to obtain storage space for the second storage capacity.

[0087] In some implementations, technicians can modify the second storage capacity configured in the configuration file as required. Generally, the configured second storage capacity is an integer multiple of the capacity of a logical unit.

[0088] In another case, when an application in the computing device requests a CXL storage space from the management process, if the CXL storage space of the computing device is insufficient, the management process is triggered to send a second request to the management unit.

[0089] S102: The management unit allocates a third storage space to the computing device from available logical units in the CXL storage device.

[0090] The third storage space includes one or more logical units, and the sum of the storage capacities of the one or more logical units is greater than or equal to the second storage capacity.

[0091] The available logical unit is an unallocated logical unit among multiple logical units of the CXL storage device.

[0092] In a possible implementation method, as shown in Table 1, the management unit records metadata of multiple logical units in the CXL storage space of the managed CXL storage device, including but not limited to: an identification of the logical unit, a storage capacity of the logical unit, and an allocation of the logical unit. The identification of the logical unit includes an identity document (ID) of the logical unit.

[0093] Table 1

[0094] Logical unit identification Storage capacity of logical unit Allocation of logical units LD-1 16 GB Assigned to device 1 LD-2 16 GB Assigned to device 2 LD-3 16 GB Unassigned LD-4 16 GB Unassigned LD-5 16 GB Unassigned

[0095] In some embodiments, after receiving the second request sent by the computing device, the management unit first parses the storage capacity information carried in the request to determine that the storage capacity of the storage space requested by the computing device is the second storage capacity. Secondly, the management unit determines from the metadata table shown in Table 1 whether the total storage capacity of the unallocated logical units in the managed CXL storage space can meet the first storage capacity requested by the computing device. If so, a logical unit that meets the first storage capacity is randomly selected from the unallocated logical units and allocated to the computing device. If not, all the remaining unallocated logical units can be allocated to the computing device, or a response message of allocation failure is sent to the computing device.

[0096] Based on the metadata of the multiple logical units recorded in Table 1, the management unit allocates unallocated logical units to computing devices, and modifies the “allocation status of logical units” in Table 1.

[0097] In the allocation of logical units recorded by the management unit in the above Table 1, the device 1 or device 2 in "allocated to device 1" or "allocated to device 2" represents the identifier of the allocated device, which may include the name of the device, or the Internet protocol (IP) address of the device, etc.

[0098] The method for a management unit to allocate logical units to a computing device includes: when the second storage capacity is an integer multiple of the storage capacity of a logical unit, the number of logical units allocated by the management unit to the computing device is equal to the integer multiple; when the second storage capacity is not an integer multiple of the storage capacity of a logical unit, the management unit rounds up the value of the second storage capacity divided by the capacity of a logical unit, and the number of logical units allocated by the management unit to the computing device is equal to the rounded value.

[0099] In one example, if the storage capacity of each logical unit is 16GB, the second storage capacity is 30GB, and 30GB divided by 16GB is equal to 1.875, the management unit rounds 1.875 to get 2. The management unit allocates two unallocated logical units, that is, 32GB of storage capacity, to the computing device. If the computing device is identified as computing device 1, as shown in Table 1, the management unit allocates LD-3, LD-4, and 32GB in Table 1 to computing device 1, and the management unit changes the allocation of the logical units identified as LD-3 and LD-4 in Table 1 from "unassigned" to "allocated to computing device 1".

[0100] Since the management unit manages the CXL storage space with a logical unit as the minimum granularity, when the storage capacity of the storage space applied for by the computing device is less than or equal to the storage capacity of a logical unit, the management unit allocates it according to one logical unit.

[0101] S103: The management unit sends a second response to the management process. Correspondingly, the management process receives the second response from the management unit.

[0102] The second response is used to indicate a third storage space allocated to the computing device, the third storage space includes one or more logical units, the second response includes identifications of the one or more logical units and storage capacities of the one or more logical units, and the sum of the storage capacities of the one or more logical units is greater than or equal to the second storage capacity.

[0103] In one example, as shown in Table 1, the management unit allocates LD-3 and LD-4 in Table 1 to the computing device. At this time, the second response includes: LD-3, LD-4 and 32 GB.

[0104] In one embodiment, after receiving the second response, the management process maps the logical unit allocated by the management unit to the device file and records the offset of the logical unit in the mapped device file. The identification of the logical unit, the storage capacity of the logical unit, the device file name, and the offset of the logical unit are correspondingly stored in the computing device. It is understandable that the information such as the identification of the logical unit, the storage capacity of the logical unit, the device file name, and the offset of the logical unit can be referred to as metadata of the logical unit.

[0105] At this time, the first storage space includes the storage space previously allocated to the computing device and the third storage space. The first storage space is the sum of all storage spaces allocated to the computing device by the management node after the computing device is powered on. If this application is the first application for storage space after the computing device is powered on, the storage space previously allocated to the computing device is 0.

[0106] The device file is the interface of the device driver, allowing the application to interact with the device through the standard input and output system calls. It can be understood that in the embodiment of the present application, the device file is the interface of the driver of the logical unit in the CXL storage device, and the application can write data to the logical unit corresponding to the device file through the device file, or read data in the logical unit corresponding to the device file.

[0107] The offset of the logical unit can indicate the starting address of the logical unit in the mapped device file. When a device file maps only one logical unit, the offset of the logical unit in the mapped device file is 0x0, indicating that the starting address of the logical unit in the mapped device file starts from 0x0. When a device file maps multiple logical units, the offset of the logical unit indicates the offset between the starting address of the logical unit and the initial address 0x0 in the device file.

[0108] In one example, when the management process maps two logical units with a storage capacity of 16GB to the same device file, the offset of the first logical unit is set to 0x0, and the offset of the second logical unit is set to 0x400000000, which indicates that the starting address of the first logical unit starts from the initial address 0x0 in the device file, and the starting address of the second logical unit starts from the address 0x400000000 in the device file.

[0109] In one example, as shown in Table 2, Table 2 is metadata of the logical unit recorded by the computing device. Table 2 includes "identification of the logical unit", "storage capacity of the logical unit", "device file name" and "offset of the logical unit".

[0110] Table 2

[0111] Logical unit identification Storage capacity of logical unit Device file name Logical unit offset LD-3 16 GB / dev / dax.1 0x0 LD-4 16 GB / dev / dax.2 0x0

[0112] After the management process mounts the mapped device file of the logical unit in the above example to the specified directory, it can provide storage services for applications in the computing device, such as allocating storage space in the mounted logical unit to the application, or reclaiming storage space in the mounted logical unit.

[0113] In the above S101-S103, the management process pre-applies for CXL storage space for the computing device. When the application of the computing device subsequently requests allocation of CXL storage space, the storage space required by the application can be directly allocated to the application from the pre-applied logical unit, without the need to apply for storage space across nodes, thus reducing waiting time and improving storage space allocation efficiency.

[0114] After the management process in the computing device applies for CXL storage space for the computing device, the management process subsequently manages the CXL storage space of the computing device. For example, the management process allocates CXL storage space to each application in the computing device, or reclaims the CXL storage space allocated to the application when the application does not use the CXL storage space.

[0115] Next, the storage space management method provided by the embodiment of the present application is described from the perspective of the interaction between the management process and the target application in the computing device. Figure 3 As shown, the method may include S201-S203.

[0116] S201: The target application sends a first request to the management process. Correspondingly, the management process receives the first request sent by the target application in the computing device.

[0117] The first request is used to request to allocate a storage space of a first storage capacity to the target application. The target application sends the first request carrying the first storage capacity to the management process, and after receiving the first request, the management process triggers a process of allocating storage space to the target application.

[0118] The target application is any one of the multiple applications of the computing device. It is understandable that since the CXL storage device has the feature of unlimited expansion and can meet the needs of applications with large storage space, the management unit can allocate storage space with a larger storage capacity to the computing device, which can support applications with large storage capacity requirements, such as cloud computing, artificial intelligence, big data or high-performance computing.

[0119] Exemplarily, the target application may send the first request to the management process through the CXL_malloc interface in the interface provided by the SDK.

[0120] S202: The management process determines a first storage segment that meets the first storage capacity from the first storage space.

[0121] The first storage space is a storage space allocated by the CXL storage device to the computing device, and the first storage space includes one or more logical units.

[0122] The first storage segment is a storage segment with available storage capacity among the multiple storage segments into which the computing device divides the logical unit, and the available storage capacity of the first storage segment is greater than or equal to the first storage capacity.

[0123] Available storage capacity refers to the storage capacity that is not in use.

[0124] The first storage segment may be a storage segment in the first storage space that meets the first storage capacity, or may be a plurality of storage segments in the first storage space that meet the first storage capacity.

[0125] In a possible implementation, the management process presets storage segment specifications (hereinafter referred to as preset specifications) according to the size of the storage capacity. The preset specifications may be the same or different. The management process divides the storage space of the logical unit based on the preset specifications to obtain multiple storage segments. When the preset specifications are the same, the storage capacity of each storage segment in the multiple storage segments is the same; when the preset specifications are different, the storage capacity of at least some of the storage segments in the multiple storage segments is different. In this case, the storage capacity of any two storage segments in the storage segments with at least some different storage capacities satisfies an integer multiple relationship.

[0126] Exemplarily, as shown in Table 3, Table 3 shows 7 preset specifications, wherein the storage capacities of storage segments of any specifications satisfy an integer multiple relationship.

[0127] Table 3

[0128]

[0129] If the storage capacity of the logical unit managed by the management process is 16 GB, the management process may divide the logical unit into a plurality of storage segments of corresponding storage capacity based on the storage capacity of the preset specification shown in Table 3.

[0130] The preset specifications shown in Table 3 include 7 specifications, which are generally pre-planned based on the storage capacity of the logical unit. When the storage capacity of the logical unit is larger or smaller than 16GB, other corresponding storage capacities can be set based on the storage capacity of the actual logical unit, and more (e.g., 8, 9, ... 15) or fewer (e.g., 6, 5, ... 1) specifications than 7 specifications can be set in the preset specifications. For example, when the storage capacity of the logical unit is 32GB, 8 specifications can be preset. In addition to the 7 specifications shown in Table 3, the 8 preset specifications also include a 32GB specification. The embodiment of the present application does not limit the method for setting the preset specifications.

[0131] Among the preset specifications shown in Table 3, the minimum specification is set to 256MB, which can meet the needs of most applications with large storage space requirements such as cloud computing, artificial intelligence, big data or high-performance computing. In actual application, the size of the minimum specification can be adjusted based on the needs of the application scenario. For example, when there are some applications in the application scenario that require a storage space capacity of about 128MB, the minimum specification in the preset specification can be set to 128MB; when the application in the application scenario requires a minimum storage capacity of about 512MB for the storage space, the minimum specification in the preset specification can be set to 512MB.

[0132] The preset specifications shown in Table 3 can meet the storage capacity requirements of various applications for storage space. In addition, the integer multiple relationship between the preset specifications facilitates the subsequent merging management of storage segments and improves the efficiency of storage segment management.

[0133] Optionally, after the management process divides the logical unit into a plurality of storage segments based on a preset specification, the management process maintains the number of storage segments corresponding to the preset specification in each logical unit of the computing device.

[0134] In one example, the management process maintains the number of storage segments of a logical unit with a storage capacity of 16 GB based on the preset specifications shown in Table 3. As shown in Table 4, Table 4 records "Specifications" and "Quantity", wherein the "Specifications" line records the 7 preset specifications shown in Table 3, and the "Quantity" line records the available number of storage segments in the logical unit corresponding to each preset specification in Table 3. In this example, free_list can be used to represent the available number of storage segments corresponding to each specification of storage capacity.

[0135] Table 4

[0136] Specification 256MB 512MB 1GB 2GB 4GB 8GB 16 GB quantity free_list=0 free_list=0 free_list=0 free_list=0 free_list=0 free_list=0 free_list=1

[0137] It can be seen from Table 4 above that the number of storage segments with a storage capacity of 16 GB in the logical unit is 1, and the number of storage segments corresponding to other specifications is 0. It can also be understood that the logical unit has not been segmented by the management process.

[0138] In another example, the management process maintains the number of storage segments of a logical unit with a storage capacity of 16 GB based on the preset specifications shown in Table 3. As shown in Table 5, Table 5 records "Specifications" and "Quantity", wherein the "Specifications" line records the seven preset specifications shown in Table 3, and the "Quantity" line records the available number of storage segments in the logical unit corresponding to each preset specification in Table 3. In this example, free_list can be used to represent the available number of storage segments of each specification.

[0139] Table 5

[0140] Specification 256MB 512MB 1GB 2GB 4GB 8GB 16 GB quantity free_list=2 free_list=1 free_list=1 free_list=1 free_list=1 free_list=1 free_list=0

[0141] It can be seen from Table 5 above that the management process divides the logical unit into multiple storage segments according to the storage capacity of the preset specifications. The available quantity of each storage segment can be seen in the "Quantity" line in Table 5.

[0142] Optionally, after executing S103, the management process may divide one or more logical units allocated by the management unit to the computing device into multiple storage segments according to the segmentation method shown in Table 5, so that when the target application subsequently applies for storage space, the storage segment that meets the needs of the target application can be directly selected from the divided storage segments. Alternatively, after executing S103, the management process may first manage the logical units according to the method shown in Table 4 (i.e., without segmenting first), and then after receiving a request for storage space from the target application in S104, the management process may segment the logical units shown in Table 4 into storage segments of multiple specifications shown in Table 5 based on the needs of the target application.

[0143] In one example, if Figure 4 As shown, Figure 4 The diagram shows the process of the management process splitting the storage space of the logical unit from the storage segments shown in Table 4 to the storage segments shown in Table 5. In this process, the management process first splits the logical unit into two 8GB storage segments, then splits one of the 8GB storage segments into two 4GB storage segments, and continues to split a 4GB storage segment into two 2GB storage segments, then split a 2GB storage segment into two 1GB storage segments, then split a 1GB storage segment into two 512MB storage segments, and then split a 512MB storage segment into two 256MB storage segments, and then the dynamic split ends. Among them, Figure 4The offset indicates the starting address of each storage segment.

[0144] In the above optional method, the management process splits the logical unit into multiple storage segments with different storage capacities, for example, splits the logical unit based on preset specifications, and the storage capacity of the split storage segments can meet the different storage capacity requirements of various applications.

[0145] When the management process determines that there is available storage space in the first storage space whose storage capacity is greater than or equal to the second storage capacity, if the storage capacity of multiple available storage segments in the first storage space is less than the second storage capacity, the first storage segment includes multiple storage segments whose storage capacity is less than the second storage capacity. If there is at least one available storage segment in the first storage space whose storage capacity is greater than or equal to the second storage segment, then the optional method of S202a-S202b is executed to determine the first storage segment.

[0146] A storage segment having available storage capacity is hereinafter referred to as an available storage segment.

[0147] In an example, as shown in Table 6, Table 6 shows the number of available storage segments in a logical unit. When the first storage capacity requested by the target application is less than or equal to 512MB, it can be seen from Table 6 that there are an available storage segment of 512MB and 1GB respectively. At this time, it indicates that the logical unit has an available storage segment with a storage capacity greater than or equal to the first storage capacity.

[0148] Table 6

[0149] Specification 256MB 512MB 1GB 2GB 4GB 8GB 16 GB quantity free_list=0 free_list=1 free_list=1 free_list=0 free_list=0 free_list=0 free_list=0

[0150] In a possible implementation, the embodiment of the present application proposes a specific method for determining a first storage segment of a first storage capacity in the first storage space in S202 based on the first storage space, including S202a-S202b.

[0151] S202a: The management process determines at least one candidate storage segment from the first storage space.

[0152] The storage capacity of each storage segment of the at least one candidate storage segment is greater than or equal to the first storage capacity.

[0153] In an example, the first storage capacity is less than or equal to 512MB. If the first storage space includes the logical units shown in Table 6, taking the logical units shown in Table 6 as an example, the candidate storage segments are the storage segments with storage capacities of 512MB and 1GB in Table 6.

[0154] S202b: The management process determines a first storage segment from at least one candidate storage segment.

[0155] The storage capacity of the first storage segment is smaller than the capacity of other storage segments in at least one candidate storage segment, that is, the storage segment with the smallest storage capacity in at least one candidate storage segment (hereinafter referred to as the second storage segment) is allocated to the target application as the first storage segment.

[0156] In one example, if the first storage capacity is equal to 200MB, for the logical unit shown in Table 6, the candidate storage segments are storage segments with storage capacities of 512MB and 1GB in Table 6, respectively, and the second storage segment is a storage segment whose storage capacity is less than the capacity of other storage segments in at least one candidate storage segment, that is, a storage segment with a storage capacity of 512MB. The management process can allocate the 512MB storage segment as the first storage segment to the target application.

[0157] Optionally, in combination with Table 3, if there is a specification among multiple preset specifications whose storage capacity is smaller than the storage capacity of the second storage segment (hereinafter referred to as the target specification), and the storage capacity corresponding to the target specification is greater than or equal to the first storage capacity, the second storage segment can be further split to split out a storage segment of the target specification, and the storage segment of the target specification can be used as the first storage segment.

[0158] For example, in the above example, as shown in Table 6, the storage capacity of the available storage segment is 512MB and 1GB. When the first storage capacity (e.g., 200MB) is less than or equal to 256MB, it indicates that in the preset specifications, there is a storage capacity of 256MB that can meet the first storage capacity. At this time, S202b1-S202b2 can be specifically executed to further determine the first storage segment.

[0159] S202b1: The management process splits a second storage segment in at least one candidate storage segment into multiple sub-storage segments.

[0160] There is at least one sub-storage segment among the multiple sub-storage segments whose storage capacity is greater than or equal to the first storage capacity; and the storage capacity of the second storage segment is less than the capacity of other storage segments in the at least one candidate storage segment.

[0161] In one possible implementation, the management process splits the second storage segment into multiple sub-storage segments based on a preset storage capacity specification, wherein the storage capacity of the multiple sub-storage segments also meets the preset storage capacity specification, and the storage capacity of the multiple sub-storage segments may be the same or different.

[0162] In an example, if the storage capacity of the second storage segment is 512 MB and the first storage capacity is 200 MB, combined with the preset specifications shown in Table 6, 512 MB can be split into two 256 MB storage segments.

[0163] In another example, if the storage capacity of the second storage segment is 1GB and the first storage capacity is 200MB, combined with the preset specifications shown in Table 6, 1GB can be split into 2 256MB storage segments and 1 512MB storage segment, or 1GB can be split into 4 256MB storage segments.

[0164] In another example, if the storage capacity of the second storage segment is 2GB and the first storage capacity is 200MB, combined with the preset specifications shown in Table 6, the 2GB can be split into 2 256MB storage segments, 1 512MB and 1 1GB storage segment, or the 2GB can be split into 8 256MB storage segments, or the 2GB can be split into 4 256MB storage segments and 1 1GB storage segment.

[0165] The above example only illustrates a partial splitting method of a sub-storage segment, and the embodiments of the present application do not limit it.

[0166] After the management process splits out multiple sub-storage segments, the management process updates the number of storage segments corresponding to the specification at the specification corresponding to the storage capacity of the sub-storage segment in the table of the number of storage segments corresponding to the preset specification maintained by the management process.

[0167] In one example, in the logical unit shown in Table 6, the second storage segment is a storage segment with a storage capacity of 512MB, and the management process can split the second storage segment into two 256MB sub-storage segments. At this time, the management process updates the number of 256MB storage segments and the number of 512MB storage segments in Table 6 to obtain Table 7.

[0168] Table 7

[0169] Specification 256MB 512MB 1GB 2GB 4GB 8GB 16 GB quantity free_list=2 free_list=0 free_list=1 free_list=0 free_list=0 free_list=0 free_list=0

[0170] S202b2: The management process determines a sub-storage segment among the multiple sub-storage segments whose storage capacity is greater than or equal to the first storage capacity as the first storage segment.

[0171] In one example, as shown in Table 7, the management process determines the sub-segment with a storage capacity of 256 MB in Table 7 as the first storage segment.

[0172] The implementation method of S202b1-S202b2 can determine the storage segment with the minimum specifications that meets the first storage capacity based on the preset specifications. If such a storage segment does not exist, the storage segment with the minimum specifications is split out from a storage segment with a storage capacity larger than that of the storage segment, thereby meeting the target application's demand for storage space. It can also avoid allocating too much storage space to the target application, which is not needed by the target application, thereby wasting the storage space in the storage segment and improving the utilization rate of the storage space.

[0173] For S202, the embodiment of the present application proposes a possible implementation method, the management process sets the array according to the preset specifications shown in Table 3, and 0-6 in the array respectively represent the available linked lists of the storage segments corresponding to 256MB, 512MB, 1GB, 2GB, 4GB, 8GB and 16GB in Table 3. For example, accessing array 0 can access the available linked list of the storage segment with a storage capacity of 256MB, and the starting address and storage capacity of the storage segment are hung under the available linked list. If the first storage capacity is 300MB, for the logical unit shown in Table 6, the management process queries arrays 0 to 6 in sequence. When array 1 is queried, the available number of the 512MB storage segment is queried to be 1. At this time, the storage segment is allocated to the target application as the first storage segment, and subsequent arrays 2 to 6 do not need to be queried again. If the first storage capacity is 200MB, for the logical units shown in Table 6, the management process queries arrays 0 to 6 in sequence. When array 1 is queried, it is found that the available number of the 512MB storage segment is 1. At this time, the management process can divide the 512MB storage segment into two 256MB storage segments, and add the two 256MB storage segments to the available linked list of the 256MB storage segments, and allocate one of the 256MB storage segments as the first storage segment to the target application. Subsequent arrays 2 to 6 do not need to be queried again.

[0174] It can be seen from the above possible implementation methods that the management process can query the availability of each storage segment in turn from the storage segment with small storage capacity to the storage segment with large storage capacity by traversing. When there is a storage segment that meets the application requirements, the storage segment is allocated to the application. If the storage segment that meets the application requirements does not exist, the storage segment that meets the application requirements can be split from the larger storage segment.

[0175] When the management process determines that there is no available storage space in the first storage space with a storage capacity greater than or equal to the first storage capacity, the management process may first execute the following S202A-S202B to allocate a new logical unit (first logical unit) to the computing device, and then execute the optional method S202a-S202b to determine the first storage segment.

[0176] The following is a process in which the management process applies to the management unit for storage space for the target application, and the process includes S202A-S202B.

[0177] S202A: The management process sends a third request to the management unit. The third request is used to request to apply for a storage space of the first storage capacity for the computing device.

[0178] S202B: The management process receives a third response from the management unit.

[0179] The third response is used to indicate a fourth storage space allocated to the computing device, the fourth storage space includes the first logical unit, the third response includes an identifier of the first logical unit and a storage capacity of the first logical unit, and the storage capacity of the first logical unit is greater than or equal to the first storage capacity.

[0180] S203: The management process sends a first response to the target application.

[0181] The first response is used to indicate a first storage segment allocated for the target application, and the first response includes an address of the first storage segment.

[0182] Exemplarily, the address of the first storage segment includes an identifier of the logical unit, a starting address of the first storage segment, and a storage capacity of the first storage segment, or the address of the first storage segment includes an identifier of the logical unit, a starting address of the first storage segment, and an end address of the first storage segment.

[0183] The identifier of the logical unit in the address of the first storage segment is the identifier of the logical unit where the first storage segment is located.

[0184] If the first storage segment is composed of storage segments in multiple logical units, the identifier of the logical unit in the address of the first storage segment includes identifiers of the multiple logical units.

[0185] For example, if the first storage segment includes at least a portion of the storage space of the first logical unit, the identifier of the logical unit in the address of the first storage segment includes the identifier of the first logical unit and the identifier of the logical unit in the storage space allocated to the computing device before the first logical unit.

[0186] The identifier of the logical unit may be an identifier of a device file mapped by the logical unit, such as a device file name.

[0187] In one possible implementation, the starting address of the first storage segment can be represented by an offset relative to the starting address of the logical unit to represent the starting address of the first storage segment allocated to the target application. Since the starting address of the logical unit can be represented by an offset based on the initial address 0x0 of the device file mapped to the logical unit, the starting address of the first storage segment can be represented by an offset based on the initial address 0x0 of the device file mapped to the logical unit where the storage segment is located.

[0188] In one example, if Figure 5 As shown, Figure 5 A schematic diagram of multiple storage segments of a logic unit is shown, wherein the starting addresses of the multiple storage segments of the logic unit are represented by offsets. Figure 5 It can be seen that the starting address of the logical unit in the mapped device file is 0x0.

[0189] In one example, Figure 5 The device file name mapped to the logical unit shown is / dev / dax.1. If the first storage capacity requested by the target application is 256MB, Figure 5 It can be seen from the logical unit shown that the logical unit has two available 256MB storage segments, with starting addresses offset = 0x0 and offset = 0x10000000, respectively. The management process can allocate any one of the storage segments with a storage capacity of 256MB to the target application. If devpath is used to represent the identifier of the device file and size is used to represent the storage capacity of the storage segment, the first response includes: devpath = / dev / dax.1, offset = 0x0, size = 256MB, or devpath = / dev / dax.1, offset = 0x10000000, size = 256MB.

[0190] If the first storage segment includes multiple storage segments, the start address of the first storage segment includes the start addresses of the multiple storage segments respectively. In this case, the identifier of the logical unit includes the identifiers of the logical units where the multiple storage segments in the first storage segment are respectively located.

[0191] In an example, the first storage segment includes "storage segment 1" and "storage segment 2", wherein "storage segment 1" is in "logical unit 1", "storage segment 2" is in "logical unit 2", the device file name corresponding to "logical unit 1" is " / dev / dax.1", and the device file name corresponding to "logical unit 2" is " / dev / dax.2", the storage capacity of "storage segment 1" is 128MB, the storage capacity of "storage segment 2" is 128MB, the offset address of "storage segment 1" in the device file " / dev / dax.1" is offset=0x10000000, and the offset address of "storage segment 2" in the device file " / dev / dax.2" is offset=0x40000000. At this time, the first response includes: devpath= / dev / dax.1, offset=0x10000000, size=128MB, devpath= / dev / dax.2, offset=0x40000000, size=128MB.

[0192] In the above management method, the management process in the computing device divides the first storage space into storage segments with fixed storage capacity and allocates them to the target application, which can reduce the storage fragmentation generated by allocating storage space based on application needs in related technologies. This method can improve management efficiency.

[0193] Combination Figure 3 ,like Figure 6As shown, after the storage space is allocated to the target application, the storage space management method provided in the embodiment of the present application also includes S204-S205.

[0194] S204 (optional): When the number of available storage segments with the same storage capacity and continuous addresses among multiple storage segments is greater than a preset threshold, the management process merges the available storage segments with the same storage capacity and continuous addresses in pairs.

[0195] Continuous addresses refer to storage segments with adjacent addresses.

[0196] In one example, if the preset threshold is 2, when the number of available storage segments with the same storage capacity and continuous addresses is greater than 2, the management process merges the available storage segments with the same storage capacity and continuous addresses in pairs.

[0197] like Figure 7 As shown, Figure 7 The number and address of multiple storage segments are shown in FIG. 1 , where the available storage segments "segment 1", "segment 2", "segment 3" and "segment 4" have the same capacity, which is 256MB respectively. Therefore, the free_list corresponding to 256MB is 4. However, Figure 7 It can be seen that the addresses of "storage segment 1", "storage segment 2" and "storage segment 3" are continuous, and there is "storage segment 5" between "storage segment 4" and "storage segment 1", "storage segment 2" and "storage segment 3", so the addresses are not continuous, and the storage capacity of "storage segment 5" is 512MB. At this time, the free_list corresponding to 512MB is 1.

[0198] Figure 7 The available storage segments with the same storage capacity and continuous addresses are "segment 1", "segment 2" and "segment 3", and the number is 3, which exceeds the preset threshold 2. At this time, the "segment 1" and "segment 2" with continuous addresses in "segment 1", "segment 2" and "segment 3" can be merged into "segment 6" (after the merger, as shown in Figure 8 As shown), at this time, the free_list corresponding to 256MB is 2, and the free_list corresponding to 512MB is 2. Alternatively, the "storage segment 2" and "storage segment 3" with consecutive addresses are merged into "storage segment 7" (after merging, as shown in Fig. 9 As shown, at this time, the free_list corresponding to 256MB is 2, and the free_list corresponding to 512MB is 2.

[0199] When the number of available storage segments with the same storage capacity and continuous addresses is greater than a preset threshold, the storage segments are merged into a storage segment with a larger storage capacity, which can provide storage services for applications with greater storage capacity requirements. This method implements dynamic management of storage segments, splits storage segments when applications need them, and merges storage segments when there are surplus storage segments. This management method is more flexible.

[0200] S205 (optional): When the management process determines that the target application stops running, reclaim the storage segment allocated to the target application.

[0201] The storage segment allocated to the target application includes a first storage segment.

[0202] Optionally, the target application stops running in two cases: normal stopping running, or abnormal stopping running.

[0203] For example, in one case, when the target application exits normally, the target application sends a stop message to the management process, and the management process reclaims the storage segment allocated to the target application in response to the stop message.

[0204] In another case, the underlying software of the computing device (such as a socket) detects that the target application has an exception and stops running, and sends a message to the management process indicating that the target application has stopped running. At this time, the management process reclaims the storage segment allocated to the target application based on the stop message.

[0205] For the case where the target application program exits normally, the present application embodiment proposes a possible implementation method, such as Fig.10 As shown, it may specifically include S205a-S205c:

[0206] S205a: The target application sends a return request, and correspondingly, the management process receives the return request sent by the target application.

[0207] The return request is used to request the return of a storage segment with a first identifier. The first identifier is an identifier of the first storage segment. The return request carries the first identifier.

[0208] In one possible implementation, Fig.11 As shown, Fig.11 The identifier queue of the storage segment maintained by the management process is shown. When the management process allocates a storage segment to a target application, an identifier is obtained from the identifier queue and allocated to the storage segment. When the management process reclaims the storage segment allocated to the target application, the identifier allocated to the storage segment is reclaimed back to the identifier queue to facilitate the subsequent allocation of identifiers to other storage segments.

[0209] Fig.11The identifier queue shown stores usable identifiers. After the management process obtains an identifier from the identifier queue and assigns it to a storage segment, it deletes the identifier assigned to the storage segment from the identifier queue. After the management process recycles the storage segment, it recycles the identifier assigned to the storage segment back to the identifier queue. At this time, the management process adds the recycled identifier to the identifier queue.

[0210] Fig.11 The identification queue shown is only one possible implementation method, and the actual implementation is not limited to this. For example, the management process can also randomly generate identifications and assign them to storage segments. This is not limited to the embodiments of the present application.

[0211] Optionally, the first identifier may be included in a first response when the management process sends a first response to the target application.

[0212] Optionally, after allocating the first identifier to the first storage segment, the management process establishes a correspondence between the first identifier and the address of the first storage segment. For example, the management process establishes a correspondence between the identifier of the logical unit, the starting address of the first storage segment, and the storage capacity of the first storage segment, wherein the identifier of the logical unit includes the ID of the logical unit or the identifier of the device file mapped by the logical unit.

[0213] In one example, as shown in Table 8, Table 8 shows the correspondence between the identifier (key) and the ID (LD-ID) of the logical unit, the identifier (devpath) of the device file corresponding to the logical unit, the starting address (offset) of the first storage segment, and the storage capacity (size) of the first storage segment. In Table 8, key=0 is the first identifier.

[0214] Table 8

[0215]

[0216] When the target application program exits normally, a request for returning the storage segment with the first identifier is sent to the management process.

[0217] In one example, the target application sends a request to the management process to “return the storage segment with key=0”.

[0218] S205b: The management process reclaims the first storage segment in response to the return request.

[0219] In an example, the management process receives a request from the target application to "reclaim the storage segment with key = 0", finds the information of the storage segment with key = 0 from the corresponding relationship shown in Table 8, and reclaims the storage segment with a starting address of "0x00000000" and a storage capacity of "256MB" in the device file name " / dev / dax.1".

[0220] In a possible implementation, a specific process of reclaiming the first storage segment allocated to the target application may include: the management process changes the state of the first storage segment from "allocated" to "unallocated", adds one to the available number (free_list) corresponding to the first storage segment in the maintained table of available storage segments (such as in Table 5), and sends an indication message to the management unit, instructing the management unit to delete the data in the CXL storage device corresponding to the first storage segment.

[0221] S205c: The management process reclaims the first identifier.

[0222] It is understandable that the identifier is obtained by the management process from the identifier queue. After reclaiming the first storage segment, the management process also reclaims the first identifier assigned to the first storage segment. The first identifier can also be subsequently assigned to other storage segments, such as the third storage segment. Since the length of the identifier queue is limited, timely recycling of the identifier can recycle the identifier to improve the identifier utilization rate and avoid identifier queue data overflow.

[0223] Optionally, when the management process allocates the third storage segment to the application, the first identifier is allocated to the third storage segment.

[0224] In the above method, when an application stops running, the management process promptly reclaims the storage space allocated to the application, which can avoid the stopped application occupying the storage space, resulting in insufficient storage space capacity in the first storage space, and the need to apply for storage space from the management unit. Therefore, timely recovery of the storage space can continue to allocate this part of the storage space to other applications for use, and can avoid applying for storage space across nodes when the storage capacity of the first storage space is insufficient, thereby improving storage space utilization and allocation efficiency and reducing allocation delays.

[0225] In a possible implementation, the management process can query the specifications shown in Table 4 and the number of storage segments corresponding to each specification by means of a linked list, query the address of the storage segment corresponding to the identifier of the storage segment in Table 8 by means of a linked list, and query the address of the storage segment corresponding to the identifier of the storage segment in Table 8 by means of a linked list. Fig.11 The identifiers in the identifier queue are shown.

[0226] In the above implementation, the management process can use a linked list to implement table 4, table 8 and Fig.11 In this way, the management process maintains a linked list, which can save management resources. The management process can also use three linked lists to query Table 4, Table 8 and Fig.11 In this way, the management process maintains three linked lists, each linked list queries different information, and can quickly query the required information based on needs, thereby improving query efficiency.

[0227] Please refer to Fig.12 , is a flow chart of another storage space management method provided by an embodiment of the present application. The method is applied to a management process in a computing device, such as Fig.12 As shown, the method may include S301-S307.

[0228] S301: The management process obtains usage status of each logical unit in the first storage space.

[0229] The usage includes the usage time of the logical unit, which is used to record the time when the storage space in the logical unit was returned after the last use. If the storage space in the logical unit is being used and has not been returned, there is no time record in the usage time. Optionally, the usage time can record that the logical unit is in use. After all the storage space is returned, the computing device records the last return time in the usage time.

[0230] In some implementations, a trigger condition is set in the management process of the computing device to trigger the management process to inspect the usage of each logical unit.

[0231] The triggering condition for the management process to obtain the usage of each logical unit in the first storage space may include: a periodic inspection function is set in the management process of the computing device, and the periodic inspection function can periodically trigger the detection of the usage of the first storage space. Alternatively, when the management process reclaims the storage space of a certain application, the detection of the usage of the first storage space is triggered.

[0232] It is understandable that setting a trigger condition in the management process can trigger the management process to inspect each logical unit and find idle logical units in time.

[0233] Exemplarily, as shown in Table 9, Table 9 is the usage of each logical unit in the first storage space obtained by the management process under the trigger condition. Table 9 includes "identification of the logical unit" and "usage time of the logical unit". Optionally, Table 9 also includes the state of each logical unit, and the state includes: being used, not being used, or being released.

[0234] Table 9

[0235] Logical unit identification Logical unit usage time The state of the logical unit LD-3 10:30 Not used LD-4 11:30 Not used LD-5 In use In use

[0236] It can be seen from Table 9 above that the storage space in the logical unit LD-3 was last used and returned at 10:00, the storage space in the logical unit LD-4 was last used and returned at 10:30, and the storage space in the logical unit LD-5 is still in use and has not been returned.

[0237] S302: The management process determines whether there is an idle logical unit in the first storage space according to the usage of each logical unit.

[0238] If there is an idle logical unit, execute S303;

[0239] If there is no idle logical unit, the process ends.

[0240] In some implementations, a specific implementation may be proposed for S302, including: S302a-S302b.

[0241] S302a: The management process determines unused logical units based on the usage time of each logical unit.

[0242] Exemplarily, based on the usage of each logical unit in the first storage space shown in Table 9, it is determined that the unused logical units are LD-3 and LD-4.

[0243] S302b: When the unused logical unit has not been used for a period of time greater than or equal to a preset time period, the management process determines the unused logical unit as an idle logical unit.

[0244] The idle logical unit is a logical unit that has not been used within a preset time period.

[0245] The preset time period indicates a length of time, such as 1 hour, or a day, etc. The technician can adjust the value of the preset time period based on needs.

[0246] Exemplarily, based on the usage of each logical unit in the first storage space shown in Table 9, if the time when the management process triggers the acquisition of the usage of each logical unit in the first storage space is 12:00, it can be seen from Table 9 that LD-3 has not been used for 1.5 hours and LD-4 has not been used for 0.5 hours. If the preset time period is 1 hour, and the unused time of LD-3 for 1.5 hours is greater than 1 hour, the computing device determines LD-3 as an idle logical unit.

[0247] S303: The management process marks the state of the idle logical unit as being released.

[0248] A metadata table is stored in the computing device, and the metadata table includes the state of each logical unit in the first storage space, such as the state of the logical unit recorded in Table 9.

[0249] Exemplarily, as shown in Table 10, the computing device records the state of the logic unit LD-3 in Table 9 as "releasing state".

[0250] Table 10

[0251] Logical unit identification Logical unit usage time The state of the logical unit LD-3 10:30 Releasing state LD-4 11:30 Not used LD-5 In use In use

[0252] The logical unit is marked as being released, so that when an application subsequently requests storage space, the storage space in the logical unit with the mark will not be allocated to the application, thereby avoiding application failure. Of course, in other embodiments, the method may not include S303, that is, after S302, S304 is executed.

[0253] S304: The management process sends a return request to the management unit.

[0254] The return request is used to request the return of an idle logical unit. The return request carries the identifier of the logical unit to be returned, for example: return LD-3.

[0255] S305: After receiving the return request, the management unit reclaims the idle logical unit that the management process requests to return.

[0256] In some embodiments, after receiving the request of "returning LD-3", the management unit modifies the allocation status of the logical unit to "unassigned" in the metadata as described in Table 1 to release the binding relationship between the logical unit LD-3 and the computing device, and executes the CXL_unbind LD-3 instruction to delete the data in the storage space corresponding to LD-3 in the CXL storage device.

[0257] Deleting the data in the idle logical unit can ensure that the data of the last computing device that used the logical unit will not be acquired by the next computing device that uses the logical unit, thereby ensuring data security.

[0258] S306: The management unit sends a message of successful return to the management process.

[0259] S307: After receiving the return success message sent by the management unit, the management process deletes the metadata corresponding to the idle logical unit in the metadata table.

[0260] Exemplarily, the management process deletes the metadata corresponding to LD-3 in Table 10.

[0261] In the method, the management process can regularly inspect each logical unit in the first storage space, determine the idle logical units therein based on the usage of each logical unit, and return the idle logical units to the management unit in a timely manner so that the management unit can allocate the idle logical units to other computing devices, thereby effectively improving the utilization rate of the logical units.

[0262] In the above S101-S103 and S301-S307, the computing device can interact with the management unit through the management process (such as LMD) running in the CPU, or can interact with the management unit through other processes, which is not limited in the embodiments of the present application.

[0263] In the related art, when the operating system allocates storage space for an application, it needs to switch back and forth between kernel state and user state. When switching from user state to kernel state, the processes that need to be experienced include: setting the processor to kernel state, saving the current registers, pointing the stack pointer to the kernel stack address, etc. When switching from kernel state back to user state, it is necessary to go through similar processes mentioned above. It can be seen that there is a certain overhead when the operating system switches between user state and kernel state. If switching is frequent, it will accumulate huge overhead, waste computing resources, and have low processing efficiency.

[0264] The storage space management method proposed in the embodiment of the present application can be applied to the management process in the computing device. The CXL storage space of the computing device is managed by the management process running in the user state in the computing device. The process of allocating or reclaiming storage space for the application by the management process is completed in the user state. Compared with the memory management method of the traditional technology in which the processor needs to switch between the kernel state and the user state, this method can reduce the number of switching times, save computing resources, and improve software management efficiency.

[0265] In addition, since in the storage space management method proposed in the embodiment of the present application, the computing device divides the first storage space into storage segments with fixed storage capacity and allocates them to the target application, it can reduce the storage fragmentation generated by allocating storage space based on the needs of the application in the related technology and improve management efficiency.

[0266] The above mainly introduces the solution provided by the embodiment of the present application from the perspective of the method. In order to achieve the above functions, it includes hardware structures and / or software modules corresponding to the execution of each function. It should be easy to realize that the technical goals in this field are combined with the units and algorithm steps of each example described in the embodiments disclosed in this article, and the embodiments of the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical goals can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the embodiments of the present application.

[0267] The present application embodiment also provides a computing device 200. Fig.13 FIG. 2 is a schematic diagram of a computing device 200 provided in an embodiment of the present application. The computing device 200 may be Figure 1 Any computing device in .

[0268] The computing device 200 includes: a receiving unit 201, which is used to receive a first request sent by a target application in the computing device; the first request is used to request to allocate a storage space of a first storage capacity to the target application; a processing unit 202, which is used to determine a first storage segment that meets the first storage capacity from the first storage space; the first storage space is a storage space allocated to the computing device by the CXL storage device, the first storage space includes one or more logical units, the first storage segment is a storage segment with available storage capacity among multiple storage segments into which the computing device divides the logical unit, and the available storage capacity of the first storage segment is greater than or equal to the first storage capacity; a sending unit 203, which is used to send a first response to the target application; the first response is used to indicate the allocation of the first storage segment to the target application, and the first response includes the address of the first storage segment. For example, in combination with Figure 3 The receiving unit 201 can be applied to S201 in the method embodiment, the processing unit 202 can be applied to S202 in the method embodiment, and the sending unit 203 can be applied to S203 in the method embodiment.

[0269] In one implementation, the storage capacity of each storage segment in the multiple storage segments is the same, or the storage capacity of at least some of the storage segments in the multiple storage segments is different.

[0270] In one implementation, the storage capacities of any two storage segments in at least some of the storage segments having different storage capacities satisfy an integer multiple relationship.

[0271] In one embodiment, determining a first storage segment that meets the first storage capacity from the first storage space includes: determining at least one candidate storage segment from the first storage space; the storage capacity of each storage segment in the at least one candidate storage segment is greater than or equal to the first storage capacity; determining the first storage segment from the at least one candidate storage segment; the storage capacity of the first storage segment is less than the storage capacity of other storage segments in the at least one candidate storage segment. For example, the processing unit 202 can be applied to S202a-S202b in the method embodiment.

[0272] In one embodiment, the processing unit 202 is specifically configured to: split the second storage segment in at least one candidate storage segment into multiple sub-storage segments; at least one sub-storage segment in the multiple sub-storage segments has a storage capacity greater than or equal to the first storage capacity; the storage capacity of the second storage segment is less than the storage capacity of other storage segments in at least one candidate storage segment; and determine a sub-storage segment in the multiple sub-storage segments whose storage capacity is greater than or equal to the first storage capacity as the first storage segment. For example, the processing unit 202 can be applied to S202b1-S202b2 in the method embodiment.

[0273] In one embodiment, the processing unit 202 is further configured to merge the available storage segments with the same storage capacity and continuous addresses in pairs when the number of available storage segments with the same storage capacity and continuous addresses in the multiple storage segments is greater than a preset threshold. Figure 3 , the processing unit 202 can be applied to S204 in the method embodiment.

[0274] In one implementation, the sending unit 203 is further used to send a second request to the management unit; the second request is used to request that a storage space of a second storage capacity be allocated to the computing device; the receiving unit 201 is further used to receive a second response from the management unit; the second response is used to indicate a third storage space allocated to the computing device, the third storage space includes one or more logical units, the second response includes the identifiers of the one or more logical units and the storage capacity of the one or more logical units, the sum of the storage capacity of the one or more logical units is greater than or equal to the second storage capacity; the first storage space includes the storage space previously allocated to the computing device and the third storage space. For example, in combination Figure 2 The sending unit 201 can be applied to S101 in the method embodiment, and the receiving unit 203 can be applied to S103 in the method embodiment.

[0275] In one embodiment, the sending unit 203 is further used to, after receiving the first request sent by the target application in the computing device and before sending the first response to the target application, send a third request to the management unit when there is no available storage space with a storage capacity greater than or equal to the first storage capacity in the first storage space; wherein the third request is used to request to apply for a storage space of the first storage capacity for the computing device; the receiving unit 201 is also used to receive a third response from the management unit; the third response is used to indicate a fourth storage space allocated for the computing device, the fourth storage space includes the first logical unit, the third response includes an identifier of the first logical unit and the storage capacity of the first logical unit, the storage capacity of the first logical unit is greater than or equal to the first storage capacity; the sending unit 203 is specifically used to send the first response to the target application, the first response is used to indicate a first storage segment allocated for the target application, the first storage segment includes at least part of the storage space of the first logical unit. For example, the sending unit 203 can be applied to S202A in the method embodiment, and the receiving unit 201 can be applied to S202B in the method embodiment.

[0276] In one implementation, the processing unit 202 is further configured to receive a return request sent by the target application, the return request including a first identifier, the first identifier being an identifier of the first storage segment; and in response to the return request, reclaim the first storage segment. Fig.10 , the processing unit 202 can be applied to S205a-S205b in the method embodiment.

[0277] In one implementation, the sending unit 203 is further configured to send a return request to the management unit when determining that there is an idle logical unit in the first storage space of the computing device; the return request is used to request the return of the idle logical unit, where the idle logical unit is a logical unit that has not been used within a preset time period. Fig.12 The sending unit 203 can be applied to S304 in the method embodiment.

[0278] Of course, the computing device 200 provided in the embodiment of the present application includes but is not limited to the above modules.

[0279] Fig.14 3 is a schematic diagram of the structure of the computing device 300 provided in the embodiment of the present application. Fig.14 As shown, the computing device 300 includes a processor 301, a memory 302, and a network interface 303. The computing device 300 may be Figure 1 Any computing device in .

[0280] The processor 301 includes one or more CPUs, which may be single-core CPUs or multi-core CPUs.

[0281] The memory 302 includes, but is not limited to, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, or optical storage.

[0282] In one implementation, the processor 301 implements the storage space management method provided in the embodiment of the present application by reading instructions stored in the memory 302, or the processor 301 implements the storage space management method provided in the embodiment of the present application by internally stored instructions. In the case where the processor 301 implements the method in the above embodiment by reading instructions stored in the memory 302, the memory 302 stores instructions for implementing the storage space management method provided in the embodiment of the present application.

[0283] The network interface 303 is a device including a transmitter and a receiver, and is used to communicate with other devices or communication networks. It can be a wired interface (port), such as a fiber distributed data interface (FDDI) or a gigabit Ethernet interface (GE). Alternatively, the network interface 303 is a wireless interface. It should be understood that the network interface 303 includes multiple physical ports, and the network interface 303 is used for communication, etc.

[0284] In one implementation, the computing device further includes a bus 304 , and the processor 301 , the memory 302 , and the network interface 303 are generally interconnected via the bus 304 , or are interconnected in other ways.

[0285] In actual implementation, the receiving unit 201, the processing unit 202 and the sending unit 203 can be implemented by the processor calling the computer program code in the memory. The specific execution process can be referred to the description of the above method part, which will not be repeated here.

[0286] Another embodiment of the present application further provides a computing device, including a memory and a processor. The memory and the processor are coupled; the memory is used to store computer program code, and the computer program code includes computer instructions. When the processor executes the computer instructions, the computing device executes each step of the storage space management method shown in the above method embodiment.

[0287] Another embodiment of the present application further provides a computer-readable storage medium, which stores computer instructions. When the computer instructions are executed on a computing device, the computing device executes each step executed by the computing device in the storage space management method process shown in the above method embodiment.

[0288] Another embodiment of the present application also provides a chip system, which is applied to a computing device. The chip system includes one or more interface circuits and one or more processors. The interface circuit and the processor are interconnected by a line. The interface circuit is used to receive a signal from the memory of the computing device and send a signal to the processor, the signal including a computer instruction stored in the memory. When the computing device processor executes the computer instruction, the computing device executes each step performed by the computing device in the storage space management method process shown in the above method embodiment.

[0289] In another embodiment of the present application, a computer program product is also provided. The computer program product includes computer instructions. When the computer instructions are executed on a computing device, the computing device executes each step executed by the computing device in the storage space management method process shown in the above method embodiment.

[0290] The above embodiments may be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using a software program, the above embodiments may 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 execution instructions are loaded and executed on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, a server or other programmable device. The computer instructions may 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 may be transmitted from a website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access or may include one or more servers, data centers and other data storage devices that can be integrated with the medium. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a DVD), or a semiconductor medium (eg, a solid state disk (SSD)).

[0291] The above is only a specific implementation of the present application. Those skilled in the art may conceive of changes or substitutions based on the specific implementation provided by the present application, which should all be included in the protection scope of the present application.

Claims

1. A storage space management method, characterized in that: Applied to a computing device, the method comprises: Receiving a first request sent by a target application in the computing device; the first request is used to request allocation of a storage space of a first storage capacity for the target application; Determine a first storage segment that satisfies the first storage capacity from a first storage space; the first storage space is a storage space allocated to the computing device by a CXL storage device, the first storage space includes one or more logical units, the first storage segment is a storage segment with available storage capacity among a plurality of storage segments into which the computing device divides the logical unit, and the available storage capacity of the first storage segment is greater than or equal to the first storage capacity; A first response is sent to the target application; the first response is used to indicate allocation of the first storage segment for the target application, and the first response includes an address of the first storage segment.

2. The method according to claim 1, characterized in that The storage capacity of each storage segment in the multiple storage segments is the same, or the storage capacity of at least some of the storage segments in the multiple storage segments is different.

3. The method according to claim 2, characterized in that The storage capacities of any two storage segments in the storage segments having at least partial different storage capacities satisfy an integer multiple relationship.

4. The method according to any one of claims 1 to 3, characterized in that The determining, from the first storage space, a first storage segment that satisfies the first storage capacity includes: Determine at least one candidate storage segment from the first storage space; the storage capacity of each storage segment in the at least one candidate storage segment is greater than or equal to the first storage capacity; The first storage segment is determined from the at least one candidate storage segment; the storage capacity of the first storage segment is smaller than the storage capacity of other storage segments in the at least one candidate storage segment.

5. The method according to claim 4, characterized in that Determining the first storage segment from the at least one candidate storage segment includes: Splitting a second storage segment in the at least one candidate storage segment into a plurality of sub-storage segments; at least one sub-storage segment in the plurality of sub-storage segments has a storage capacity greater than or equal to the first storage capacity; and the storage capacity of the second storage segment is less than the storage capacity of other storage segments in the at least one candidate storage segment; A sub-storage segment among the plurality of sub-storage segments whose storage capacity is greater than or equal to the first storage capacity is determined as the first storage segment.

6. The method according to any one of claims 2 to 5, characterized in that The method further comprises: When the number of available storage segments with the same storage capacity and continuous addresses among the multiple storage segments is greater than a preset threshold, the available storage segments with the same storage capacity and continuous addresses are merged in pairs.

7. The method according to any one of claims 1 to 6, characterized in that: The computing device is in communication with a management unit, the management unit is used to manage a second storage space of the CXL storage device, the second storage space includes a plurality of logical units, the first storage space is allocated to the computing device by the management unit, the second storage space includes the first storage space, and the method further includes: Sending a second request to the management unit; the second request is used to request allocation of storage space of a second storage capacity for the computing device; A second response is received from the management unit; the second response is used to indicate a third storage space allocated to the computing device, the third storage space includes one or more logical units, the second response includes an identifier of the one or more logical units and a storage capacity of the one or more logical units, and the sum of the storage capacities of the one or more logical units is greater than or equal to the second storage capacity; the first storage space includes the storage space previously allocated to the computing device and the third storage space.

8. The method according to any one of claims 1 to 7, characterized in that: After receiving the first request sent by the target application in the computing device and before sending the first response to the target application, the method further includes: When there is no available storage space with a storage capacity greater than or equal to the first storage capacity in the first storage space, sending a third request to the management unit; wherein the third request is used to request to apply for a storage space of the first storage capacity for the computing device; receiving a third response from the management unit; the third response is used to indicate a fourth storage space allocated for the computing device, the fourth storage space includes a first logical unit, the third response includes an identifier of the first logical unit, and the storage capacity of the first logical unit is greater than or equal to the first storage capacity; The sending a first response to the target application comprises: A first response is sent to the target application, where the first response is used to indicate allocation of the first storage segment for the target application, the first storage segment including at least a portion of storage space of the first logical unit, and the first response including an address of the first storage segment.

9. The method according to any one of claims 1 to 8, characterized in that: The method further comprises: receiving a return request sent by the target application, wherein the return request is used to return a storage segment with a first identifier, where the first identifier is an identifier of the first storage segment; In response to the return request, the first storage segment is reclaimed.

10. A computing device, characterized in that It comprises a memory and a processor; the memory and the processor are coupled; the memory is used to store computer program code, and the computer program code includes computer instructions; wherein, when the processor executes the computer instructions, the computing device executes the method as claimed in any one of claims 1 to 9.