Storage space management method and computing device
By introducing storage space management methods in the data center, computing devices can effectively manage the storage space of CXL storage devices, solving the problems of low memory resource utilization and limited capacity expansion, and achieving more efficient storage space use.
Patent Information
- Application Number
- CN202311075053.5
- 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
In the prior art, data centers have problems such as slow increase in single-core memory bandwidth, low memory utilization rate of computing devices, and unlimited memory expansion in memory resources, especially in multi-core processor environments.
A storage space management method is proposed to manage the storage space of the CXL storage device through communication connection between the computing device and the CXL storage device and the management unit. The specific steps include obtaining the usage of each logic unit, determining the free logic unit, and sending a return request to the management unit to free the logic unit that has not been used for a long time.
This method can improve the utilization rate of storage space, and solve the problems of low memory utilization and limited capacity by timely returning logical units that have not been used for a long time, making them available for other computing devices.
Smart Images

Figure CN119512974A_ABST
Abstract
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, data centers have an increasing demand for processor computing power and an increasing number of processor cores, which in turn leads to an increase in demand for memory resources. Currently, data centers have some problems with memory resource usage, such as slow improvement in single-core memory bandwidth, low memory utilization of computing devices (such as servers), and the inability to expand computing device memory indefinitely.
[0003] To solve the above problems, related technologies have proposed some solutions for shared storage space. For example, a compute express link (CXL) storage device is proposed as a shared storage space, which can solve the above problems such as slow improvement of single-core memory bandwidth, low memory utilization of computing devices, and inability to expand the memory of computing devices infinitely. However, there is no method for managing storage space. Therefore, it is urgent to propose a storage space management method so that CXL storage devices can be widely used. Summary of the invention
[0004] The present application provides 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, this application adopts the following technical solutions:
[0006] In a first aspect, an embodiment of the present application provides a storage space management method, which is applied to a computing device, wherein the computing device and the CXL storage device are both communicatively connected to a management unit, the management unit is used to manage a first storage space of the CXL storage device, the first storage space includes multiple logical units, and the computing device is used to manage a second storage space allocated to the computing device by the above-mentioned management unit, the second storage space includes at least one of the multiple logical units, and the method includes: the computing device obtains the usage status of each logical unit in the second storage space; when the computing device determines that there are idle logical units in the second storage space according to the usage status of each logical unit, the computing device sends a return request to the management unit; wherein the return request is used to request the return of the idle logical unit, and the idle logical unit is a logical unit that has not been used within a preset time period.
[0007] It can be understood that the method proposes a feasible implementation scheme for managing CXL storage space, which can solve the problem that there is no specific management method for the storage space of CXL storage devices in the related art. The method can timely return the long-unused logical units (i.e., idle logical units) so that these logical units can continue to be allocated to other computing devices, thereby improving the utilization rate of storage space.
[0008] In a possible implementation method, the usage includes the usage time of the logical unit, and the idle logical unit is determined according to the usage of each logical unit, including: the computing device determines the unused logical unit based on the usage time of each logical unit; when the unused logical unit has not been used for a time period greater than or equal to a preset time period, the computing device determines the unused logical unit as an idle logical unit.
[0009] It can be understood that the above method of determining a logic unit that has not been used for more than a preset time period as an idle logic unit is simple to operate, has high feasibility, and can quickly determine the idle logic unit.
[0010] In another possible implementation method, a metadata table is stored in the computing device, and the metadata table includes the status of each logical unit in the second storage space. Before sending a return request to the management unit, the method also includes: the computing device marks the status of the idle logical unit as a releasing state.
[0011] It is understandable that marking the logical unit as being released will prevent the storage space in the marked logical unit from being allocated to the application when an application subsequently requests for storage space, thereby avoiding application failure.
[0012] In another possible implementation method, after the computing device receives a return success message sent by the management unit, the method further includes: the computing device deletes the metadata corresponding to the idle logical unit in the metadata table.
[0013] It can be understood that deleting the data in the idle logical unit can ensure that the data of the last computing device that uses the logical unit will not be acquired by the next computing device that uses the logical unit, thereby ensuring data security.
[0014] In another possible implementation method, the method also includes: the computing device sends a first request to the management unit; the first request is used to request that a storage space with a first storage capacity be allocated to the computing device; the computing device receives a first response from the management unit; the first 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 first response includes an identifier and 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 first storage capacity, and the second storage space includes the storage space previously allocated to the computing device and the third storage space.
[0015] It is understandable that the computing device applies for CXL storage space in advance. When an application needs to use the storage space, the required storage space can be directly allocated to the application from the pre-applied logical unit, without the need to apply for storage space across nodes, which reduces waiting time and improves the efficiency of allocating storage space to the application.
[0016] In another possible implementation method, the computing device includes a processor, and the processor is used to run the management process execution method, where the management process is a user mode process in the computing device for managing the CXL storage space of the computing device.
[0017] It is understandable that the traditional storage space management method is executed by the kernel. When the application in the user state needs to apply for or return the storage space, the operating system needs to switch between the user state and the kernel state. When switching from the user state to the kernel state, the process that needs to be experienced includes: setting the processor to the kernel state, saving the current register, pointing the stack pointer to the kernel stack address, etc. When switching from the kernel state back to the user state, it is necessary to go through the above-mentioned similar process again. It can be seen that there is a certain overhead when the operating system switches between the user state and the kernel state. If switching frequently, it will accumulate huge overhead. However, the method of the embodiment of the present application is executed by the management process running in the user state, and all processes are performed in the user state. Therefore, the method proposed in the present application does not need to switch between the user state and the kernel state, which can save overhead, save computing resources, and improve management efficiency.
[0018] In another possible implementation method, the method also includes: the management process receives a second request sent by a target application in the computing device; the second request is used to request allocation of storage space of a second storage capacity for the target application; the management process sends a second response to the target application; the second response is used to indicate a fourth storage space allocated for the target application, the fourth storage space including at least part of the storage space of the target logical unit, the second response including an identifier of the target logical unit, a starting address and a storage capacity of at least part of the storage space, the target logical unit being a logical unit in the second storage space having available storage space greater than or equal to the second storage capacity.
[0019] It can be understood that the above method is a process in which the management process allocates CXL storage space to the target application based on the target application's demand for storage space. After the target application receives the CXL storage space allocated by the management process, it can perform normal read and write operations. The whole process runs in user mode, which improves the management efficiency of CXL storage space.
[0020] In another possible implementation method, after the management process receives the second request sent by the target application in the computing device and before the management process sends the second response to the target application, the method also includes: when there is no storage space that meets the preset conditions in the second storage space, the management process sends a third request to the management unit; the third request is used to request to apply for a storage space with a second storage capacity for the computing device, wherein the storage space that meets the preset conditions is an available storage space with a storage capacity greater than or equal to the second storage capacity; the management process receives a third response from the management unit; the third response is used to indicate a fifth storage space allocated to the computing device, the fifth 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, and the storage capacity of the first logical unit is greater than or equal to the second storage capacity; the management process sends the second response to the target application, including: the management process sends the second response to the target application, the second response is used to indicate a fourth storage space allocated to the target application, the fourth storage space includes at least part of the storage space of the target logical unit, the second response includes the identifier of the target logical unit, the starting address and storage capacity of at least part of the storage space, wherein the target logical unit includes the first logical unit.
[0021] It is understandable that when the available storage space in the logical unit managed by the management process cannot meet the needs of the target application, a new logical unit can be applied to 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 method, the method further includes: when the computing device determines that the application stops running, the computing device reclaims the storage space of the application.
[0023] It is understandable that when an application stops running, the management process reclaims the storage space allocated to the application in a timely manner, which can avoid the stopped application occupying the storage space, resulting in insufficient storage space capacity in the second storage space, and the need to apply for storage space from the management unit again. Therefore, timely recovery of 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 second storage space is insufficient, thereby improving storage space utilization and allocation efficiency and reducing allocation delays.
[0024] In another possible implementation, the CXL storage device includes a DIMM and / or an SSD.
[0025] In another possible implementation method, the target application communicates with the management process through an interface provided by a software development kit SDK; the interface provided by the SDK includes any of the following: CXL_malloc interface, CXL_free interface, CXL_dd interface, CXL_open interface, CXL_read interface, CXL_write interface or CXL_close interface.
[0026] It is understandable that based on the above customized interface, communication interaction between the management process and the target application can be realized to enable the management process to manage the CXL storage space.
[0027] In another possible implementation, obtaining the usage of each logical unit in the second storage space includes: periodically obtaining the usage of each logical unit in the second storage space; or, when reclaiming the storage space allocated to the application, obtaining the usage of each logical unit in the second storage space.
[0028] It is understandable that a trigger condition is set in the computing device to trigger the computing device to inspect the usage of each logical unit, find idle logical units in time, and improve the utilization rate of the logical units.
[0029] 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.
[0030] 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.
[0031] In a fourth aspect, 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.
[0032] In a fifth aspect, 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 is caused to execute the storage space management method of the first aspect and any possible implementation thereof.
[0033] For the specific description of the second to fifth aspects and their various implementations in the present application, reference may 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 may be made to the analysis of the beneficial effects in the first aspect and its various implementations, which will not be repeated here.
[0034] These and other aspects of the present application will become more apparent from the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 A schematic diagram of a system architecture proposed in an embodiment of the present application;
[0036] Figure 2 A flowchart of a storage space management method provided in an embodiment of the present application;
[0037] Figure 3 A flowchart of another storage space management method provided in an embodiment of the present application;
[0038] Figure 4 A flowchart of another storage space management method provided in an embodiment of the present application;
[0039] Figure 5 A flowchart of another storage space management method provided in an embodiment of the present application;
[0040] Figure 6 A schematic diagram of a logical unit storage space provided in an embodiment of the present application;
[0041] Figure 7 A schematic diagram of another logic unit storage space provided in an embodiment of the present application;
[0042] Figure 8 A schematic diagram of another logic unit storage space provided in an embodiment of the present application;
[0043] Fig. 9 A schematic diagram of another logic unit storage space provided in an embodiment of the present application;
[0044] Fig.10 A schematic diagram of the structure of a computing device provided in an embodiment of the present application;
[0045] Fig.11 A schematic diagram of the structure of another computing device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0046] For ease of understanding, the following briefly introduces the relevant terms involved in the embodiments of the present application:
[0047] (1) Operating system kernel: A software program running on computer hardware. It is the core of the operating system and is responsible for managing computer resources, performing task scheduling, and providing various services. When an application needs to access services provided by the kernel, it must switch from the current user state to the kernel state through a system call.
[0048] (3) Kernel state: When a process runs in kernel space, it is in kernel state. Kernel space is where kernel code runs.
[0049] (4) User state: When a process runs in user space, it is in user state. User space is where user program code runs.
[0050] (5) CXL storage devices: Storage devices built on CXL technology have the characteristics of wireless expansion and can meet the needs of data center resource sharing, memory pooling, and efficient computing scheduling. The storage space provided by CXL storage devices is called CXL storage space, also known as the first storage space.
[0051] 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.
[0052] 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.
[0053] Based on some problems in memory resource usage described in the background technology, the related technology proposes a solution of shared storage space. For example, a CXL storage device is used as a shared storage space. The CXL storage device has the feature of unlimited expansion. The CXL storage device is connected to multiple computing devices, so that the computing devices can use the storage space of the CXL storage device additionally, thereby improving the single-core memory bandwidth.
[0054] At present, in the conventional technology, the local storage space of the computing device, such as the memory, is managed by the operating system kernel of the computing device, but no specific method for managing the storage space of the external CXL storage device is proposed.
[0055] 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 determines whether there is an idle logical unit based on the usage of each logical unit in the CXL storage space (e.g., the second storage space) of the computing device. If there is, the space logical unit is returned to the management unit that manages all storage spaces of the CXL storage device. It can be understood that the method proposes a feasible implementation plan for managing CXL storage space, which can solve the problem that there is no specific management method for the storage space of CXL storage devices in the related art. The method can promptly return the logical units that have not been used for a long time (i.e., idle logical units), so that these logical units can continue to be allocated to other computing devices, thereby improving the utilization rate of the storage space.
[0056] The implementation of the embodiments of the present application will be described in detail below with reference to the accompanying drawings.
[0057] 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 1 As shown, the system architecture may include a computing device 110 , a CXL storage device 120 , and a CXL connection device 130 .
[0058] The computing device 110 and the CXL storage device 120 are communicatively connected via a CXL connection device 130 .
[0059] 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.
[0060] 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 .
[0061] 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 a first storage space. When there are multiple CXL storage devices 120, the storage spaces of the multiple CXL storage devices 120 together constitute the first storage space, and the following description assumes that the number of CXL storage devices 120 is one.
[0062] 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.
[0063] 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.
[0064] 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.
[0065] 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.
[0066] Exemplarily, when the CXL connection device 130 is independently provided, the CXL connection device 130 may be a CXL switch (Switch), and the CXL switch includes a CXL switch chip; or the CXL connection device 130 may be a multi-head CXL memory expansion card. In the case where 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, and the multi-head CXL memory expansion card 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 (Switch), a CXL switch (Switch) chip, or a multi-head CXL memory expansion card. In addition to the expansion function, the CXLSwitch also has a processor and a processing function, such as being able to run FM.
[0067] 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 second 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 first storage space) in the CXL storage device 120 .
[0068] The CXL storage space on the computing device 110 is the storage space allocated to the computing device 110 by the CXL storage device 120 .
[0069] In the embodiment of the present application, the LMD is a user-mode process running in the operating system of the computing device 110, and can interact with the FM, and can also interact with the application running in the operating system of the computing device 110 through a software development kit (SDK) interface. Optionally, the LMD can directly interact with the CXL storage device 120 or the connection device 130 to query the health status, alarm information, or log information of the CXL storage device 120.
[0070] 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.
[0071] 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.
[0072] 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.
[0073] In some embodiments, FM can also be used to abstract the storage space (first 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 (first storage space) of one CXL storage device 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 (first 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 first storage space into multiple logical units of the same capacity. The storage capacity of the logical unit can be flexibly set based on demand.
[0074] 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.
[0075] For example, assuming that the storage space (first storage space) of the CXL storage device is 128G, and the capacity of each logical unit is set to 16G, FM divides the first 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.
[0076] 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)).
[0077] In another possible implementation, the FM may run in the CXL connection device 130 , and the CXL connection device 130 is respectively connected to the plurality of computing devices 110 and the CXL storage device 120 via a bus (eg, a UART, an IIC, or an SMBUS bus).
[0078] For example, in the embodiment of the present application, the CXL connection device 130 may abstract the first 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 first storage space into multiple logical units of the same capacity.
[0079] The following is an explanation of the storage space management method provided by the embodiment of the present application:
[0080] 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, and both the computing device and the CXL storage device are connected to a management unit for communication.
[0081] The management unit is used to manage the first storage space of the CXL storage device, which is the entire storage space of the CXL storage device. The management unit can divide the first storage space into multiple logical units, that is, the first storage space includes multiple logical units, and the management unit manages the first storage space according to the logical unit as the minimum management granularity.
[0082] The computing device is used to manage the second storage space allocated to the computing device by the management unit, and the second storage space includes at least one of the multiple logical units.
[0083] It can be understood that the storage space management method provided in the embodiment of the present application mainly includes three aspects:
[0084] In the first aspect, the computing device interacts with the management unit to allocate storage space in the CXL storage device to the computing device.
[0085] The second aspect: the computing device interacts with the management unit to return the idle logical units in the computing device.
[0086] A third aspect: the management process of the computing device interacts with the target application in the computing device and allocates the CXL storage space of the computing device to the target application.
[0087] First, the storage space management method provided by the embodiment of the present application is described from the perspective of the first aspect. Figure 2As shown, the method may include S101-S103.
[0088] S101: A computing device sends a first request to a management unit.
[0089] The management unit is used to manage a plurality of logical units in a first storage space of the CXL storage device, and the first request is used to request allocation of a storage space of a first storage capacity for the computing device.
[0090] Exemplarily, the first request carries first storage capacity information.
[0091] Exemplarily, 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 first request to the management unit based on a configuration file.
[0092] Configuration file: is a computer file that can configure parameters and initial settings for some computer programs. For example, the configuration file is pre-configured to obtain a storage space of a first storage capacity.
[0093] In some implementations, technicians can modify the first storage capacity configured in the configuration file as required. Generally, the configured first storage capacity is an integer multiple of the capacity of a logical unit.
[0094] For example, in another case, when an application in the computing device applies for 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 first request to the management unit.
[0095] S102: The management unit allocates a third storage space to the computing device from available logical units in the CXL storage device.
[0096] The third storage space includes one or more logical units, and the sum of the storage capacity of the one or more logical units is greater than or equal to the first storage capacity.
[0097] The available logical unit is a logical unit that is not allocated to any computing device among the multiple logical units of the CXL storage device.
[0098] In a possible implementation method, as shown in Table 1, the management unit records metadata of multiple logical units in the first storage space of the managed CXL storage device, including but not limited to: identification of the logical unit, storage capacity of the logical unit and allocation of the logical unit.
[0099] Table 1
[0100] Logical unit identification Storage capacity of logical unit Allocation of logical units LD-1 16G Assigned to device 1 LD-2 16G Assigned to device 2 LD-3 16G Unassigned LD-4 16G Unassigned LD-5 16G Unassigned
[0101] In some embodiments, after receiving the first 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 first 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.
[0102] 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.
[0103] The method for a management unit to allocate logical units to a computing device includes: when a first storage capacity is an integer multiple of the 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 first storage capacity is not an integer multiple of the capacity of a logical unit, the management unit rounds up the value of the first 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.
[0104] Exemplarily, if the capacity of each logical unit is 16G, the first storage capacity is 30G, and 30G divided by 16G is equal to 1.875, then the management unit rounds 1.875 to get 2. The management unit allocates two unallocated logical units, i.e., 32G 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 and LD-4 in Table 1 to computing device 1, and the management unit modifies the allocation of the logical units LD-3 and LD-4 in Table 1 from "unassigned" to "allocated to computing device 1".
[0105] 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 the storage capacity of a logical unit, the management unit allocates it according to one logical unit.
[0106] S103: The management unit sends a first response to the computing device. Correspondingly, the computing device receives the first response from the management unit.
[0107] The first response is used to indicate a third storage space allocated to the computing device, and the first response includes identifiers and storage capacities of one or more logical units corresponding to the third storage space.
[0108] Exemplarily, as shown in Table 1, the management unit allocates LD-3, LD-4 and 32G in Table 1 to the computing device. At this time, the first response includes: LD-3, LD-4 and 32G.
[0109] In some embodiments, after receiving the first response, the computing device maps the logical unit allocated by the management unit to the device file, and stores the device file name, the identification of the logical unit, the storage capacity and other information in the computing device according to the corresponding relationship. It can be understood that the device file name and the identification, storage capacity and other information of the logical unit can be called metadata of the logical unit. At this time, the second storage space includes the storage space previously allocated to the computing device and the third storage space. The second 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.
[0110] 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.
[0111] Exemplarily, as shown in Table 2, Table 2 is the metadata of the logical unit recorded by the computing device. Table 2 includes: "logic unit identification", "logical unit storage capacity" and "device file name".
[0112] Table 2
[0113] Logical unit identification Storage capacity of logical unit Device file name LD-3 16G / dev / dax.1 LD-4 16G / dev / dax.2
[0114] After the computing device mounts the device file of the logical unit in the above example to the specified directory, it can provide storage services for the applications in the computing device, such as allocating storage space in the mounted logical unit to the application, or reclaiming the storage space allocated to the application.
[0115] In the above S101-S103, the computing device pre-applies for CXL storage space. When the application needs to use the storage space, the required storage space can be directly allocated to the application from the pre-applied logical unit, without the need to apply for storage space across nodes, thereby reducing waiting time and improving the efficiency of allocating storage space to the application.
[0116] After S103, the computing device may divide one or more logical units in the second storage space into finer-grained storage spaces, so that when subsequent applications apply for storage space, the finer-grained storage space can be allocated to the applications, thereby further improving the efficiency of allocating storage space to the applications.
[0117] After the computing device applies for the CXL storage space, the computing device may subsequently manage the logical units in the second storage space, for example, allocate storage space in the logical units to application programs, or return the logical units when not in use.
[0118] The following describes the storage space management method provided by the embodiment of the present application from the perspective of returning the idle logical unit in the second aspect. Figure 3 As shown, the method may include S201-S207.
[0119] S201: The computing device obtains usage status of each logical unit in the second storage space.
[0120] 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.
[0121] In some implementations, a trigger condition is set in the computing device to trigger the computing device to perform an inspection on the usage of each logical unit.
[0122] The triggering condition for the computing device to obtain the usage of each logical unit in the second storage space may include: a periodic inspection function is set in the process of the computing device (such as a management process), and the periodic inspection function can periodically trigger the detection of the usage of the second storage space. Alternatively, when the process of the computing device reclaims the storage space of a certain application, it triggers the computing device to detect the usage of the second storage space.
[0123] It is understandable that setting a trigger condition in the computing device can trigger the computing device to inspect each logical unit, so as to find idle logical units in time.
[0124] Exemplarily, as shown in Table 3, Table 3 is the usage of each logical unit in the second storage space obtained by the computing device under the trigger condition. Table 3 includes "identification of the logical unit" and "usage time of the logical unit". Optionally, Table 3 also includes the state of each logical unit, and the state includes: being used, not being used, or being released.
[0125] Table 3
[0126] 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
[0127] It can be seen from Table 3 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.
[0128] S202: The computing device determines whether there is an idle logical unit in the second storage space according to the usage of each logical unit.
[0129] If there is an idle logical unit, execute S203;
[0130] If there is no idle logical unit, the process ends.
[0131] In some implementations, a specific implementation may be proposed for S202, including: S202a-S202b.
[0132] S202a: The computing device determines an unused logical unit based on the usage time of each logical unit.
[0133] Exemplarily, based on the usage of each logical unit in the second storage space shown in Table 3, it is determined that the unused logical units are LD-3 and LD-4.
[0134] S202b: When the unused logical unit has not been used for a period of time greater than or equal to a preset time period, the computing device determines the unused logical unit as an idle logical unit.
[0135] The idle logical unit is a logical unit that has not been used within a preset time period.
[0136] 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.
[0137] Exemplarily, based on the usage of each logical unit in the second storage space shown in Table 3, if the time when the computing device triggers the acquisition of the usage of each logical unit in the second storage space is 12:00, it can be seen from Table 3 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.
[0138] S203: The computing device marks the state of the idle logical unit as being released.
[0139] A metadata table is stored in the computing device, and the metadata table includes the state of each logical unit in the second storage space, such as the state of the logical unit recorded in Table 3.
[0140] Exemplarily, as shown in Table 4, the computing device records the state of the logic unit LD-3 in Table 3 as "releasing state".
[0141] Table 4
[0142] 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
[0143] 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 S203, that is, after S202, S204 is executed.
[0144] S204: The computing device sends a return request to the management unit.
[0145] 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.
[0146] S205: After receiving the return request, the management unit reclaims the idle logical unit requested to be returned by the computing device.
[0147] 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.
[0148] 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.
[0149] S206: The management unit sends a message indicating successful return to the computing device.
[0150] S207: After receiving the return success message sent by the management unit, the computing device deletes the metadata corresponding to the idle logical unit in the metadata table.
[0151] Exemplarily, the computing device deletes metadata corresponding to LD-3 in Table 4.
[0152] In the method, the computing device can periodically inspect each logical unit in the second 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.
[0153] In the above S101-S103 and S201-S207, 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.
[0154] In some embodiments, Figure 4 As shown, the above-mentioned computing device returning the idle logical unit generally includes two steps. The first step: the computing device obtains the usage status of each logical unit in the second storage space; the second step: when the computing device determines that there are idle logical units in the second storage space according to the usage status of each logical unit, the computing device sends a return request to the management unit.
[0155] After the computing device applies for CXL storage space in the first aspect, the management process running in the CPU of the computing device 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. The following describes another storage space management method provided by the embodiment of the present application from the perspective of the interaction between the management process of the computing device and the target application in the computing device in the third aspect, such as Figure 5 As shown, the method may include S301-S308.
[0156] S301: The target application sends a second request to the management process, and correspondingly, the management process receives the second request sent by the target application program in the computing device.
[0157] The second request is used to request allocation of storage space of a second storage capacity for the target application.
[0158] An application is a software program running in an operating system of a computing device, and a target application is any one of a plurality of applications. Generally, it is understood that the capacity of the CXL storage space allocated to the computing device is large, so the computing device can support applications with large storage space capacity requirements, such as cloud computing, artificial intelligence, big data or high-performance computing applications.
[0159] Exemplarily, the target application sends the second request to the management process through the CXL_malloc interface in the interface provided by the SDK.
[0160] S302: The management process determines whether the storage capacity of the available storage space in the second storage space is greater than or equal to the second storage capacity.
[0161] In one case, if the storage capacity of the available storage space in the second storage space is greater than or equal to the second storage capacity, the management process allocates storage space to the target application from the second storage space, and then executes the following S307 to send a second response to the target application, thereby completing the process of allocating CXL storage space to the target application.
[0162] In another case, if the storage capacity of the available storage space in the second storage space is less than the second storage capacity, the following S303-S304-S305 or S303-S304-S306 is executed to re-apply for the logical unit of the computing device. In the case that the management unit successfully applies for a new logical unit for the computing device, the management process allocates storage space for the target application from the new logical unit, or allocates storage space for the target application from the previously available storage space in the second storage space and the storage space of the new logical unit, and then executes the following S307 to send a second response to the target application, thereby completing the process of allocating CXL storage space for the target application.
[0163] The available storage space refers to the storage space in the second storage space that is not allocated to the application program.
[0164] In some embodiments, the management process records the allocation status of the storage space of all logical units in the second storage space. The storage space allocated to the application is marked as "allocated", indicating that this part of the storage space is unavailable storage space, and the unallocated storage space is marked as "unallocated", indicating that this part of the storage space is available storage space.
[0165] For example, Figure 6 As shown, Figure 6 A schematic diagram of the storage space allocation of a logical unit in the second storage space is shown, wherein the storage space 1 and storage space 2 of the logical unit are marked as "allocated", which are unavailable storage spaces, and the capacities of the remaining "unallocated" storage spaces are 128MB, 256MB, and 512MB, respectively, indicating that the total storage capacity of the available storage space in the logical unit is 896MB.
[0166] S303: The management process sends a third request to the management unit.
[0167] The third request is used to request to apply for storage space of a second storage capacity for the computing device.
[0168] S304: After receiving the third request, the management unit determines whether the sum of the storage capacities of the unallocated logical units in the first storage space is greater than or equal to the second storage capacity.
[0169] In one case, when the sum of the storage capacities of the unallocated logical units in the first storage space is greater than or equal to the second storage capacity, the management unit allocates one or more logical units satisfying the second storage capacity to the computing device, and executes the following S305.
[0170] In another case, when the sum of the storage capacities of the unallocated logical units in the first storage space is less than the second storage capacity, the management unit may execute the following S306.
[0171] Exemplarily, if the second storage capacity is 200MB and the capacity of a logical unit is 16G, the management unit checks the metadata in Table 1, for example. If there is an unallocated logical unit, for example LD-5, the management unit allocates the logical unit LD-5 to the computing device.
[0172] S305: The management unit sends a third response to the management process. Correspondingly, the management process receives the third response from the management unit.
[0173] The third response is used to indicate a fifth storage space allocated to the computing device, the fifth storage space includes a 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 second storage capacity.
[0174] Exemplarily, the management process maps the first logical unit LD-5 allocated by the management unit into a device file, such as / dev / dax.3, and records it in the metadata shown in Table 2, so as to facilitate the subsequent management of the logical unit. In addition, after the management process mounts the device file / dev / dax.3 of the first logical unit to the specified directory, it can provide storage services for the target application.
[0175] S306: The management unit sends a failure response message to the management process. Correspondingly, the management process receives the failure response message sent by the management unit, and the failure response message is used to indicate that the logical unit for allocating the second storage capacity to the computing device has failed.
[0176] After receiving the failure response message sent by the management unit, the management process sends a failure response message to the target application.
[0177] After S306, execute S308.
[0178] S307: The management process sends a second response to the target application.
[0179] The second response is used to indicate a fourth storage space allocated for the target application, the fourth storage space includes at least part of the storage space of the target logical unit, and the second response includes an identifier of the target logical unit, a starting address and a storage capacity of at least part of the storage space.
[0180] The target logical unit is a logical unit in the second storage space having an available storage space greater than or equal to the second storage capacity.
[0181] If the target logical unit includes the first logical unit, if the target logical unit is a logical unit, the first logical unit is the target logical unit, and if the target logical unit includes multiple logical units, the first logical unit is one or more of the target logical units.
[0182] In some embodiments, the starting address of the fourth storage space allocated for the target application can be represented by an offset relative to the initial address of the target logical unit. For example, the initial address of the target logical unit is 0x0, and the starting address of the fourth storage space allocated for the target application is represented by an offset 0x10000000 relative to 0x0.
[0183] If the storage space in the target logical unit has not been allocated (eg, the first logical unit newly applied for in S305 ), at this time, the management process may allocate storage space for the target application starting from the initial address of the target logical unit.
[0184] For example, Figure 7 As shown, if the target logical unit includes one logical unit, the initial address of the target logical unit is 0x0, the identifier of the target logical unit is LD-3, and if the second storage capacity is 200MB, the management process can start from the initial address 0x0 of the target logical unit, and use the offset 0x0 as the starting address of the CXL storage space allocated by the target application to allocate a storage space with a capacity of 200MB to the target application. If cxl_id is used to represent the identifier of the target logical unit, offset is used to represent the offset, and length is used to represent the capacity of the storage space, then the second response includes: cxl_id = LD-3, offset = 0x0, length = 200MB.
[0185] If part of the storage space in the target logical unit has been allocated, and there are multiple storage spaces in the remaining available storage space whose storage capacity is greater than or equal to the second storage capacity, the management process selects the smallest storage space from multiple continuous available storage spaces whose storage capacity is greater than or equal to the second storage capacity and allocates it to the target application, or selects the smallest storage space from multiple available storage spaces whose storage capacity is greater than or equal to the second storage capacity, splits out the storage space of the second storage capacity and allocates it to the target application.
[0186] This optional allocation method can reduce the waste of storage space while satisfying the target application's demand for storage space capacity.
[0187] Exemplarily, the initial address of the target logical unit is 0x0, the identifier of the target logical unit is LD-3, and the capacities of the continuous available storage spaces are 128MB, 256MB, and 512MB, respectively. If the second storage capacity is 200MB, the management process can allocate 256MB of the storage space (assuming that the starting address of the 256MB storage space is offset=0x10000000) to the target application, such as Figure 8 As shown in FIG. 1 , if cxl_id is used to represent the identifier of the target logical unit, offset is used to represent the offset, and length is used to represent the capacity of the storage space, then the second response includes: cxl_id = LD-3, offset = 0x10000000, length = 256MB. Or, Fig. 9 As shown, the management process can split 200MB of storage space from the 256MB of storage space and allocate it to the target application. At this time, the second response includes: cxl_id=LD-3, offset=0x10000000, length=200MB.
[0188] In some implementations, after the management process allocates the storage space in the logical unit to the target application, it may change the state of the storage space from "unassigned" to "allocated".
[0189] After receiving the second response sent by the management process, the target application can use the storage space in the target logical unit allocated to it by the management process.
[0190] In some embodiments, the target application writes the running data into the CXL storage space corresponding to cxl_id=LD-3, offset=0x0, length=256MB allocated by the management process. At this time, the management process writes the running data of the target application into the logical unit LD-3 corresponding to the device file, the starting address is offset=0x0, and the capacity is length=256MB of the storage space. For example, the device file of LD-3 in Table 2 is / dev / dax.1, and the management process writes the running data of the target application into / dev / dax.1, the starting address is offset=0x0, and the capacity is length=256MB of the storage space.
[0191] After allocating storage space to the target application, the storage space management method provided in the embodiment of the present application may further include:
[0192] S308: When the management process determines that the application stops running, the management process reclaims the storage space of the application.
[0193] There are two situations in which the application stops running: normal stopping running or abnormal stopping running. The application is any application running in the operating system of the computing device.
[0194] The storage space of an application is all the storage space allocated to the application by the management process, which can be allocated once or in multiple times.
[0195] For example, in one case, when the application exits normally, the application sends a stop message to the management process, and the management process responds to the stop message and reclaims the storage space allocated to the application. When the application exits normally, the management process receives a message containing a unique ID representing the application, and the management process reclaims the storage space allocated to the application through the ID.
[0196] In another case, the underlying software of the computing device (such as a socket) detects that an application has an exception and stops running, and sends a message to the management process that the application has stopped running. The message contains the unique ID of the application. At this time, the management process reclaims the storage space allocated to the application based on the stop message.
[0197] Exemplarily, the specific process of the management process reclaiming the storage space allocated to the application may include: the management process changes the state of the storage space from "allocated" to "unallocated", and the management process deletes the data in the CXL storage device corresponding to the storage space.
[0198] It is understandable that when an application stops running, the management process reclaims the storage space allocated to the application in a timely manner, which can avoid the stopped application occupying the storage space, resulting in insufficient storage space capacity in the second storage space, and the need to apply for storage space from the management unit again. Therefore, timely recovery of 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 second storage space is insufficient, thereby improving storage space utilization and allocation efficiency and reducing allocation delays.
[0199] In some embodiments, the storage space management method provided in the embodiments of the present application may further include: when the storage capacity of the remaining available storage space in the second storage space is less than or equal to a certain threshold, triggering detection of the usage of the storage space allocated to the application; when an application applies for storage space, but the storage capacity of the remaining available storage space in the second storage space is less than the storage capacity applied for by the application that applies for storage space, triggering detection of the usage of the storage space allocated to the application; when the application's usage rate of the storage space is lower than the usage rate threshold, part of the storage space allocated to the application can be reclaimed.
[0200] In the above implementation, when the storage space utilization rate of the application is low, part of the storage space is reclaimed to avoid applying for storage space across nodes when the storage capacity of the second storage space is insufficient, thereby improving storage space utilization and allocation efficiency and reducing allocation delay.
[0201] In some implementations, the storage space management method provided in the embodiments of the present application may further include: the management process predicts the storage capacity demand of the application for the storage space using a machine learning algorithm based on the storage space usage of the application. Based on the storage capacity demand of the application for the storage space, apply to the management unit for storage space that meets the storage capacity demand of the application for the storage space.
[0202] In the above implementation, the usage of the storage space by the application includes but is not limited to: the time when the application applies for the storage space, the time when the application returns the storage space, and the capacity of the storage space applied for by the application.
[0203] Exemplarily, the usage of storage space includes: the target application applies for 16G storage space every two hours, or returns the 16G storage space after 10 minutes of use. The management process uses a machine learning algorithm to predict the usage of the storage space by the application, and sends a request for 16G storage space to the management unit in advance before the target application applies for storage space.
[0204] This method can prepare CXL storage space for applications in advance based on the application's demand for storage space, avoiding the subsequent cross-node storage space application, improving the efficiency of allocating storage space for applications, and reducing allocation delays. In addition, this method can meet business needs, improve business quality, and improve user experience for some user-oriented applications.
[0205] In the above embodiments, the second aspect can be executed after the first aspect. Of course, in some cases, the second aspect is also executed after the first aspect. There is no necessary connection between the execution order of the third aspect and the first aspect or the second aspect. This application does not limit the execution order between the third aspect and the first aspect or the second aspect.
[0206] The storage space management method proposed in the present application can be executed by a management process running in user state. When an application running in the operating system needs to apply for storage space or return storage space, an application or return request is sent to the management process. The traditional storage space management method is executed by the kernel. When an application in the user state needs to apply for or return storage space, the operating system needs to switch between the user state and the kernel state. When switching from the user state to the kernel state, the process to be experienced includes: setting the processor to the kernel state, saving the current register, pointing the stack pointer to the kernel stack address, etc. When switching from the kernel state back to the user state, it is necessary to go through the above-mentioned similar process again. It can be seen that there is a certain overhead when the operating system switches between the user state and the kernel state. If the switch is frequent, it will accumulate huge overhead. However, the method of the embodiment of the present application is executed by the management process, and all processes are carried out in the user state. There is no need to switch between the user state and the kernel state, which can save overhead, save computing resources, and improve management efficiency.
[0207] 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 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 be beyond the scope of this application.
[0208] The present application embodiment also provides a computing device 200. Fig.10 , which is a schematic diagram of the structure of a computing device 200 provided in an embodiment of the present application.
[0209] The computing device 200 includes: an acquisition unit 201, which is used to acquire the usage of each logical unit in the second storage space; a sending unit 202, which is used to send a return request to the management unit when it is determined that there is an idle logical unit in the second storage space according to the usage of each logical unit; wherein the return request is used to request the return of the idle logical unit, and the idle logical unit is a logical unit that has not been used within a preset time period. Figure 3 The acquiring unit 201 may be applied to S201 in the method embodiment, and the sending unit 202 may be applied to S204 in the method embodiment.
[0210] In one embodiment, the usage includes the usage time of the logical unit, and the computing device 200 further includes a processing unit 203, which is used to determine the unused logical unit based on the usage time of each logical unit; when the unused logical unit is unused for a time period greater than or equal to a preset time period, the computing device determines the unused logical unit as an idle logical unit. Figure 3 , the processing unit 203 can be applied to S202 in the method embodiment.
[0211] In one implementation, a metadata table is stored in the computing device, and the metadata table includes the status of each logical unit in the second storage space. The processing unit 203 is further configured to mark the status of the idle logical unit as being released before sending a return request to the management unit. Figure 3 , the processing unit 203 can be applied to S203 in the method embodiment.
[0212] In one implementation, the processing unit 203 is further configured to cause the computing device to delete metadata corresponding to the idle logical unit in the metadata table. Figure 3 , the processing unit 203 can be applied to S207 in the method embodiment.
[0213] In one embodiment, the sending unit 202 is further configured to send a first request to the management unit; the first request is configured to request allocation of a storage space of a first storage capacity for the computing device; the computing device 200 further comprises a receiving unit 204 configured to receive a first response from the management unit; the first response is configured to indicate a third storage space allocated for the computing device, the third storage space comprising one or more logical units, the first response comprising an identifier and a storage capacity of the one or more logical units, the sum of the storage capacities of the one or more logical units being greater than or equal to the first storage capacity, and the second storage space comprising the storage space previously allocated to the computing device and the third storage space. For example, in combination with Figure 2 The sending unit 202 can be applied to S101 in the method embodiment, and the receiving unit can be applied to S103 in the method embodiment.
[0214] In one implementation, a computing device includes a processor, the processor being used to execute a management process execution method, the management process being a user-mode process in the computing device for managing a CXL storage space of the computing device.
[0215] In one implementation, the receiving unit 204 is further configured to receive a second request sent by a target application in the computing device; the second request is used to request allocation of a storage space of a second storage capacity for the target application; the sending unit 202 is further configured to send a second response to the target application; the second response is used to indicate a fourth storage space allocated for the target application, the fourth storage space including at least part of the storage space of the target logical unit, the second response including an identifier of the target logical unit, a starting address of at least part of the storage space, and a storage capacity, the target logical unit being a logical unit in the second storage space having an available storage space greater than or equal to the second storage capacity. For example, in combination with Figure 5 The receiving unit 204 can be applied to S301 in the method embodiment, and the sending unit 202 can be applied to S307 in the method embodiment.
[0216] In one embodiment, the sending unit 202 is also used to, after the management process receives the second request sent by the target application in the computing device and before the management process sends the second response to the target application, if there is no storage space that meets the preset condition in the second storage space, 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 second storage capacity for the computing device, wherein the storage space that meets the preset condition is an available storage space whose storage capacity is greater than or equal to the second storage capacity; the receiving unit 204 is also used to receive a third response from the management unit; the third response is used to indicate a fifth storage space allocated for the computing device, the fifth 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, and the storage capacity of the first logical unit is greater than or equal to the second storage capacity; the sending unit 202 is specifically used to send a second response to the target application, the second response is used to indicate a fourth storage space allocated for the target application, the fourth storage space includes at least part of the storage space of the target logical unit, the second response includes an identifier of the target logical unit, a starting address of at least part of the storage space, and a storage capacity, wherein the target logical unit includes the first logical unit. For example, in combination Figure 5 The sending unit 202 can be applied to S303 and S307 in the method embodiment, and the receiving unit 204 can be applied to S305 in the method embodiment.
[0217] Of course, the computing device 200 provided in the embodiment of the present application includes but is not limited to the above modules.
[0218] Fig.113 is a schematic diagram of the structure of the computing device 300 provided in the embodiment of the present application. Fig.11 As shown, the computing device 300 includes a processor 301 , a memory 302 , and a network interface 303 .
[0219] The processor 301 includes one or more CPUs, which may be single-core CPUs or multi-core CPUs.
[0220] 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.
[0221] 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.
[0222] 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.
[0223] 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.
[0224] In actual implementation, the acquisition unit 201, the sending unit 202, the processing unit 203 and the receiving unit 204 can be implemented by the processor calling the computer program code in the memory. The specific execution process can refer to the description of the above method part, which will not be repeated here.
[0225] 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.
[0226] 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.
[0227] 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.
[0228] 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.
[0229] 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 one website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more servers that can be integrated with the medium. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., an SSD), etc.
[0230] 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 computing device and the CXL storage device are both in communication connection with a management unit, the management unit is used to manage multiple logical units of the CXL storage device, the computing device is used to manage a second storage space allocated to the computing device by the management unit, the second storage space includes at least one of the multiple logical units, the method includes: The computing device obtains usage of each logical unit in the second storage space; When the computing device determines that there is an idle logical unit in the second storage space according to the usage of each logical unit, the computing device sends a return request to the management unit; wherein the return request is used to request the return of the idle logical unit, and the idle logical unit is a logical unit that has not been used within a preset time period.
2. The method according to claim 1, characterized in that: The usage condition includes the usage time of the logical unit, and determining the idle logical unit according to the usage condition of each logical unit includes: The computing device determines an unused logical unit based on the usage time of each logical unit; When the unused logical unit is unused for a period of time greater than or equal to a preset time period, the computing device determines the unused logical unit as an idle logical unit.
3. The method according to claim 1 or 2, characterized in that: The computing device stores a metadata table, the metadata table including a state of each logical unit in the second storage space. Before sending the return request to the management unit, the method further includes: The computing device marks the state of the idle logical unit as a releasing state.
4. The method according to claim 3, characterized in that: After the computing device receives a message indicating successful return sent by the management unit, the method further includes: The computing device deletes the metadata corresponding to the idle logical unit in the metadata table.
5. The method according to any one of claims 1 to 4, characterized in that The method further comprises: The computing device sends a first request to the management unit; the first request is used to request allocation of storage space of a first storage capacity for the computing device; The computing device receives a first response from the management unit; the first 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 first response includes the identification and 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 first storage capacity, and the second storage space includes the storage space previously allocated to the computing device and the third storage space.
6. The method according to claim 5, characterized in that The computing device includes a processor, and the processor is used to run a management process to execute the method. The management process is a user-mode process in the computing device for managing a CXL storage space of the computing device.
7. The method according to claim 6, characterized in that The method further comprises: The management process receives a second request sent by a target application in the computing device; the second request is used to request allocation of a storage space of a second storage capacity for the target application; The management process sends a second response to the target application; the second response is used to indicate a fourth storage space allocated for the target application, the fourth storage space includes at least part of the storage space of the target logical unit, the second response includes an identifier of the target logical unit, a starting address and a storage capacity of the at least part of the storage space, and the target logical unit is a logical unit in the second storage space that has available storage space greater than or equal to the second storage capacity.
8. The method according to claim 7, characterized in that After the management process receives the second request sent by the target application in the computing device and before the management process sends a second response to the target application, the method further includes: In the case that the second storage space does not have a storage space that meets the preset condition, 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 a second storage capacity for the computing device, wherein the storage space that meets the preset condition is an available storage space whose storage capacity is greater than or equal to the second storage capacity; The management process receives a third response from the management unit; the third response is used to indicate a fifth storage space allocated to the computing device, the fifth storage space includes a 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 second storage capacity; The management process sending a second response to the target application comprises: The management process sends a second response to the target application, the second response is used to indicate a fourth storage space allocated for the target application, the fourth storage space includes at least part of the storage space of the target logical unit, the second response includes an identifier of the target logical unit, a starting address and a storage capacity of the at least part of the storage space, wherein the target logical unit includes the first logical unit.
9. The method according to any one of claims 1 to 8, characterized in that: The method further comprises: When the computing device determines that the application stops running, the computing device reclaims the storage space of the application.
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; when the processor executes the computer instructions, the computing device executes the method according to any one of claims 1 to 9.