Data access method, CXL storage device and CXL controller
By combining volatile and nonvolatile memory in CXL storage devices and using CXL controllers for data migration, the problem of increased usage costs of CXL storage devices when expanding memory capacity is solved, and efficient storage space expansion and cost reduction are achieved.
Patent Information
- Application Number
- PCT/CN2024/081268
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-09-26
- Filing Date
- 2024-03-12
- Publication Date
- 2025-04-03
AI Technical Summary
Existing CXL storage devices need to configure a large number of memory modules when expanding memory capacity, resulting in increased usage costs.
By using the first type of volatile memory and the second type of nonvolatile memory in the CXL storage device, and migrating data when the storage space is insufficient through the CXL controller, the storage space is expanded and the usage cost is reduced.
It realizes that while ensuring the speed of writing data, it improves the storage space capacity of CXL storage devices and reduces the cost of use.
Smart Images

Figure CN2024081268_03042025_PF_FP_ABST
Abstract
Description
A data access method, CXL storage device and CXL controller
[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on September 26, 2023, with application number 202311257482.4 and application name “A Data Access Method, CXL Storage Device and CXL Controller”, the entire contents of which are incorporated herein by reference. Technical Field
[0002] The present application relates to the field of computing technology, and in particular to a data access method, a compute express link (CXL) storage device, and a CXL controller. Background Art
[0003] With the development of technologies such as cloud computing, artificial intelligence, and high-performance computing, processor computing power continues to increase, and the number of processor cores is also increasing, which in turn leads to an increase in the demand for memory resources. To meet the needs of data center servers for large-capacity and high-bandwidth memory, a computing interconnect protocol (CXL) is proposed. CXL is an open interconnect protocol standard designed to provide an efficient, high-speed, and low-latency interface between processors (such as central processing units (CPUs)) and dedicated accelerators and high-performance storage systems to meet the needs of resource sharing, memory pooling, and efficient computational scheduling.
[0004] Related technologies have proposed a CXL storage device based on CXL, which can provide unlimited memory capacity expansion, increase the memory bandwidth of a server's single core, and improve memory utilization by serving as shared memory for multiple servers. However, using a CXL storage device to expand memory capacity requires configuring a large number of memory sticks (such as dual inline memory modules (DIMMs)) or DRAM chips within the CXL storage device, which increases the cost of using the CXL storage device.
[0005] Summary of the Invention
[0006] Embodiments of the present application provide a data access method, a CXL storage device, and a CXL controller, which can reduce the use cost of the CXL storage device.
[0007] To achieve the above technical objectives, the embodiments of the present application adopt the following technical solutions:
[0008] In a first aspect, an embodiment of the present application provides a data access method, applied to a CXL storage device, the CXL storage device further comprising a first-type memory and a second-type memory, the first-type memory being a volatile storage unit and the second-type memory being a non-volatile storage unit, the CXL storage device being connected to at least one computing device, the method comprising: receiving a write request sent by the computing device, wherein the write request is used to request writing first data to the CXL storage device; if the storage capacity of the available storage space of the first-type memory is less than the required storage capacity, migrating data in the first storage space of the first-type memory to the second-type memory so that the capacity of the currently available storage space of the first-type memory is greater than or equal to the required storage capacity, wherein the required storage capacity is the storage capacity required to store the first data and the currently available storage space is the sum of the storage capacity of the first storage space and the storage capacity of the available storage space; and writing the first data to the second storage space, wherein the second storage space is part or all of the currently available storage space.
[0009] It can be understood that in the method provided in the first aspect above, the first type of memory and the second type of memory can jointly provide storage space for the computing device. Among them, the second type of memory is a non-volatile storage unit with a lower cost, which can effectively reduce the cost of using the CXL storage device. In addition, the first type of memory (i.e., the volatile storage unit) is the one that directly interacts with the computing device for data, so the CXL controller can provide a function of fast data access (read / write). For example, when the storage space of the first type of memory is insufficient, the CXL controller can quickly respond to the write request and migrate the data of the first type of memory to the second type of memory to provide sufficient storage space for the first data. Therefore, the method provided in the first aspect above can ensure the data writing speed while increasing the storage space capacity of the CXL storage device and reducing the cost of using the CXL storage device.
[0010] In one possible implementation method, a write request is used to request writing first data to a first address of a CXL storage device; the first address is a partial address segment in a virtual physical address of a storage space of the CXL storage device reported by the CXL storage device to a computing device; the data in the first storage space is migrated to a third storage space of a second-type memory; the method further includes: storing a correspondence between the first address and a physical address of the second storage space; and storing a correspondence between a first mapping address corresponding to the physical address of the first storage space and the physical address of the third storage space.
[0011] It can be understood that storing the above correspondence makes it easier to quickly locate the specific location of the data to be read in the first or second type of memory through the correspondence when reading the data again later, thereby improving the efficiency of reading data and reducing waiting time.
[0012] In another possible implementation method, the method further includes: establishing an address mapping table; the address mapping table is used to record the correspondence between the virtual physical address of the storage space of the CXL storage device and the real physical address of the storage space of the first type of memory, or the correspondence between the virtual physical address of the storage space of the CXL storage device and the real physical address of the storage space of the second type of memory; the virtual physical address includes the first address and the first mapping address; the real physical address of the storage space of the first type of memory includes the physical address of the first storage space and the physical address of the second storage space; the real physical address of the storage space of the second type of memory includes the physical address of the third storage space; storing the correspondence between the first address and the physical address of the second storage space in the address mapping table; and storing the correspondence between the first mapping address corresponding to the physical address of the first storage space and the physical address of the third storage space in the address mapping table.
[0013] It can be understood that the address mapping table is a way of recording the correspondence between virtual physical addresses and real physical addresses. The address mapping table can store, manage, update and query the correspondence between virtual physical addresses and real physical addresses.
[0014] In another possible implementation method, the method further includes: when the storage capacity of the available storage space of the first type of memory is greater than or equal to the required storage capacity, writing the first data into the available storage space.
[0015] It is understandable that when the storage space of the first type of memory is sufficient, the CXL controller can quickly store the first data in the first type of memory.
[0016] In another possible implementation method, a write request is used to request writing first data to a first address of a CXL storage device; writing the first data to available storage space includes: when it is determined that a corresponding second mapping address exists for the first address, writing the first data to a storage space indicated by the second mapping address; the storage space indicated by the second mapping address is part or all of the available storage space; when it is determined that the corresponding second mapping address does not exist for the first address, writing the first data to a fourth storage space; the fourth storage space is part or all of the available storage space.
[0017] It can be understood that if a first address has a corresponding second mapping address, it indicates that the CXL controller has pre-established a correspondence between the first address and the real physical address of a portion of available storage space, namely, a correspondence between the first address and the second mapping address. In this case, the CXL controller can use this correspondence to quickly determine the specific physical address of the storage space to which the first data is to be written. If a first address does not have a corresponding second mapping address, it indicates that the CXL controller has not pre-assigned a corresponding mapping address for the first address. In this case, the CXL controller can select any storage space from the available storage space (e.g., the fourth storage space) with a storage capacity that meets the required storage capacity to store the first data. This method can quickly determine the storage space indicated by the first address and the specific location to which the first data is to be written.
[0018] In another possible implementation method, the method also includes, when the storage capacity of the available storage space of the first type of memory is less than a preset threshold, migrating data of the fifth storage space of the first type of memory to the second type of memory, so that the storage capacity of the available storage space of the first type of memory is greater than or equal to the preset threshold.
[0019] It can be understood that this method can ensure that the first type of memory always has sufficient storage space, avoid the situation where the storage space of the first type of memory is insufficient, reduce the waiting time when the computing device writes data, and improve data writing efficiency.
[0020] In another possible implementation method, after writing the first data into the fourth storage space, the method further includes: establishing a correspondence between the first address and the physical address of the fourth storage space.
[0021] It can be understood that establishing a correspondence between the first address and the physical address of the fourth storage space, that is, determining the storage space indicated by the first address, makes it easier to quickly locate the storage space indicated by the first address as the fourth storage space when reading data from the storage space indicated by the first address again, thereby improving the efficiency of subsequent data reading.
[0022] In another possible implementation method, the method also includes: sending the virtual physical address and storage capacity of the device storage space to the computing device, where the storage capacity is greater than the storage capacity of the first type of memory and less than or equal to the sum of the storage capacity of the first type of memory and the storage capacity of the second type of memory.
[0023] It is understandable that the CXL controller sends the virtual physical address and storage capacity of the device storage space to the computing device in order to allocate storage space to the computing device and provide storage services.
[0024] In a second aspect, an embodiment of the present application provides a data access method, applied to a CXL storage device, the CXL storage device including a first type of memory and a second type of memory, the first type of memory being a volatile storage unit and the second type of memory being a non-volatile storage unit, the CXL storage device being connected to at least one computing device, the method comprising: receiving a read request sent by the computing device, the read request being used to request reading data from a storage space indicated by a second address, the second address being a partial address segment of a virtual physical address of the storage space of the CXL storage device reported to the computing device by the CXL storage device; if the storage space indicated by the second address is a first storage area in the first type of memory, sending the data in the first storage area to the computing device; and if the storage space indicated by the second address is a second storage area in the second type of memory, sending the data in the second storage area to the computing device.
[0025] It is understandable that in the method provided in the second aspect above, the data that the computing device needs to read may exist in the first type of memory or in the second type of memory. The above method mainly determines the storage space where the data that the computing device needs to read is located. In the above method, the first type of memory (i.e., volatile storage unit) directly interacts with the computing device for data, so the CXL controller can provide a function for fast data access (read / write). The second type of memory is a non-volatile storage unit with a lower cost, which can effectively reduce the cost of using the CXL storage device. Therefore, the method provided in the second aspect above can increase the storage capacity of the CXL storage device and reduce the cost of using the CXL storage device.
[0026] In one possible implementation method, the method also includes: when the storage space indicated by the second address is the second storage area in the second type of memory, migrating the data in the second storage area to the third storage area of the first type of memory; wherein the third storage area is part or all of the storage space of the currently available storage space of the first type of memory; the storage capacity of the currently available storage space is greater than or equal to the required storage capacity, and the required storage capacity is the storage capacity required to store the data in the second storage area.
[0027] It is understandable that when the data in the second storage area is migrated to the third storage area of the first type of memory, when the subsequent computing device still needs to use this part of data, it can directly read this part of data from the first type of memory, thereby improving the data reading speed and saving waiting time.
[0028] In another possible implementation method, before migrating the data in the second storage area to the third storage area of the first type of memory, the method also includes: when the storage capacity of the available storage space of the first type of memory is less than the required storage capacity, migrating the data in the fourth storage area of the first type of memory to the second type of memory, so that the capacity of the current available storage space of the first type of memory is greater than or equal to the required storage capacity; the storage capacity of the current available storage space is equal to the sum of the storage capacity of the fourth storage area and the storage capacity of the available storage space of the first type of memory.
[0029] It can be understood that since the first type of memory and the second type of memory jointly provide storage space for the computing device, the first type of memory is used to interact with the computing device for data. The first type of memory can meet the function of fast data access (read / write), and the second type of memory can provide storage space with unlimited expansion. When the storage space of the first type of memory is insufficient, the data of the first type of memory can be migrated to the second type of memory. Since the cost of the second type of memory is relatively low, the method proposed in the embodiment of the present application can ensure the data writing speed while increasing the capacity of the storage space of the CXL storage device and reducing the use cost of the CXL storage device.
[0030] In another possible implementation method, data in the fourth storage area is migrated to the fifth storage area of the second type of memory, and the method further includes: storing a correspondence between a mapping address corresponding to a physical address of the fourth storage area and a physical address of the fifth storage area.
[0031] It can be understood that the correspondence between the mapping address corresponding to the physical address of the fourth storage area and the physical address of the fifth storage area is stored. When the subsequent computing device needs to read this part of the data, it can quickly find the address of the specific storage space of the data in the second type of memory through this correspondence, thereby improving the efficiency of reading data and reducing waiting time.
[0032] In another possible implementation method, after migrating the data in the second storage area to the third storage area of the first type of memory, the method further includes: storing a correspondence between the second address and the physical address of the third storage area.
[0033] It can be understood that the correspondence between the second address and the physical address of the third storage area is stored, that is, the storage space indicated by the second address is determined, so that when data is read from the storage space indicated by the second address again, the storage space indicated by the second address can be quickly located as the third storage area.
[0034] In one possible implementation method, after receiving a read request sent by a computing device, the method further includes: determining the storage space indicated by the second address; when the first mapping address corresponding to the second address is the physical address of the first storage area, the storage space indicated by the second address is the first storage area; when the first mapping address corresponding to the second address is the physical address of the second storage area, the storage space indicated by the second address is the second storage area.
[0035] It can be understood that the method proposed in the embodiment of the present application can quickly determine the storage space indicated by the second address, and determine the specific location where the data to be read is stored.
[0036] In another possible implementation method, the method further includes: establishing an address mapping table; the address mapping table is used to record the correspondence between the virtual physical address of the storage space of the CXL storage device and the real physical address of the storage space of the first type of memory, or the correspondence between the virtual physical address of the storage space of the CXL storage device and the real physical address of the storage space of the second type of memory; the virtual physical address includes the second address and the mapping address; the real physical address of the storage space of the first type of memory includes the physical address of the first storage area, the first mapping address, the physical address of the third storage area, and the physical address of the fourth storage area; the real physical address of the storage space of the second type of memory includes the physical address of the second storage area and the physical address of the fifth storage area; storing the correspondence between the second address and the physical address of the third storage area in the address mapping table; and storing the correspondence between the mapping address corresponding to the physical address of the fourth storage area and the physical address of the fifth storage area in the address mapping table.
[0037] It can be understood that the address mapping table is a way of recording the correspondence between virtual physical addresses and real physical addresses. The address mapping table can store, manage, update and query the correspondence between virtual physical addresses and real physical addresses.
[0038] In another possible implementation method, the method further includes: sending a storage capacity of the device storage space and a virtual physical address of the storage space of the CXL storage device to the computing device, wherein the storage capacity is greater than the storage capacity of the first type of memory and less than or equal to the sum of the storage capacity of the first type of memory and the storage capacity of the second type of memory.
[0039] It is understandable that the CXL controller sends the virtual physical address and storage capacity of the storage space of the CXL storage device to the computing device in order to allocate storage space to the computing device and provide storage services.
[0040] In a third aspect, an embodiment of the present application provides a CXL storage device, wherein the CXL storage device includes a CXL controller, a first type of memory, and a second type of memory; the first type of memory is a volatile storage unit; the second type of memory is a non-volatile storage unit; the first type of memory and the second type of memory are respectively used to store data of a computing device; the CXL controller is applied to each module of the data access method of the first aspect or any possible implementation of the first aspect; or, the CXL controller is applied to each module of the data access method of the second aspect or any possible implementation of the second aspect.
[0041] In a fourth aspect, an embodiment of the present application provides a CXL controller, wherein the CXL controller is applied to each module of the data access method of the first aspect or any possible implementation of the first aspect; or, the CXL controller is applied to each module of the data access method of the second aspect or any possible implementation of the second aspect.
[0042] In a fifth aspect, embodiments of the present application provide a CXL controller comprising a processor. The processor is coupled to a memory; the memory is configured to store programs or instructions. When the program or instructions are executed by the processor, the CXL controller performs the data access method according to the first aspect and any possible implementation thereof; or, when the program or instructions are executed by the processor, the CXL controller performs the data access method according to the second aspect and any possible implementation thereof.
[0043] In a sixth aspect, embodiments of the present application provide a computer-readable storage medium comprising computer instructions. When the computer instructions are executed on a CXL controller, the CXL controller executes the data access method according to the first aspect and any possible implementation thereof; or, when the computer instructions are executed on the CXL controller, the CXL controller executes the data access method according to the second aspect and any possible implementation thereof.
[0044] In a seventh aspect, embodiments of the present application provide a computer program product comprising computer instructions. When the computer instructions are executed on a CXL controller, the CXL controller executes the data access method according to the first aspect and any possible implementation thereof; or, when the computer instructions are executed on the CXL controller, the CXL controller executes the data access method according to the second aspect and any possible implementation thereof.
[0045] For the specific description of the third to seventh aspects and their various implementations in the embodiments of the present application, reference can be made to the detailed description in the first or second aspect and their various implementations; and for the beneficial effects of the third to seventh aspects and their various implementations, reference can be made to the analysis of the beneficial effects in the first or second aspect and their various implementations, which will not be repeated here.
[0046] These and other aspects of the embodiments of the present application will be more clearly understood in the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] FIG1 is a system architecture diagram provided in an embodiment of the present application;
[0048] FIG2 is a schematic diagram of the structure of a CXL storage device provided in an embodiment of the present application;
[0049] FIG3 is a schematic diagram of the structure of another CXL storage device provided in an embodiment of the present application;
[0050] FIG4 is a schematic diagram of the structure of another CXL storage device provided in an embodiment of the present application;
[0051] FIG5 is a schematic diagram of the structure of another CXL storage device provided in an embodiment of the present application;
[0052] FIG6 is a schematic diagram of the structure of another CXL storage device provided in an embodiment of the present application;
[0053] FIG7 is a schematic diagram of the structure of another CXL storage device provided in an embodiment of the present application;
[0054] FIG8 is a flow chart of a data access method provided in an embodiment of the present application;
[0055] FIG9 is a flow chart of another data access method provided in an embodiment of the present application;
[0056] FIG10 is a flowchart of another data access method provided in an embodiment of the present application;
[0057] FIG11 is a schematic diagram of the structure of a CXL controller provided in an embodiment of the present application;
[0058] FIG12 is a schematic diagram of the structure of another CXL controller provided in an embodiment of the present application. DETAILED DESCRIPTION
[0059] In the following, the terms "first," "second," and "third," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the quantity of the technical features indicated. Thus, a feature designated as "first," "second," or "third," etc., may explicitly or implicitly include one or more of the features.
[0060] In the description of the embodiments of this application, unless otherwise specified, " / " means "or." For example, A / B can mean A or B. "And / or" in this document is simply a description of an association relationship between associated objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, A and B exist simultaneously, and B exists alone. In addition, "at least one" means one or more, and "a plurality" means two or more.
[0061] Related technologies have proposed a CXL storage device based on CXL. This device can provide unlimited memory capacity expansion, increase the memory bandwidth of a server's single core, and improve memory utilization by serving as shared memory for multiple servers. However, using a CXL storage device to expand memory capacity requires configuring a large number of memory sticks (such as DIMMs) or DRAM chips within the CXL storage device. Since memory sticks are expensive, connecting a large number of them increases the cost of using the CXL storage device.
[0062] Based on this, an embodiment of the present application proposes a data access method, which is applied to a CXL controller of a CXL storage device. The specific method includes: after receiving a write request sent by a computing device, the CXL controller first determines whether the first-type memory has sufficient available storage space; if the available storage space of the first-type memory is sufficient, the data carried by the write request is written into the available storage space of the first-type memory; if the available storage space of the first-type memory is insufficient, the data in the first-type memory is migrated to a second-type memory so that the available storage space of the first-type memory is sufficient; and then the data carried by the write request is written into the available storage space of the first-type memory after the data is migrated.
[0063] It can be understood that in the above method, the first type of memory and the second type of memory can jointly provide storage space for the computing device. Among them, the second type of memory is a non-volatile storage unit with a lower cost, which can effectively reduce the cost of using the CXL storage device. In addition, the first type of memory (i.e., the volatile storage unit) is the one that directly interacts with the computing device for data, so the CXL controller can provide the function of fast data access (read / write). For example, when the storage space of the first type of memory is sufficient, the CXL controller can quickly store the first data in the first type of memory; when the storage space of the first type of memory is insufficient, the CXL controller can quickly respond to the write request and migrate the data of the first type of memory to the second type of memory to provide sufficient storage space for the first data. Therefore, the method provided in the first aspect above can ensure the data writing speed while increasing the capacity of the storage space of the CXL storage device and reducing the cost of using the CXL storage device.
[0064] The implementation of the embodiments of the present application will be described in detail below with reference to the accompanying drawings.
[0065] Please refer to Figure 1, which shows a computing system architecture diagram involved in the data access method provided in an embodiment of the present application. As shown in Figure 1, the computing system may include: a computing device 110 and a CXL storage device 120, and optionally, a CXL connection device 130.
[0066] The computing device 110 is communicatively connected to the CXL storage device 120 , wherein the CXL storage device 120 is connected to the CPU of the computing device 110 .
[0067] The computing device 110 is a computing device with data processing, logical operation and storage functions. In the embodiment of the present application, the computing device 110 writes data to the CXL storage device 120 by initiating a write request, or reads data from the CXL storage device 120 by initiating a read request.
[0068] Illustratively, computing device 110 may include computing devices such as a server, tablet computer, desktop computer, laptop computer, notebook computer, or netbook computer. The server may be a rack server, blade server, tower server, or other different types of servers. The server may also be a graphics processing unit (GPU) server. The server may include one or more computing nodes, each of which includes at least one CPU.
[0069] In the embodiment of the present application, there may be multiple computing devices 110. When there are multiple computing devices, each computing device is connected to the CXL storage device 120 via the CXL connection device 130. Of course, in other embodiments, the computing device may also be directly connected to the CXL storage device.
[0070] The CXL storage device 120 is used to provide storage space for at least one computing device 110 , provide physical addresses of storage space for the computing device 110 , query available storage space, and perform data migration. The CXL storage device 120 may include a CXL controller 121 , a first type of memory 122 , and a second type of memory 123 .
[0071] The CXL controller 121 is configured to directly or indirectly control reading data from or writing data to the first type of memory 122 or the second type of memory 123. Optionally, the CXL controller 121 controls the first type of memory 122 via a controller (e.g., the first controller 124 in FIG. 7 ), or controls the second type of memory 123 via a controller (e.g., the second controller 125 in FIG. 7 ).
[0072] Illustratively, CXL controller 121 is configured to convert address information carried in a read / write data request sent by computing device 110 into physical address information corresponding to first type memory 122 or second type memory 123 when computing device 110 requests to read / write data to CXL storage device 120 .
[0073] The CXL controller 121 is also called a CXL memory expander controller or a CXL memory expander pooling chip. The CXL controller 121 can have various forms. For example, the CXL controller 121 can be a processor or a data processing unit (DPU).
[0074] The first type of memory 122 is a volatile memory unit that can provide storage space for fast data read / write. In the embodiment of the present application, the first type of memory 122 is the storage unit in the CXL storage device that actually interacts with the computing device for data.
[0075] Illustratively, the first type of memory 122 may include one or more DIMMs, one or more storage devices having dynamic random access memory (DRAM), and / or synchronous dynamic random access memory (SDRAM).
[0076] Second-type memory 123 is a non-volatile storage unit that provides large-capacity storage space. In this embodiment, second-type memory 123 serves as backup storage for first-type memory 122, expanding the storage space of the CXL storage device. When first-type memory 122 runs out of storage space, CXL controller 121 migrates data from first-type memory 122 to the storage space of second-type memory 123.
[0077] Exemplarily, the second type of memory 123 may include one or more solid state disks (SSDs), one or more storage devices with NAND (not AND), and / or persistent memory (PMEM).
[0078] The embodiments of the present application do not limit the media type, quantity, and deployment method of the first type of storage and the second type of storage.
[0079] It should be noted that, since the storage unit in the CXL storage device 120 that actually exchanges data with the computing device 110 is the first type of memory 122, the storage space provided by the CXL storage device 120 for the computing device 110 can be regarded as real storage space, and the storage space provided by the second type of memory 123 can be regarded as virtual storage space. The storage capacity of the storage space provided by the CXL storage device 120 for the computing device 110 is less than or equal to the sum of the storage capacities of the first type of memory 122 and the second type of memory 123, and greater than the storage capacity of the first type of memory 122.
[0080] For example, if the storage capacity of first type memory 122 is 1 TB, and the storage capacity of second type memory 123 is 4 TB, and the storage space provided by the CXL storage device to computing device 110 has a storage capacity of 3 TB, 1 TB of this storage space is real storage space, and the remaining 2 TB is virtual storage space, which is obtained by migrating data from first type memory 122 to second type memory 123.
[0081] The CXL connection device 130 provides an expansion interface. When there are multiple computing devices 110, the CXL storage device 120 can be connected to the CPUs of multiple computing devices 110 via the CXL connection device 130. The CXL connection device 130 can be independently configured or integrated into any computing device 110 or the CXL storage device 120.
[0082] For example, when the CXL connection device 130 is independently configured, it can be a CXL switch. When the CXL connection device 130 is integrated into the CXL storage device 120, it can be a multi-head CXL memory expansion card. In addition to expansion capabilities, the CXL switch also includes a processor with processing capabilities, such as managing the storage space in the CXL storage device 120.
[0083] In some embodiments, the CXL storage device 120 proposed in the embodiments of the present application may include but is not limited to the following 6 possible combinations. For example, as shown in FIG2 , the CXL storage device 120 includes: a CXL controller 121, a DIMM (a first type of memory 122) and an SSD (a second type of memory 123); as shown in FIG3 , the CXL storage device 120 includes: a CXL controller 121, DRAM particles (a first type of memory 122) and a NAND particle (a second type of memory 123); as shown in FIG4 , the CXL storage device 120 includes: a CXL controller 121, DRAM particles (a first type of memory 122) and an SSD (a second type of memory 123); as shown in FIG5 , the CXL storage device 120 includes: a CXL controller 121, DRAM particles (a first type of memory 122) and an SSD (a second type of memory 123); The device 120 includes: a CXL controller 121, a DIMM (first type of memory 122), and a NAND chip (second type of memory 123). As shown in FIG6 , the CXL storage device 120 includes: a CXL controller 121, a second controller 125, a DIMM (first type of memory 122), and a NAND chip (second type of memory 123). As shown in FIG7 , the CXL storage device 120 includes: a CXL controller 121, a first controller 124, a second controller 125, a DIMM (first type of memory 122), and a NAND chip (second type of memory 123).
[0084] Optionally, the first controller 124 is a controller capable of controlling the first type of storage 122, and can write data to or read data from the first type of storage 122. The second controller 125 is a controller capable of controlling the second type of storage 123, and can write data to or read data from the second type of storage 123, or can automatically erase data in the second type of storage 123.
[0085] The first controller 124 and the second controller 125 can be integrated into the CXL controller 121 , or can be independently provided outside the CXL controller 121 and connected to the CXL controller 121 .
[0086] In the embodiment of the present application, if the system architecture involved in the data access method does not include the first controller 124 and the second controller 125 , the functions of the first controller 124 and the second controller 125 may be implemented by the CXL controller 121 .
[0087] In the embodiment of the present application, the number of computing device 110, CXL storage device 120, and CXL connection device 130 can be one or more. When there are multiple CXL storage devices 120 and multiple CXL connection devices 130, multiple CXL connection devices 130 can be connected to each other, and multiple CXL storage devices 120 can be connected to provide the computing device 110 with storage space that can be infinitely expanded.
[0088] The following describes the data access method provided in the embodiment of the present application:
[0089] An embodiment of the present application provides a data access method, which is applied to a CXL storage device (e.g., CXL storage device 120 in FIG. 1 ) and is specifically executed by a CXL controller (e.g., CXL controller 121 in FIG. 1 ). The CXL storage device is connected to at least one computing device. The CXL storage device also includes a first type of memory (e.g., first type of memory 122 in FIG. 1 ) and a second type of memory (e.g., second type of memory 123 in FIG. 1 ) to provide storage space for the computing device connected to the CXL storage device.
[0090] It is understandable that the data access method provided in the embodiments of the present application mainly includes the first aspect and / or the second aspect:
[0091] In the first aspect, the computing device writes data to the CXL storage device.
[0092] Second aspect: The computing device reads data from the CXL storage device.
[0093] Before executing the first or second aspect, the CXL storage device must be initialized and storage space allocated to the computing device. The following describes the initialization process that the CXL storage device must perform before executing the first or second aspect. This initialization process only needs to be performed once after the CXL storage device is powered on. After this initialization process, the first and / or second aspects can be executed multiple times. As shown in Figure 8 , this process specifically includes S101-S102.
[0094] S101: The CXL controller establishes an address mapping table.
[0095] The address mapping table is used to record the correspondence between the virtual physical addresses of the storage space of the CXL storage device and the real physical addresses of the storage space of the first type of memory, or to record the correspondence between the virtual physical addresses of the storage space of the CXL storage device and the real physical addresses of the storage space of the second type of memory. Hereinafter, the real physical addresses of the storage space of the first type of memory are referred to as first real physical addresses, and the real physical addresses of the storage space of the second type of memory are referred to as second real physical addresses.
[0096] The storage space provided by a CXL storage device for a computing device is called device storage space. This device storage space includes the storage space of the first type of memory and the storage space of the second type of memory. The addresses corresponding to the device storage space are virtual physical addresses. The storage capacity of the device storage space is less than or equal to the sum of the storage capacities of the first type of memory and the second type of memory, and greater than the storage capacity of the first type of memory.
[0097] The storage space provided by the first type of memory and the second type of memory are both real storage spaces. Since the first type of memory directly exchanges data with the computing device, the embodiment of the present application can regard the storage space provided by the second type of memory as virtual storage space.
[0098] In one embodiment, after the CXL storage device is powered on, the CXL controller evaluates the storage space of the first and second type memories, estimates the storage capacity of the device storage space that the first and second type memories can provide to the computing device, and then generates a corresponding virtual physical address based on the device storage space.
[0099] In another embodiment, a configuration file is provided in the CXL storage device. The configuration file configures the storage capacity of the device storage space that the CXL storage device can provide to the computing device. After the CXL storage device is powered on, the CXL controller generates a virtual physical address corresponding to the storage capacity of the device storage space configured in the configuration file based on the configuration file.
[0100] For example, the device storage space configured for the computing device in the configuration file is 4 GB of storage space. The CXL controller generates a corresponding virtual physical address of 0x0-0x100000000 for the 4 GB of device storage space.
[0101] In the method provided in the embodiments of the present application, since the first-type memory provides fast read and write capabilities, data exchange between the computing device and the CXL storage device is actually data exchange with the first-type memory of the CXL storage device. The second-type memory serves as backup storage space for the first-type memory. When the storage space of the first-type memory is insufficient, data exchange occurs between the first-type memory and the second-type memory. Since the storage capacity of the first-type memory is a fixed value, the larger the storage capacity of the device storage space provided by the CXL storage device for the computing device, the more storage space the computing device can use, the more storage space the computing device can use in the second-type memory, and the greater the probability of data being exchanged from the first-type memory to the second-type memory. The smaller the storage capacity of the device storage space provided by the CXL storage device for the computing device, the lower the probability of data being exchanged from the first-type memory to the second-type memory. When data is stored in the first-type memory, read and write speeds are higher, and the CXL storage device exhibits better read and write performance. Therefore, in order to strike a balance between providing the computing device with the largest possible storage capacity and the read and write performance of the CXL storage device, it is necessary to set an appropriate value for the storage capacity of the device storage space provided by the CXL storage device. The specific setting is based on the actual application scenario requirements and is not limited in this embodiment of the present application.
[0102] Optionally, a technician may set the storage capacity of the storage space that the CXL storage device can provide to the computing device in the configuration file through a human-computer interaction interface provided by any computing device.
[0103] In one embodiment, after the CXL storage device is powered on and initialized, the CXL controller may create an address mapping table and pre-establish a correspondence between the virtual physical address and the first real physical address, storing the correspondence in the address mapping table. The storage space indicated by the corresponding virtual physical address and the storage space indicated by the real physical address have the same storage capacity.
[0104] Since the storage capacity of the device storage space is greater than the storage capacity of the storage space of the first type of memory, in the above embodiment, the number of virtual physical addresses is greater than the number of first real physical addresses. If a correspondence between the virtual physical address and the first real physical address is established in advance, then at this time, some virtual physical addresses do not have corresponding real physical addresses.
[0105] For example, as shown in Table 1, Table 1 shows an address mapping table established by the CXL controller. This address mapping table is used to store the correspondence between virtual physical addresses and real physical addresses. The following uses the correspondence between virtual physical addresses and the first real physical address as an example. If the device storage space provided by the CXL storage device for the computing device is 4GB, and the storage space corresponding to the first real physical address has a storage capacity of 1GB, the CXL controller divides the device storage space into 16 sub-storage spaces of 256MB each. The virtual physical addresses corresponding to these 16 sub-storage spaces are DPA1-DPA16, respectively. The CXL controller divides the storage space of the first type of memory into four sub-storage spaces of 256MB each. The real physical addresses corresponding to these four sub-storage spaces are RDPA1-RDPA4, respectively. The CXL controller selects three virtual physical addresses from the virtual physical addresses of the 16 sub-storage spaces and three real physical addresses from the four real physical addresses. The CXL controller establishes correspondences between the three virtual physical addresses and the three real physical addresses, and records these correspondences in the address mapping table shown in Table 1. Table 1 includes a "virtual physical address" and a "first real physical address".
[0106] Table 1
[0107] In addition to recording the correspondence between virtual physical addresses and real physical addresses, the address mapping table may also record virtual physical addresses or real physical addresses that currently have no correspondence. As shown in Table 1 above, some virtual physical addresses in Table 1 have correspondence with some real physical addresses, while some virtual physical addresses or real physical addresses do not. The address mapping table shown in Table 1 is only one form of representation, and the embodiments of the application do not limit whether the correspondence between real physical addresses and virtual physical addresses should be established in advance, or whether the correspondence should be recorded through the address mapping table shown in Table 1.
[0108] In another embodiment, after the CXL storage device is powered on and initialized, the CXL controller only creates a blank address mapping table. When a computing device subsequently needs to write data to or read data from the CXL storage device, the correspondence between the virtual physical address and the real physical address is recorded in the blank address mapping table.
[0109] In an embodiment of the present application, the CXL controller may establish two address mapping tables, one for storing the correspondence between the virtual physical address and the first real physical address, and the other for storing the correspondence between the virtual physical address and the second real physical address. Alternatively, the CXL controller may establish one address mapping table to store both the correspondence between the virtual physical address and the first real physical address and the correspondence between the virtual physical address and the second real physical address. This embodiment of the present application is not limited to this.
[0110] It should be noted that if the CXL controller establishes a blank address mapping table and does not pre-record the correspondence between virtual physical addresses and real physical addresses in the table, the address mapping table can be established after the CXL storage device is powered on, or when the CXL storage device first writes operating data to the computing device, or when the computing device first reads data from the CXL storage device. This embodiment of the application does not limit this. If the CXL controller establishes two address mapping tables, the address mapping table established for the virtual physical address and the second real physical address can be established after the CXL storage device is powered on, or when data from the first type of memory is migrated to the second type of memory. This application does not limit this.
[0111] Because CXL storage devices can provide storage space for multiple computing devices, and the storage space used by each computing device is physically isolated, if a CXL storage device provides storage space for multiple computing devices, the CXL controller maintains an address mapping table for each computing device separately, and the address mapping tables of each computing device do not affect each other.
[0112] S102: The CXL storage device sends the virtual physical address and storage capacity of the device storage space to the computing device.
[0113] Correspondingly, the computing device receives the virtual physical address of the device storage space and the storage capacity of the device storage space sent by the CXL controller of the CXL storage device.
[0114] The computing device is connected to the CXL storage device.
[0115] Optionally, after the computing device receives the virtual physical address and storage capacity of the device storage space, it maps the device storage space to the device file, and based on the starting address of the device file, sets an offset for the address of the device storage space mapped in the device file, which can also be understood as the offset address of the device storage space in the device file.
[0116] For example, the computing device receives a virtual physical address range of 0x0-0x100000000, and a storage capacity of 4GB. The computing device maps the device storage space to the device file / dev / dax.1 and sets the offset of the address mapped in the device file. If the initial address of the device storage space mapped in the device file / dev / dax.1 is 0x10000000, then the offset of the device storage space mapped in the device file / dev / dax.1 is offset = 0x10000000, and the logical address range after the device storage space is mapped in the device file is 0x10000000 to 0x110000000.
[0117] A device file is an interface to a device driver, allowing applications to interact with the device by calling its device driver through the standard input and output system. It will be appreciated that in this embodiment of the application, a device file is an interface to the driver for the storage space in the CXL storage device. Applications can use the device file to write data to the storage space corresponding to the device file, or read data from the storage space corresponding to the device file.
[0118] After the computing device mounts the device file to the specified directory, it can provide storage services for applications running in the computing device's operating system, such as allocating storage space in the mounted device file to the application or reclaiming storage space allocated to the application.
[0119] After the CXL storage device is initialized, the computing device begins to perform the following first process based on the storage space provided by the CXL storage device. Please refer to FIG9 , which is a flowchart of a data access method provided in an embodiment of the present application. The method may include S201 - S206 .
[0120] S201: A computing device sends a write request to a CXL storage device. Correspondingly, a CXL controller of the CXL storage device receives the write request sent by the computing device.
[0121] The write request is used to request to write the first data into the CXL storage device, specifically, to write the first data into the storage space indicated by the first address in the CXL storage device.
[0122] The first address is a partial address segment of a virtual physical address of a storage space of the CXL storage device reported by the CXL storage device to the computing device.
[0123] In one embodiment, the computing device selects unused storage space from the storage space corresponding to the device file and allocates it to the application running in the operating system. When the application needs to write data to the storage space allocated to the application, the computing device is triggered to send a write request to the CXL controller.
[0124] The address of the storage space allocated by the computing device to the application is the logical address of the storage space in the device file. The application's running data will eventually need to be written to the CXL storage device. At this point, the logical address must be converted into a virtual physical address provided by the CXL storage device to the computing device. This address conversion process can be performed by the computing device or the CXL controller, and is not limited in this embodiment.
[0125] In one embodiment, an application program needs to write data to a storage space corresponding to a first logical address, where the virtual physical address corresponding to the first logical address is a first address. If the address translation process is performed by a computing device, the computing device converts the first logical address to the first address and then generates a write request including first data, the first address, and the length of the first data. The first data is the running data that the application program needs to write to the first address, and the first address is a virtual physical address provided by the CXL storage device to the computing device.
[0126] In another embodiment, an application program wants to write data to a storage space corresponding to a first logical address, where the virtual physical address corresponding to the first logical address is a first address. If the address translation process is performed by a CXL controller, the computing device generates a write request including first data, a first logical address, and the length of the first data. The first data is the operational data that the application program wants to write to the first address. Upon receiving the write request, the CXL controller translates the first logical address into the first address, which is the virtual physical address provided by the CXL storage device to the computing device.
[0127] S202 : The CXL controller determines whether the storage capacity of the available storage space of the first type of storage is greater than or equal to the required storage capacity.
[0128] If yes, execute S203; if no, execute S204.
[0129] The available memory space is the unused memory space in the first type of memory.
[0130] The required storage capacity is the storage capacity required to store the first data.
[0131] In one embodiment, the CXL controller records usage of storage space of the first type of memory, including used and unused storage space, as well as the physical address and storage capacity of the used storage space and the physical address and storage capacity of the unused storage space. "Used" indicates that data has been stored in the storage space, while "unused" indicates that no data has been stored in the storage space. Based on the recorded usage of the storage space of the first type of memory, the CXL controller determines whether the storage capacity of the unused (i.e., usable) storage space is greater than or equal to the required storage capacity.
[0132] For example, as shown in Table 2, Table 2 shows the usage of the storage space of the first type of memory recorded by the CXL controller. Table 2 includes: "first real physical address", "storage capacity" and "usage", where "storage capacity" is the storage capacity of the storage space corresponding to the "first real physical address" and "usage" is the usage of the storage space corresponding to the "first real physical address", and the usage includes used and unused.
[0133] Table 2
[0134] As can be seen from Table 2, the total storage capacity of the first type of memory is 2 GB, of which the storage capacity of the used storage space is 1 GB + 512 MB, and the storage capacity of the unused storage space is 512 MB. If the storage capacity required for storing the first data (the required storage capacity) is less than or equal to 512 MB, then the storage capacity of the available storage space of the first type of memory is determined to be greater than or equal to the required storage capacity. If the storage capacity required for storing the first data is greater than or equal to 512 MB, then the storage capacity of the available storage space of the first type of memory is determined to be less than the required storage capacity.
[0135] S203: The CXL controller writes the first data into the available storage space.
[0136] Specifically, the CXL controller writes the first data into the storage space indicated by the first address.
[0137] The storage space indicated by the first address is part or all of the storage space in the available storage space.
[0138] Before writing the first data into the available storage space, the CXL controller needs to determine which portion of the available storage space of the CXL storage device to write the first data into. The specific method may include: the CXL controller determines from an address mapping table whether the first address has a corresponding second mapping address.
[0139] If the first address has a corresponding second mapping address, writing the first data into the storage space indicated by the second mapping address, where the storage space indicated by the second mapping address is part or all of the available storage space;
[0140] If the first address does not have a corresponding second mapping address, the first data is written into a fourth storage space, where the fourth storage space is part or all of the available storage space.
[0141] The second mapped address is a portion of the real physical address of the first type of memory. The existence of a corresponding second mapped address for the first address indicates that, after establishing the address mapping table, the CXL controller has already established a correspondence between the first address and the real physical address of a portion of available memory space. This correspondence, in other words, the first address and the second mapped address, has been recorded in the address mapping table. The CXL controller can then quickly determine the specific physical address of the memory space to which the first data is to be written using the second mapped address corresponding to the first address recorded in the address mapping table.
[0142] If the first address does not have a corresponding second mapping address, it means that the CXL controller has not pre-assigned a corresponding mapping address to the first address. In this case, the CXL controller can select any storage space (such as the fourth storage space) with a storage capacity that meets the required storage capacity from the available storage space to store the first data.
[0143] After the CXL controller determines the fourth storage space from the available storage space, the CXL controller establishes a correspondence between the first address and the physical address of the fourth storage space, and stores the correspondence in an address mapping table as shown in Table 1.
[0144] Optionally, the CXL controller changes the usage status of the fourth storage space from “unused” to “used”.
[0145] For example, if the length of the first data is 100 MB and the available storage space has a storage capacity of 512 MB, the CXL controller may allocate 100 MB of storage space (the fourth storage space) from the available storage space to store the first data. As shown in Table 2, the available storage space is the storage space indicated by RDPA3. After storing the first data in the available storage space, 412 MB of available storage space remains. The CXL controller updates the storage space usage in Table 2 to Table 3.
[0146] Table 3
[0147] After S203 is completed, S206 is executed.
[0148] S204: The CXL controller migrates the data in the first storage space of the first type of storage to the second type of storage, so that the storage capacity of the currently available storage space of the first type of storage is greater than or equal to the required storage capacity.
[0149] The current available storage space is the sum of the storage capacity of the first storage space and the storage capacity of the available storage space.
[0150] In one embodiment, if the sum of the storage capacities of multiple storage spaces in the first-type memory and the available storage capacity is greater than or equal to the required storage capacity, the CXL controller may select any storage space as the first storage space, or may select a storage space with the lowest data access frequency, or a storage space with a data access frequency less than or equal to a frequency threshold, as the first storage space. The access frequency includes the frequency with which the computing device reads data, for example, once a day.
[0151] For example, if the length of the first data is 700MB, as shown in Table 2, it can be concluded from Table 2 that the storage capacity of the unused storage space RDPA3 in the first type of memory is 512MB, and the used storage space is the storage space indicated by RDPA1 and the storage space indicated by RDPA2, and the sum of the storage capacity of the two parts of the storage space and the storage capacity of the available storage space is greater than or equal to the required storage capacity. Therefore, the data in the storage space indicated by RDPA1 or the storage space indicated by RDPA2 can be migrated to the second type of memory.
[0152] Exemplarily, based on the above example, if the data in the storage space indicated by RDPA1 is accessed by the computing device once every other day, and the data in the storage space indicated by RDPA2 is accessed by the computing device once every week, then the storage space indicated by RDPA2 is considered to be the storage space with the lowest access frequency, and the storage space indicated by RDPA2 can be used as the second storage space.
[0153] In the above process, if the data in the storage space with the lowest access frequency or the access frequency is less than or equal to the frequency threshold is migrated out, the probability of migrating this part of data back to the first type of storage is also low, avoiding multiple migrations of data between the first type of storage and the second type of storage, and reducing resource waste.
[0154] In one embodiment, the CXL controller migrates data in the first storage space of the first type of memory to the third storage space of the second type of memory, and establishes a correspondence between a first mapping address corresponding to a physical address of the first storage space and a physical address of the third storage space.
[0155] The first mapping address is a partial address segment of a virtual physical address of a storage space of the CXL storage device reported by the CXL storage device to the computing device.
[0156] The third storage space is part or all of the available storage space in the second type of storage.
[0157] Since the first storage space has previously stored the operating data of the computing device, the physical address of the first storage space also has a corresponding first mapping address in the address mapping table.
[0158] Exemplarily, as shown in Table 1, if the first storage space is the storage space indicated by RDPA2 in Table 1, the first mapping address is DPA2 in Table 1.
[0159] In some embodiments, the CXL controller records, in an address mapping table, a correspondence between a virtual physical address of a storage space of the CXL storage device and a second-type real physical address. Optionally, the CXL controller further records usage of the storage space of the second-type memory. The virtual physical address recorded by the CXL controller in the address mapping table is a virtual physical address corresponding to a real physical address of the storage space of the first-type memory where data is located before migration from the first-type memory to the second-type memory, for example, a first mapping address corresponding to the first storage space.
[0160] For example, as shown in Table 4, an address mapping table records the correspondence between the virtual physical address and the second real physical address of the storage space of the CXL storage device, as well as the usage of the storage space of the second type of memory, where the usage includes used and unused. Table 4 includes: "Virtual Physical Address", "Second Real Physical Address", "Storage Capacity", and "Usage". Among them, "Virtual Physical Address" is the virtual physical address corresponding to the real physical address of the storage space of the first type of memory where the data migrated from the first type of memory to the second type of memory is located before migration, the storage capacity is the storage capacity of the storage space indicated by the "Second Real Physical Address", and the "Usage" is the usage of the storage space indicated by the "Second Real Physical Address". The usage includes used or unused. Used indicates that the part of the storage space has already stored data migrated from the first type of memory to the second type of memory. As shown in Table 4, if the first storage space is the storage space indicated by RDPA2 in Table 2, the CXL controller migrates the data in the storage space indicated by RDPA2 to the storage space (third storage space) indicated by physical address A1 as shown in Table 4, and the CXL controller records the virtual physical address DPA2 (first mapping address) corresponding to RDPA2 in Table 2 at the virtual physical address corresponding to A1 in Table 4.
[0161] Table 4
[0162] Optionally, after migrating the data in the first storage space to the third storage space of the second type of memory, the CXL controller removes the correspondence between the physical address of the first storage space and the first mapping address. For example, the CXL controller deletes the correspondence between the physical address of the first storage space and the first mapping address in the address mapping table.
[0163] It can be understood that the correspondence shown in Table 4 is established so that when the subsequent computing device needs to read the data migrated to the second type of memory, the virtual physical address shown in Table 4 can quickly locate the location of the data in the specific storage space of the second type of memory, thereby improving the efficiency of reading data and reducing waiting time.
[0164] The address mapping table shown in Table 4 includes the correspondence between the virtual physical address and the second real physical address, and also includes the usage of the storage space indicated by the second real physical address. In other processing methods, the correspondence and the usage of the storage space can also be recorded in two tables respectively. The address mapping table shown in Table 4 is an optional implementation method. The embodiment of the present application does not limit how to record the correspondence and usage.
[0165] In another embodiment, the CXL controller stores the first mapping address and the data in the first storage space together in the third storage space of the second type of memory. When the computing device subsequently reads the data corresponding to the first mapping address, it can find the first mapping address by traversing the data stored in the storage space of the second type of memory.
[0166] S205: The CXL controller writes the first data into the second storage space.
[0167] The second storage space is part or all of the storage space in the currently available storage space of the first type of storage.
[0168] Optionally, the CXL controller stores the correspondence between the first address and the physical address of the second storage space. Specifically, the CXL controller stores the correspondence between the first address and the physical address of the second storage space in an address mapping table.
[0169] If the second storage space is a continuous storage space in the first type of memory, the first address corresponds to a real physical address.
[0170] If the second storage space is a plurality of discontinuous storage spaces in the first type of memory, the first address corresponds to a plurality of real physical addresses.
[0171] For example, if the second storage space is the storage space indicated by RDPA2 and the first address is DPA5, the CXL controller establishes a correspondence between DPA5 and RDPA2. If the second storage space is the storage space indicated by RDPA2 and RDPA4, the CXL controller establishes a correspondence between DPA5 and (RDPA2 and RDPA4).
[0172] It can be understood that if the first address corresponds to a real physical address, it indicates that the first data is stored in a continuous storage space; if the first address corresponds to multiple real physical addresses, it indicates that the first data is stored in multiple discontinuous storage spaces.
[0173] S206: The CXL storage device sends feedback information indicating a successful write to the computing device.
[0174] Specifically, the CXL controller of the CXL storage device sends feedback information indicating a successful write to the computing device.
[0175] In the data writing method provided in the embodiments of this application, the real storage space provided by the CXL storage device for the computing device to quickly write data is the first type of memory, and the storage space provided by the second type of memory is used as virtual storage space to expand the storage space of the first type of memory. This method not only reduces the cost of the CXL storage device providing the computing device with fast data writing storage space, but also provides computing devices with large-capacity storage space.
[0176] The following is an execution process of the second aspect, which is a process of reading data at any time during the process of the CXL storage device providing storage services to the computing device. The embodiment of the present application does not limit the execution order of the second aspect and the first aspect.
[0177] Please refer to FIG. 10 , which is a flowchart of another data access method provided in an embodiment of the present application. The method may include S301 - S308 .
[0178] S301: A computing device sends a read request to a CXL storage device. Correspondingly, a CXL controller of the CXL storage device receives the read request sent by the computing device.
[0179] The read request is used to request to read data from the storage space indicated by the second address; the second address is a partial address segment in the virtual physical address of the storage space of the CXL storage device reported by the CXL storage device to the computing device.
[0180] Since the second address is a partial address segment in the virtual physical address sent by the CXL controller to the computing device, the storage space indicated by the second address is actually the storage space indicated by the real physical address corresponding to the second address.
[0181] In one embodiment, the computing device selects unused storage space from the storage space corresponding to the device file and allocates it to the application running in the operating system. When the application needs to write data from the storage space allocated to the application, the computing device is triggered to send a read request to the CXL controller.
[0182] The storage space address allocated by the computing device to the application is the logical address of the storage space in the device file. The data that the application reads is ultimately stored in the CXL storage device. At this point, the logical address read by the application needs to be converted to a virtual physical address. This address conversion process can be performed by the computing device or the CXL controller, and is not limited in this embodiment.
[0183] In one embodiment, an application program needs to read data from a storage space corresponding to a second logical address, where the virtual physical address corresponding to the second logical address is the second address. If the address translation process is performed by a computing device, the computing device converts the second logical address to a second address and then generates a read request including the second address and a data length. The data length represents the length of data to be read starting from the second address, and the second address is the virtual physical address provided by the CXL storage device to the computing device.
[0184] In another embodiment, an application program needs to read data from a storage space corresponding to a second logical address, where the virtual physical address corresponding to the second logical address is the second address. If the address translation process is performed by a CXL controller, the computing device generates a read request including the second logical address and a data length. The data length represents the length of data to be read starting from the second address. Upon receiving the read request, the CXL controller translates the second logical address into the second address.
[0185] S302: The CXL controller determines a storage space indicated by a second address.
[0186] If the storage space indicated by the second address is the first storage area in the first type of memory, execute S303;
[0187] In a case where the storage space indicated by the second address is the second storage area in the second type of memory, S304 is executed.
[0188] When it is determined that the storage space indicated by the second address does not exist, that is, both the first type of memory and the second type of memory do not have the storage space indicated by the second address, S308 is executed.
[0189] With respect to S302 , an embodiment of the present application proposes a specific method for determining the storage space indicated by the second address, including: the CXL controller determines a first mapping address corresponding to the second address.
[0190] In order to distinguish the embodiment of the present application from the first mapping address in the embodiment shown in FIG. 9 , the first mapping address corresponding to the second address is expressed as the third mapping address in the following text.
[0191] When the third mapping address corresponding to the second address is the physical address of the first storage area, the storage space indicated by the second address is the first storage area;
[0192] When the third mapping address corresponding to the second address is the physical address of the second storage area, the storage space indicated by the second address is the second storage area.
[0193] In one embodiment, the CXL controller maintains an address mapping table for the first type of memory and an address mapping table for the second type of memory. The address mapping table for the first type of memory records the correspondence between the real physical addresses and virtual physical addresses of data written to the first type of memory by the computing device. The address mapping table for the second type of memory records the correspondence between the real physical addresses and virtual physical addresses of data migrated from the first type of memory to the second type of memory. The address mapping table for the second type of memory maintained by the CXL controller can be established when data is migrated from the first type of memory to the second type of memory.
[0194] For example, as shown in Table 5, Table 5 is an address mapping table of the first type of memory maintained by the CXL controller. The table records the correspondence between the virtual physical address of the storage space of the CXL storage device and the first real physical address. Table 5 includes: "virtual physical address" and "first real physical address".
[0195] Table 5
[0196] For example, as shown in Table 6, which is an address mapping table for the Type 2 memory maintained by the CXL controller, this table records the correspondence between virtual physical addresses and the physical addresses of the storage space of the Type 2 memory (the storage space of the CXL storage device). Table 6 includes "virtual physical address" and "second real physical address." The "virtual physical address" is the virtual physical address corresponding to the real physical address of the storage space of the CXL storage device before data is migrated from the Type 1 memory to the Type 2 memory.
[0197] Table 6
[0198] Table 5 and Table 6 are the address mapping tables of the first type of memory and the second type of memory maintained by the CXL controller, respectively. The storage space indicated by the real physical address corresponding to each virtual physical address in the table stores data.
[0199] After receiving a read request from the computing device, the CXL controller first searches the address mapping table of the first type of memory for the mapping address corresponding to the second address. If no mapping address corresponding to the second address is found, the CXL controller continues to search the address mapping table of the second type of memory for the mapping address corresponding to the second address.
[0200] For example, if the second address is DPA2 and the CXL controller does not find DPA2 in the address mapping table shown in Table 5, the CXL controller then continues to search the address mapping table shown in Table 6 and determines that the third mapping address corresponding to the second address DPA2 is A1. The CXL controller then determines that the storage space indicated by the second address is the second storage area A1 in the second type of memory.
[0201] It can be understood that the correspondence shown in Table 6 is established so that when the subsequent computing device needs to read the data migrated to the second type of memory, it can quickly locate the specific storage space of the data in the second type of memory through the virtual physical address shown in Table 6, thereby improving the efficiency of reading data and reducing waiting time.
[0202] In another embodiment, the CXL controller stores the correspondence between the virtual physical address and the first real address or the virtual physical address and the second real address in the same address mapping table.
[0203] For example, as shown in Table 7, Table 7 shows an address mapping table, which includes a correspondence between a "virtual physical address" and a "real physical address." The real physical address includes a first real physical address and a second real physical address.
[0204] Table 7
[0205] If the second address is DPA2, the CXL controller searches the address mapping table shown in Table 7 and finds that the third mapping address corresponding to DPA2 is A1. Since A1 is a physical address in the second memory, the CXL controller determines that the storage space indicated by the second address is the second storage area A1 in the second type of memory.
[0206] The aforementioned two address mapping tables, respectively storing the correspondence between the virtual physical address and the first real physical address, and the correspondence between the virtual physical address and the second real physical address, can more clearly manage the relationship between the virtual physical address and the real physical addresses of the two memories. In contrast, a single address mapping table simultaneously records the correspondence between the virtual physical address and the first real physical address, and the correspondence between the virtual physical address and the second real physical address, requiring only one table to be queried, reducing the number of operations and improving query efficiency.
[0207] S303: The CXL storage device sends the data in the first storage area to the computing device.
[0208] Specifically, the CXL controller of the CXL storage device sends data in the storage space indicated by the third mapping address to the computing device, where the storage space indicated by the third mapping address is the first storage area.
[0209] Exemplarily, as shown in Table 5, if the second address is DPA1 and the third mapping address corresponding to DPA1 is RDPA1, the CXL controller sends the data in the storage space indicated by RDPA1 to the computing device.
[0210] After S303 is completed, the process of the embodiment of the present application ends.
[0211] S304: The CXL storage device sends the data in the second storage area to the computing device.
[0212] Specifically, the CXL controller of the CXL storage device sends the data in the storage space indicated by the third mapping address to the computing device, where the storage space indicated by the third mapping address is the second storage area.
[0213] Illustratively, as shown in Table 6, if the second address is DPA2 and the third mapping address corresponding to DPA2 is A1, the CXL controller sends the data in the storage space indicated by A1 to the computing device.
[0214] Alternatively, the CXL controller may migrate data in the second storage area to the first type of storage before sending it to the computing device. Alternatively, the CXL controller may send the data in the second storage area to the computing device and simultaneously migrate the data in the second storage area to the first type of storage. Steps S305-S306 below describe the process of the CXL controller migrating data from the second storage area to the first type of storage.
[0215] S305 : The CXL controller determines whether the storage capacity of the available storage space of the first type of storage is less than the required storage capacity, where the required storage capacity is the storage capacity required to store the data in the second storage space.
[0216] If the storage capacity of the available storage space of the first type of memory is less than the required storage capacity, first execute S306 and then execute S307;
[0217] If the storage capacity of the available storage space of the first type of storage is greater than or equal to the required storage capacity, execute S307.
[0218] The available memory space is the unused memory space in the first type of memory.
[0219] In one embodiment, the CXL controller records usage of storage space of the first type of memory, including used and unused storage space, as well as the physical address and storage capacity of the used storage space and the physical address and storage capacity of the unused storage space. "Used" indicates that data is already stored in the storage space, while "unused" indicates that no data is stored in the storage space. Based on the recorded usage of the storage space of the first type of memory, the CXL controller determines whether the storage capacity of the unused (i.e., usable) storage space is less than the required storage capacity.
[0220] For example, as shown in Table 8, Table 8 shows the usage of the storage space of the first type of memory recorded by the CXL controller. Table 8 includes: "first real physical address", "storage capacity" and "usage status", where "storage capacity" is the storage capacity of the storage space corresponding to the "first real physical address" and "usage status" is the usage status of the storage space corresponding to the "first real physical address", and the usage status includes used and unused.
[0221] Table 8
[0222] As can be seen from Table 8, the total storage capacity of the first type of memory is 2GB, of which the storage capacity of the used storage space is 1GB + 512MB, and the storage capacity of the unused storage space is 512MB. If the required storage capacity is less than or equal to 512MB, the storage capacity of the available storage space of the first type of memory is determined to be greater than or equal to the required storage capacity. If the required storage capacity is greater than or equal to 512MB, the storage capacity of the available storage space of the first type of memory is determined to be less than the required storage capacity.
[0223] S306 : The CXL controller migrates the data in the fourth storage area of the first type of storage to the second type of storage, so that the capacity of the current available storage space of the first type of storage is greater than or equal to the required storage capacity.
[0224] The storage capacity of the currently available storage space is equal to the sum of the storage capacity of the fourth storage space and the storage capacity of the available storage space of the first type of memory.
[0225] In one embodiment, if the sum of the storage capacities of multiple storage spaces in the first-type memory and the available storage capacity is greater than or equal to the required storage capacity, the CXL controller may select any storage space as the fourth storage area, or may select a storage space with the lowest data access frequency, or a storage space with a data access frequency less than or equal to a frequency threshold, as the fourth storage area. The access frequency includes the frequency with which the computing device reads data, for example, once a day.
[0226] For example, if the length of the data in the second storage area is 700MB, as shown in Table 8, it can be seen from Table 8 that the storage capacity of the unused storage space RDPA3 in the first type of memory is 512MB, and the used storage space is the storage space indicated by RDPA1 and the storage space indicated by RDPA2, and the sum of the storage capacity of the two parts of the storage space and the storage capacity of the available storage space is greater than or equal to the required storage capacity. Therefore, the data in the storage space indicated by RDPA1 or the storage space indicated by RDPA2 can be migrated to the second type of memory.
[0227] Exemplarily, based on the above example, if the data in the storage space indicated by RDPA1 is accessed by the computing device once every other day, and the data in the storage space indicated by RDPA2 is accessed by the computing device once every week, then the storage space indicated by RDPA2 is considered to be the storage space with the lowest access frequency, and the storage space indicated by RDPA2 can be used as the fourth storage area.
[0228] In one embodiment, the CXL controller migrates data in the fourth storage area of the first type of memory to the fifth storage area of the second type of memory, and establishes a correspondence between a mapping address corresponding to the physical address of the fourth storage area (hereinafter referred to as the fourth mapping address) and the physical address of the fifth storage area.
[0229] The fourth mapping address is a partial address segment of a virtual physical address of a storage space of the CXL storage device reported by the CXL storage device to the computing device.
[0230] The fifth storage area is part of or all of the available storage space in the second type of memory.
[0231] Since the fourth storage area has previously stored the operating data of the computing device, the physical address of the fourth storage area also has a corresponding fourth mapping address in the address mapping table.
[0232] For example, as shown in Table 8, if the fourth storage area is the storage space indicated by RDPA1 in Table 8, then the fourth mapping address is DPA1 in Table 8. After the CXL controller migrates the data in the storage space indicated by RDPA1 to the storage space indicated by A3 of the second type of memory (the fifth storage area), it establishes a correspondence between the fourth mapping address DPA1 and the physical address A3 of the fifth storage area in the address mapping table shown in Table 6. Table 6 is correspondingly updated to Table 9.
[0233] Table 9
[0234] It can be understood that by establishing a correspondence between the fourth mapping address corresponding to the physical address of the fourth storage area and the physical address of the fifth storage area, when the subsequent computing device needs to read this part of the data, it can quickly find the address of the specific storage space of the data in the second type of memory through this correspondence, thereby improving the efficiency of reading data and reducing waiting time.
[0235] Optionally, the CXL controller updates the usage status of the storage space indicated by A3 in the second type of memory from “unused” to “used”.
[0236] Optionally, after migrating the data in the fourth storage area to the fifth storage area of the second type of memory, the CXL controller removes the correspondence between the physical address of the fourth storage area and the fourth mapped address. For example, the CXL controller deletes the correspondence between the physical address of the fourth storage area and the fourth mapped address in an address mapping table.
[0237] In another embodiment, the CXL controller stores the virtual physical address and the data migrated to the second memory together in the storage space of the second type of memory. When a subsequent computing device reads the data in the storage space indicated by the virtual physical address, it can find the data migrated to the second memory corresponding to the virtual physical address by traversing the virtual physical addresses stored in the storage space of the second type of memory.
[0238] It is understandable that after the CXL controller executes S306-S307, if the subsequent computing device still needs to use this part of data, it can directly read this part of data from the first type of memory, thereby improving the data reading speed. In addition, the CXL controller does not need to repeatedly execute S305-S307, which can save waiting time.
[0239] S307 : The CXL controller migrates the data in the second storage area to the third storage area of the first type of memory.
[0240] The third storage space is part or all of the currently available storage space of the first type of storage.
[0241] Optionally, the CXL controller stores a correspondence between the first address and the physical address of the third storage area in an address mapping table.
[0242] The CXL controller stores the correspondence between the first address and the physical address of the third storage area in the address mapping table. When the data of the storage space indicated by the first address is read again subsequently, the mapping address corresponding to the first address can be determined from the correspondence as the physical address of the third storage area, thereby improving data reading efficiency.
[0243] S308: The CXL storage device sends a read failure feedback message to the computing device.
[0244] Specifically, the CXL controller of the CXL storage device sends a read failure feedback message to the computing device.
[0245] For example, the CXL controller feeds back “0xff” or “0x00” to the computing device to indicate a read failure.
[0246] In the data reading method provided in the embodiments of this application, the real storage space provided by the CXL storage device for the computing device to quickly read data is the first type of memory, and the storage space provided by the second type of memory acts as virtual storage space to expand the storage space of the first type of memory. This method not only reduces the cost of the CXL storage device providing the computing device with fast data read storage space, but also provides the computing device with large-capacity storage space.
[0247] Traditionally, the server's operating system kernel includes a swap-in & swap-out mechanism that swaps data generated during application execution between local memory and storage devices, allowing for the storage of larger amounts of data within a smaller memory footprint. This method consumes the computing device's CPU power. However, the method proposed in this embodiment performs the entire data swap-in / swap-out process within the CXL storage device, reducing the computing device's CPU power, conserving computing resources, and improving data access efficiency.
[0248] Optionally, the embodiment shown in FIG. 9 or FIG. 10 may further include: when the storage capacity of the available storage space of the first type of memory is less than a preset threshold, the CXL controller migrates data in the fifth storage space of the first type of memory to the second type of memory, so that the storage capacity of the available storage space of the first type of memory is greater than or equal to the preset threshold.
[0249] In this optional method, the CXL controller may periodically detect the storage capacity of the available storage space of the first type of memory, or the CXL controller may trigger the detection of the storage capacity of the available storage space of the first type of memory when the computing device returns the allocated memory.
[0250] This optional method can ensure that the first type of memory always maintains sufficient storage space, avoid the situation where the storage space of the first type of memory is insufficient, reduce the waiting time when the computing device writes data, and improve data writing efficiency.
[0251] The above mainly introduces the solution provided by the embodiment of the present application from the perspective of method. In order to realize 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 herein, and the embodiments of the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional technical goals can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the embodiments of the present application.
[0252] The present invention also provides a CXL controller 200, such as the CXL controller 121 shown in Figure 1. Figure 11 is a schematic diagram of the structure of a CXL controller 200 provided in the present invention.
[0253] The CXL controller 200 includes: a receiving unit 201 for receiving a write request sent by a computing device; the write request is for requesting that first data be written to a CXL storage device; a processing unit 202 for migrating data from a first storage space of the first storage device to a second storage device, if the storage capacity of the available storage space of the first storage device is less than the required storage capacity, so that the capacity of the currently available storage space of the first storage device is greater than or equal to the required storage capacity, where the required storage capacity is the storage capacity required to store the first data, and the currently available storage space is the sum of the storage capacity of the first storage space and the storage capacity of the available storage space; and writing the first data to the second storage space, where the second storage space is part or all of the currently available storage space. For example, in conjunction with FIG. 9 , the receiving unit 201 may be implemented in S201 of the method embodiment, and the processing unit 202 may be implemented in S202-S205 of the method embodiment.
[0254] In one embodiment, a write request is used to request writing first data to a first address of a CXL storage device; the first address is a partial address segment of a virtual physical address of a storage space of the CXL storage device reported by the CXL storage device to the computing device; the data in the first storage space is migrated to a third storage space of the second type of memory; the processing unit 202 is further configured to store a correspondence between the first address and a physical address of the second storage space; and to store a correspondence between a first mapped address corresponding to the physical address of the first storage space and a physical address of the third storage space. For example, the processing unit 202 may be applied to steps S203-S205 of the method embodiment.
[0255] In one embodiment, the processing unit 202 is further configured to establish an address mapping table; the address mapping table is configured to record a correspondence between a virtual physical address of a storage space of the CXL storage device and a real physical address of a storage space of the first type of memory, or a correspondence between a virtual physical address of a storage space of the CXL storage device and a real physical address of a storage space of the second type of memory; the virtual physical address includes a first address and a first mapping address; the real physical address of the storage space of the first type of memory includes a physical address of the first storage space and a physical address of the second storage space; the real physical address of the storage space of the second type of memory includes a physical address of a third storage space; the correspondence between the first address and the physical address of the second storage space is stored in the address mapping table; or the correspondence between the first mapping address corresponding to the physical address of the first storage space and the physical address of the third storage space is stored in the address mapping table. For example, in conjunction with FIG8 , the receiving unit 201 may be applied to S101 in the method embodiment, and in conjunction with FIG9 , the processing unit 202 may be applied to S203-S205 in the method embodiment.
[0256] In one embodiment, the processing unit 202 is further configured to write the first data into the available storage space when the storage capacity of the available storage space of the first type of memory is greater than or equal to the required storage capacity. For example, in conjunction with FIG9 , the processing unit 202 can be applied to S203 in the method embodiment.
[0257] In one embodiment, a write request is used to request writing first data to a first address of a CXL storage device. Processing unit 202 is specifically configured to, upon determining that a corresponding second mapping address exists for the first address, write the first data to a storage space indicated by the second mapping address, where the storage space indicated by the second mapping address is part or all of the available storage space. Upon determining that a corresponding second mapping address does not exist for the first address, write the first data to a fourth storage space, where the fourth storage space is part or all of the available storage space. For example, processing unit 202 may be implemented in S203 of the method embodiment.
[0258] In one embodiment, the method further includes, when the storage capacity of the available storage space of the first type of memory is less than a preset threshold, migrating data of the fifth storage space of the first type of memory to the second type of memory, so that the storage capacity of the available storage space of the first type of memory is greater than or equal to the preset threshold.
[0259] The present invention also provides a CXL controller 300, such as the CXL controller 121 in Figure 1. Figure 12 is a schematic diagram of the structure of a CXL controller 300 provided in the present invention.
[0260] The CXL controller 300 includes a receiving unit 301 for receiving a read request sent by a computing device; the read request is for requesting to read data from a storage space indicated by a second address; the second address is a partial address segment of a virtual physical address of the storage space of the CXL storage device reported to the computing device by the CXL storage device; and a sending unit 302 for sending data in the first storage area to the computing device if the storage space indicated by the second address is a first storage area in a first-type memory; and for sending data in the second storage area to the computing device if the storage space indicated by the second address is a second storage area in a second-type memory. For example, with reference to FIG. 10 , the receiving unit 301 may be implemented in S301 of the method embodiment, and the sending unit 302 may be implemented in S304 of the method embodiment.
[0261] In one embodiment, CXL controller 300 further includes a processing unit 303 configured to, when the storage space indicated by the second address is a second storage area in the second type of memory, migrate data in the second storage area to a third storage area in the first type of memory. The third storage area is part or all of the currently available storage space in the first type of memory. The storage capacity of the currently available storage space is greater than or equal to the required storage capacity, which is the storage capacity required to store the data in the second storage area. For example, in conjunction with FIG. 10 , processing unit 303 may be implemented in S307 of the method embodiment.
[0262] In one embodiment, the processing unit 303 is further configured to, before migrating the data in the second storage area to the third storage area of the first type of storage, migrate the data in the fourth storage area of the first type of storage to the second type of storage when the storage capacity of the available storage space of the first type of storage is less than the required storage capacity, so that the capacity of the current available storage space of the first type of storage is greater than or equal to the required storage capacity; the storage capacity of the current available storage space is equal to the sum of the storage capacity of the fourth storage area and the storage capacity of the available storage space of the first type of storage. For example, in conjunction with FIG10 , the processing unit 303 can be applied to S306 in the method embodiment.
[0263] In one embodiment, the processing unit 303 is further configured to migrate the data in the fourth storage area to the fifth storage area of the second type of memory and store a correspondence between a mapping address corresponding to a physical address of the fourth storage area and a physical address of the fifth storage area. For example, the processing unit 303 may be applied to S306 in the method embodiment.
[0264] In one embodiment, the processing unit 303 is further configured to, after migrating the data in the second storage area to the third storage area of the first type of memory, store the correspondence between the second address and the physical address of the third storage area. For example, in conjunction with FIG10 , the processing unit 303 can be applied to S307 in the method embodiment.
[0265] Of course, the CXL controller 200 or the CXL controller 300 provided in the embodiments of the present application includes but is not limited to the above modules.
[0266] In actual implementation, the receiving unit 201 and the processing unit 202, or the receiving unit 301, the sending unit 302 and the processing unit 303 can be implemented by a processor calling a computer program code in a memory. The specific execution process can be referred to the description of the method part above and will not be repeated here.
[0267] Another embodiment of the present application provides a CXL controller comprising a processor coupled to a memory; the memory is configured to store computer program code, the computer program code comprising computer instructions. When the processor executes the computer instructions, the CXL controller performs the steps of the data access method described in the above method embodiment.
[0268] Another embodiment of the present application further provides a computer-readable storage medium storing computer instructions. When the computer instructions are executed on a CXL controller, the CXL controller executes each step of the data access method shown in the above method embodiment.
[0269] Another embodiment of the present application provides a system-on-a-chip (SoC) for use in a CXL controller. The SoC includes one or more interface circuits and one or more processors. The interface circuits and processors are interconnected via circuitry. The interface circuits are configured to receive signals from the CXL controller's memory and send signals to the processors. The signals include computer instructions stored in the memory. When the CXL controller processor executes the computer instructions, the CXL controller performs the steps described in the data access method flow in the aforementioned method embodiment.
[0270] In another embodiment of the present application, a computer program product is provided. The computer program product includes computer instructions. When the computer instructions are executed on a CXL controller, the CXL controller executes each step executed by the CXL controller in the data access method flow shown in the above method embodiment.
[0271] The above embodiments can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using a software program, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer-executable instructions are loaded and executed on a computer, the process or function according to the embodiments of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, a server, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., an SSD).
[0272] The above is only a specific embodiment of the present application. Those skilled in the art may conceive of changes or substitutions based on the specific embodiment provided in this application, and all such changes or substitutions shall fall within the scope of protection of this application.
Claims
1. A data access method, characterized in that: Applied to a computing interconnect protocol CXL storage device, the CXL storage device includes a first type of memory and a second type of memory, the first type of memory is a volatile storage unit, the second type of memory is a non-volatile storage unit, the CXL storage device is connected to at least one computing device, and the method includes: receiving a write request sent by the computing device; the write request is used to request to write first data into the CXL storage device; In the case where the storage capacity of the available storage space of the first type of storage is less than the required storage capacity, data in the first storage space of the first type of storage is migrated to the second type of storage, so that the capacity of the current available storage space of the first type of storage is greater than or equal to the required storage capacity, wherein the required storage capacity is the storage capacity required to store the first data, and the current available storage space is the sum of the storage capacity of the first storage space and the storage capacity of the available storage space; The first data is written into a second storage space; the second storage space is part or all of the storage space in the currently available storage space.
2. The method according to claim 1, characterized in that The write request is used to request to write the first data into a first address of the CXL storage device; the first address is a partial address segment of a virtual physical address of a storage space of the CXL storage device reported by the CXL storage device to the computing device; The data in the first storage space is migrated to the third storage space of the second type of memory; The method further comprises: storing a correspondence between the first address and the physical address of the second storage space; A correspondence between a first mapping address corresponding to the physical address of the first storage space and the physical address of the third storage space is stored.
3. The method according to claim 2, characterized in that The method further comprises: Establishing an address mapping table; the address mapping table is used to record the correspondence between the virtual physical address of the storage space of the CXL storage device and the real physical address of the storage space of the first type of storage, or the correspondence between the virtual physical address of the storage space of the CXL storage device and the real physical address of the storage space of the second type of storage; the virtual physical address includes the first address and the first mapping address; the real physical address of the storage space of the first type of storage includes the physical address of the first storage space and the physical address of the second storage space; the real physical address of the storage space of the second type of storage includes the physical address of the third storage space; storing a correspondence between the first address and the physical address of the second storage space in the address mapping table; The correspondence between the first mapping address corresponding to the physical address of the first storage space and the physical address of the third storage space is stored in the address mapping table.
4. The method according to claim 2 or 3, characterized in that: The write request is used to request to write the first data into a first address of the CXL storage device; the writing the first data into the available storage space includes: When it is determined that the first address has a corresponding second mapping address, writing the first data into the storage space indicated by the second mapping address; the storage space indicated by the second mapping address is part or all of the storage space in the available storage space; When it is determined that there is no corresponding second mapping address for the first address, the first data is written into a fourth storage space; the fourth storage space is a part or all of the available storage space.
5. The method according to any one of claims 1 to 4, characterized in that: The method also includes, when the storage capacity of the available storage space of the first type of storage is less than a preset threshold, migrating data of the fifth storage space of the first type of storage to the second type of storage, so that the storage capacity of the available storage space of the first type of storage is greater than or equal to the preset threshold.
6. A data access method, characterized in that: Applied to a computing interconnect protocol CXL storage device, the CXL storage device includes a first type of memory and a second type of memory, the first type of memory is a volatile storage unit, the second type of memory is a non-volatile storage unit, the CXL storage device is connected to at least one computing device, and the method includes: receiving a read request sent by the computing device; the read request is used to request to read data from a storage space indicated by a second address; the second address is a portion of a virtual physical address of a storage space of the CXL storage device reported by the CXL storage device to the computing device Address segment; In a case where the storage space indicated by the second address is a second storage area in the second type of memory, data in the second storage area is sent to the computing device.
7. The method according to claim 6, characterized in that The method further comprises: When the storage space indicated by the second address is the second storage area in the second type of memory, the data in the second storage area is migrated to the third storage area of the first type of memory; wherein the third storage area is part or all of the storage space of the currently available storage space of the first type of memory; the storage capacity of the currently available storage space is greater than or equal to the required storage capacity, and the required storage capacity is the storage capacity required to store the data in the second storage area.
8. The method according to claim 7, characterized in that After migrating the data in the second storage area to the third storage area of the first type of memory, the method further includes: The correspondence between the second address and the physical address of the third storage area is stored.
9. A computing interconnect protocol CXL storage device, characterized in that: The CXL storage device comprises a CXL controller, a first type of memory and a second type of memory; the first type of memory is a volatile storage unit; the second type of memory is a non-volatile storage unit; the first type of memory and the second type of memory are respectively used to store data of the computing device; the CXL controller is used to execute the method according to any one of claims 1 to 8.
10. A computing interconnect protocol CXL controller, characterized in that: The method comprises a processor coupled to a memory, wherein the memory is used to store programs or instructions. When the programs or instructions are executed by the processor, the CXL controller performs the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Data migration method and apparatus
CN107092443A
Memory access method and computer system
CN108804350A
Persistent memory virtualization method and system
CN110955488A
Storage system, memory management method and management node
CN114610232A
System and method for load balancing in heterogeneous memory system
CN115617503A