Data access method, CXL storage device and CXL controller
By combining volatile and nonvolatile memory in CXL storage devices to dynamically manage storage space, the problem of high cost of using CXL storage devices when expanding memory capacity is solved, and efficient storage space utilization and cost reduction are achieved.
Patent Information
- Application Number
- CN202311257482.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-26
- Publication Date
- 2025-03-28
AI Technical Summary
When existing CXL storage devices expand memory capacity, they need to configure a large number of memory sticks, resulting in increased usage costs.
A data access method is adopted to provide storage space with the first type of memory (volatile storage unit) and the second type of memory (nonvolatile storage unit). When the available storage space of the first type of memory is insufficient, the data is migrated to the second type of memory to ensure the adequacy of the storage space.
This method can improve the storage space capacity of the CXL storage device while ensuring the speed of writing data, and reduce the cost of use.
Smart Images

Figure CN119718165A_ABST
Abstract
Description
Technical Field
[0001] 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
[0002] With the development of technologies such as cloud computing, artificial intelligence, and high-performance computing, the computing power of processors continues to increase, and the number of processor cores is also increasing, which brings about an increase in the demand for memory resources. In order to meet the 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 that aims to provide an efficient, high-speed, and low-latency interface between processors (such as central processing units, CPUs) and dedicated accelerators and high-performance storage systems to meet the needs of resource sharing, memory pooling, and efficient computing scheduling.
[0003] Related art proposes a CXL storage device based on CXL, which can provide unlimited memory capacity, improve the single-core memory bandwidth of the server, and improve memory utilization as a shared memory of multiple servers. However, if the CXL storage device is used to expand the memory capacity, a large number of memory sticks (such as dual inline memory modules (DIMMs)) or DRAM particles need to be configured in the CXL storage device, which will increase the cost of using the CXL storage device. Summary of the invention
[0004] The 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.
[0005] In order to achieve the above technical objectives, the embodiments of the present application adopt the following technical solutions:
[0006] In a first aspect, an embodiment of the present application provides a data access method, which is applied to a CXL storage device, wherein the CXL storage device further includes a first type of memory and a second type of memory, wherein the first type of memory is a volatile storage unit, and the second type of memory is a non-volatile storage unit, and 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 to the CXL storage device; 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 first storage space 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, 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; writing the first data into the second storage space; the second storage space is part or all of the storage space in the currently available storage space.
[0007] 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 low cost, which can effectively reduce the cost of using the CXL storage device. In addition, 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 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 capacity of the storage space of the CXL storage device and reducing the cost of using the CXL storage device.
[0008] In a possible implementation method, a write request is used to request to write 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 of 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 a physical address of the third storage space.
[0009] 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 memory through the correspondence when reading the data again later, thereby improving the efficiency of reading data and reducing waiting time.
[0010] 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 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 the correspondence between the first address and the physical address of the second storage space in the address mapping table; 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.
[0011] It can be understood that the address mapping table is a way of recording the correspondence between the virtual physical address and the real physical address. The address mapping table can store, manage, update and query the correspondence between the virtual physical address and the real physical address.
[0012] 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.
[0013] 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.
[0014] In another possible implementation method, a write request is used to request to write first data to a first address of a CXL storage device; writing the first data to an 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 storage space in the available storage space; when it is determined that a 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 storage space in the available storage space.
[0015] It can be understood that the existence of a corresponding second mapping address for the first address indicates that the CXL controller has established a correspondence between the first address and the real physical address of a portion of the available storage space in advance, that is, a correspondence between the first address and the second mapping address. At this time, 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. The existence of a corresponding second mapping address for the first address indicates that the CXL controller has not pre-assigned a corresponding mapping address to the first address. At this time, the CXL controller can arbitrarily select a storage space (e.g., a fourth storage space) from the available storage space whose storage capacity meets the required storage capacity to store the first data. The above method can quickly determine the storage space indicated by the first address, and determine the specific location to which the first data is to be written.
[0016] 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.
[0017] 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.
[0018] 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.
[0019] 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.
[0020] 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, 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.
[0021] 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.
[0022] In a second aspect, an embodiment of the present application provides a data access method, which is applied to a 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 partial address segment in a virtual physical address of a storage space of the CXL storage device reported by the CXL storage device to the computing device; when 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; when 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.
[0023] It can be understood 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, so the CXL controller can provide the function of 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 capacity of the storage space of the CXL storage device and reduce the cost of using the CXL storage device.
[0024] In a 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.
[0025] 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.
[0026] 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.
[0027] 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 for data interaction with the computing device, 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.
[0028] 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.
[0029] 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 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.
[0030] 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 a physical address of the third storage area.
[0031] It can be understood that storing the correspondence between the second address and the physical address of the third storage area, that is, determining the storage space indicated by the second address, makes it easy to quickly locate the storage space indicated by the second address as the third storage area when reading data from the storage space indicated by the second address again.
[0032] In one possible implementation method, after receiving a read request sent by a computing device, the method also includes: determining a storage space indicated by a second address; when a first mapping address corresponding to the second address is a physical address of a 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 a physical address of a second storage area, the storage space indicated by the second address is the second storage area.
[0033] 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.
[0034] 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; the correspondence between the second address and the physical address of the third storage area is stored in the address mapping table; 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 in the address mapping table.
[0035] It can be understood that the address mapping table is a way of recording the correspondence between the virtual physical address and the real physical address. The address mapping table can store, manage, update and query the correspondence between the virtual physical address and the real physical address.
[0036] In another possible implementation method, the method further includes: sending a storage capacity of a device storage space and a virtual physical address of a storage space of a CXL storage device to a computing device, wherein the storage capacity is greater than a storage capacity of the first type of memory and is less than or equal to a sum of a storage capacity of the first type of memory and a storage capacity of the second type of memory.
[0037] 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.
[0038] 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.
[0039] 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.
[0040] In a fifth aspect, an embodiment of the present application provides a CXL controller, comprising a processor. The processor is coupled to a memory; the memory is used to store programs or instructions. When the program or instruction is executed by the processor, the CXL controller executes the data access method of the first aspect and any possible implementation thereof; or, when the program or instruction is executed by the processor, the CXL controller executes the data access method of the second aspect and any possible implementation thereof.
[0041] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, the computer-readable storage medium comprising computer instructions. When the computer instructions are executed on a CXL controller, the CXL controller is caused to execute the data access method of the first aspect and any possible implementation thereof; or when the computer instructions are executed on the CXL controller, the CXL controller is caused to execute the data access method of the second aspect and any possible implementation thereof.
[0042] In a seventh aspect, an embodiment of the present application provides a computer program product, the computer program product comprising computer instructions. When the computer instructions are executed on a CXL controller, the CXL controller is caused to execute the data access method of the first aspect and any possible implementation thereof; or when the computer instructions are executed on the CXL controller, the CXL controller is caused to execute the data access method of the second aspect and any possible implementation thereof.
[0043] For the specific description of the third to seventh aspects and their various implementations in the embodiments of the present application, reference may 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 may be made to the beneficial effect analysis in the first or second aspect and their various implementations, which will not be repeated here.
[0044] 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
[0045] Figure 1 A system architecture diagram provided for an embodiment of the present application;
[0046] Figure 2 A schematic diagram of the structure of a CXL storage device provided in an embodiment of the present application;
[0047] Figure 3 A schematic diagram of the structure of another CXL storage device provided in an embodiment of the present application;
[0048] Figure 4 A schematic diagram of the structure of another CXL storage device provided in an embodiment of the present application;
[0049] Figure 5 A schematic diagram of the structure of another CXL storage device provided in an embodiment of the present application;
[0050] Figure 6 A schematic diagram of the structure of another CXL storage device provided in an embodiment of the present application;
[0051] Figure 7 A schematic diagram of the structure of another CXL storage device provided in an embodiment of the present application;
[0052] Figure 8 A flowchart of a data access method provided in an embodiment of the present application;
[0053] Fig. 9 A flowchart of another data access method provided in an embodiment of the present application;
[0054] Fig.10 A flowchart of another data access method provided in an embodiment of the present application;
[0055] Fig.11 A schematic diagram of the structure of a CXL controller provided in an embodiment of the present application;
[0056] Fig.12 A schematic diagram of the structure of another CXL controller provided in an embodiment of the present application. DETAILED DESCRIPTION
[0057] In the following, the terms "first", "second", "third", etc. are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first", "second", or "third", etc. may explicitly or implicitly include one or more of the features.
[0058] In the description of the embodiments of the present application, unless otherwise specified, " / " means "or", for example, A / B can mean A or B. "And / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, "at least one" means one or more, and "a plurality" means two or more.
[0059] Related technologies propose a CXL storage device based on CXL, which can provide unlimited memory capacity, improve the single-core memory bandwidth of the server, and improve memory utilization as a shared memory of multiple servers. However, if the CXL storage device is used to expand the memory capacity, a large number of memory sticks (such as DIMM) or DRAM particles need to be configured in the CXL storage device. Since memory sticks are expensive, connecting a large number of memory sticks will increase the cost of using the CXL storage device.
[0060] 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 a first-class memory has sufficient available storage space; if the available storage space of the first-class memory is sufficient, the data carried by the write request is written into the available storage space of the first-class memory; if the available storage space of the first-class memory is insufficient, the data in the first-class memory is migrated to a second-class memory so that the available storage space of the first-class memory is sufficient; and then the data carried by the write request is written into the available storage space of the first-class memory after the data is migrated.
[0061] 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 low cost, which can effectively reduce the cost of using the CXL storage device. In addition, the first type of memory (i.e., volatile storage unit) directly interacts with the computing device, 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.
[0062] The implementation of the embodiments of the present application will be described in detail below with reference to the accompanying drawings.
[0063] Please refer to Figure 1 , which shows a computing system architecture diagram involved in the data access method provided in the embodiment of the present application. Figure 1 As shown, the computing system may include a computing device 110 and a CXL storage device 120 , and optionally, may further include a CXL connection device 130 .
[0064] 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 .
[0065] The computing device 110 is a computing device having data processing, logic operation and storage functions. In the embodiment of the present application, the computing device 110 writes data into the CXL storage device 120 by initiating a write request, or reads data from the CXL storage device 120 by initiating a read request.
[0066] Exemplarily, the computing device 110 may include computing devices such as a server, a tablet computer, a desktop computer, a laptop computer, a notebook computer, or a netbook. The server may be a rack server, a blade server, a tower server, or other different types of servers. The server may also be a graphics processing unit (GPU) server. The server may include one computing node or multiple computing nodes, each computing node including at least one CPU.
[0067] In the embodiment of the present application, there may be more than one computing device 110. When there are more than one computing device, each computing device 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.
[0068] The CXL storage device 120 is used to provide storage space for at least one computing device 110 , provide the computing device 110 with a physical address of the storage space, query available storage space, migrate data, etc. The CXL storage device 120 may include: a CXL controller 121 , a first type of memory 122 , and a second type of memory 123 .
[0069] The CXL controller 121 is used to directly or indirectly control the reading of data in the first type of memory 122 or the second type of memory 123, or write data to the first type of memory 122 or the second type of memory 123. Optionally, the CXL controller 121 controls the reading of data in the first type of memory 122 or the second type of memory 123 through a controller (e.g. Figure 7 Alternatively, the CXL controller 121 controls the first type of memory 122 through a controller (e.g. Figure 7 The second controller 125 in the controller is used to control the second type of memory 123.
[0070] Exemplarily, the CXL controller 121 is used to convert address information carried in a read / write data request sent by the computing device 110 into physical address information corresponding to the first type of memory 122 or the second type of memory 123 when the computing device 110 requests to read / write the CXL storage device 120 .
[0071] The CXL controller 121 is also called a CXL memory controller (CXL memory expander controller) or a CXL memory pooling (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).
[0072] The first type of memory 122 is a volatile storage unit that can provide storage space for fast reading / writing of data. In the embodiment of the present application, the first type of memory 122 is a storage unit in the CXL storage device that actually interacts with the computing device for data.
[0073] Exemplarily, 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).
[0074] The second type of memory 123 is a non-volatile storage unit that can provide a large storage space. In the embodiment of the present application, the second type of memory 123 is used as a backup storage space for the first type of memory 122 to expand the storage space of the CXL storage device. When the storage space of the first type of memory 122 is insufficient, the CXL controller 121 migrates the data of the first type of memory 122 to the storage space of the second type of memory 123.
[0075] Exemplarily, the second type of memory 123 may include one or more solid state disks (SSD), one or more storage devices with not and (NAND), and / or persistent memory (PMEM).
[0076] 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.
[0077] 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-class memory 122, among the storage spaces provided by the CXL storage device 120 for the computing device 110, the storage space provided by the first-class memory 122 can be regarded as real storage space, and the storage space provided by the second-class 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-class memory 122 and the second-class memory 123, and is greater than the storage capacity of the first-class memory 122.
[0078] For example, the storage capacity of the first type of storage 122 is 1T, and the storage capacity of the second type of storage 123 is 4T. If the storage capacity of the storage space provided by the CXL storage device for the computing device 110 is 3T, 1T of the storage space is real storage space, and the remaining 2T is virtual storage space, which is obtained by migrating data from the first type of storage 122 to the second type of storage 123.
[0079] The CXL connection device 130 can provide 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 through 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.
[0080] For example, when the CXL connection device 130 is independently provided, the CXL connection device 130 may be a CXL switch. When the CXL connection device 130 is integrated on the CXL storage device 120, the CXL connection device 130 may be a multi-head CXL memory expansion card. In addition to the expansion function, the CXL Switch also has a processor and a processing function, such as being able to manage the storage space in the CXL storage device 120.
[0081] 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. Figure 2 As shown, 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); Figure 3 As shown, the CXL storage device 120 includes: a CXL controller 121, DRAM particles (first type of memory 122) and NAND particles (second type of memory 123); Figure 4 As shown, the CXL storage device 120 includes: a CXL controller 121, DRAM particles (first type of memory 122) and SSD (second type of memory 123); Figure 5 As shown, the CXL storage device 120 includes: a CXL controller 121, a DIMM (a first type of memory 122) and a NAND particle (a second type of memory 123); Figure 6 As shown, the CXL storage device 120 includes: a CXL controller 121, a second controller 125, a DIMM (a first type of memory 122) and a NAND particle (a second type of memory 123); Figure 7 As shown, 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).
[0082] Optionally, the first controller 124 is a controller capable of controlling the first type of storage 122, and can write data into the first type of storage 122, 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 into the second type of storage 123, or read data from the second type of storage 123, or can automatically erase data in the second type of storage 123.
[0083] The first controller 124 and the second controller 125 can be integrated into the CXL controller 121 , or can be independently disposed outside the CXL controller 121 and connected to the CXL controller 121 .
[0084] 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 .
[0085] In the embodiment of the present application, the number of the computing device 110, the CXL storage device 120 and the CXL connection device 130 can be one or more respectively. When there are multiple CXL storage devices 120 and multiple CXL connection devices 130, the multiple CXL connection devices 130 can be connected, and the multiple CXL storage devices 120 are connected to provide the computing device 110 with storage space that can be infinitely expanded.
[0086] The following is an explanation of the data access method provided in the embodiment of the present application:
[0087] The present application embodiment provides a data access method applied to a CXL storage device (eg Figure 1 CXL storage device 120 in the CXL controller (eg Figure 1 The CXL controller 121 in the embodiment is executed, the CXL storage device is connected to at least one computing device, and the CXL storage device also includes a first type of memory (eg Figure 1 The first type of memory 122 in the example and the second type of memory (e.g. Figure 1 The second type of memory 123 in the CXL storage device is used to provide storage space for computing devices connected to the CXL storage device.
[0088] It can be understood that the data access method provided in the embodiment of the present application mainly includes the first aspect and / or the second aspect:
[0089] In the first aspect, the computing device writes data to the CXL storage device.
[0090] Second aspect: The computing device reads data from the CXL storage device.
[0091] Before executing the first aspect or the second aspect, the CXL storage device needs to perform an initialization operation and allocate storage space for the computing device. The following is the initialization process that the CXL storage device needs to perform before executing the first aspect or the second aspect. The initialization process only needs to be performed once after the CXL storage device is powered on. After performing it once, the first aspect and / or the second aspect can be performed multiple times in the future. Figure 8 As shown, the process specifically includes S101-S102.
[0092] S101: The CXL controller establishes an address mapping table.
[0093] 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 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 second type of storage. Hereinafter, the real physical address of the storage space of the first type of storage is referred to as the first real physical address, and the real physical address of the storage space of the second type of storage is referred to as the second real physical address.
[0094] The storage space provided by the CXL storage device for the computing device is the device storage space, which includes the storage space of the first type of memory and the storage space of the second type of memory, and the address corresponding to the device storage space is a virtual physical address. The storage capacity of the device storage space is less than or equal to the sum of the storage capacity of the first type of memory and the second type of memory, and is greater than the storage capacity of the first type of memory.
[0095] 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 storage space provided by the second type of memory can be regarded as a virtual storage space in the embodiment of the present application.
[0096] In one implementation, after the CXL storage device is powered on, the CXL controller evaluates the storage space of the first type of memory and the second type of memory, estimates the storage capacity of the device storage space that the first type of memory and the second type of memory can provide for the computing device, and then generates a corresponding virtual physical address based on the device storage space.
[0097] In another embodiment, a configuration file is provided in the CXL storage device, and 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.
[0098] Exemplarily, the device storage space configured for the computing device in the configuration file is 4 GB of storage space, and the CXL controller generates a corresponding virtual physical address of 0x0-0x100000000 for the 4 GB of device storage space.
[0099] In the method provided by the embodiment of the present application, since the first type of memory can provide fast reading and writing functions, the data interaction between the computing device and the CXL storage device is actually the data interaction with the first type of memory of the CXL storage device, and the second type of memory is used as a backup storage space for the first type of memory. When the storage space of the first type of memory is insufficient, data is exchanged between the first type of memory and the second type of memory. Since the storage capacity of the first type of memory is a fixed value, when the storage capacity of the device storage space provided by the CXL storage device for the computing device is larger, the storage space that the computing device can use is larger, the storage space of the second type of memory is larger, and the probability of data being exchanged from the first type of memory to the second type of memory is greater. When the storage capacity of the device storage space provided by the CXL storage device for the computing device is smaller, the probability of data being exchanged from the first type of memory to the second type of memory is smaller, and when the data is stored in the first type of memory, the reading and writing speed is higher, and the reading and writing performance of the CXL storage device is better. Therefore, in order to provide the computing device with the largest possible storage capacity and to strike a balance between 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 the embodiments of the present application do not limit this.
[0100] Optionally, the technician may set the storage capacity of the storage space that the CXL storage device in the configuration file can provide for the computing device through a human-computer interaction interface provided by any computing device.
[0101] In one embodiment, after the CXL storage device is powered on and initialized, the CXL controller may establish an address mapping table, and establish a correspondence between the virtual physical address and the first real physical address in advance, and store the correspondence in the address mapping table, wherein the storage space indicated by the virtual physical address with the correspondence has the same storage capacity as the storage space indicated by the real physical address.
[0102] 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 implementation, 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.
[0103] Exemplarily, as shown in Table 1, Table 1 is an address mapping table established by the CXL controller, and the address mapping table is used to store the correspondence between the virtual physical address and the real physical address. The following takes the correspondence between the virtual physical address and the first real physical address as an example for explanation. If the device storage space provided by the CXL storage device for the computing device is 4GB, and the storage capacity of the storage space corresponding to the first real physical address is 1GB, the CXL controller divides the device storage space into 16 sub-storage spaces according to the size of 256MB, and the virtual physical addresses corresponding to the 16 sub-storage spaces are DPA1-DPA16 respectively. The CXL controller divides the storage space of the first type of memory into 4 sub-storage spaces according to the size of 256MB, and the real physical addresses corresponding to the 4 sub-storage spaces are RDPA1-RDPA4 respectively. The CXL controller selects 3 virtual physical addresses from the virtual physical addresses of the above 16 sub-storage spaces, and selects 3 real physical addresses from the above 4 real physical addresses. The CXL controller establishes correspondence between the 3 virtual physical addresses and the 3 real physical addresses respectively, and records them in the address mapping table shown in Table 1. Table 1 includes a "virtual physical address" and a "first real physical address".
[0104] Table 1
[0105]
[0106] In addition to recording the correspondence between virtual physical addresses and real physical addresses, the above-mentioned address mapping table can 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, and some virtual physical addresses or real physical addresses do not have correspondence. The address mapping table shown in Table 1 is only a form of expression, and the application embodiment does not limit whether to pre-establish the correspondence between the real physical address and the virtual physical address, or whether to record the correspondence through the address mapping table shown in Table 1.
[0107] 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 subsequent computing device needs to write data to the CXL storage device or needs to 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.
[0108] In an embodiment of the present application, the CXL controller may establish two address mapping tables, which are respectively used to store 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. Alternatively, the CXL controller may establish an address mapping table, which may 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.
[0109] It should be noted that if the CXL controller establishes a blank address mapping table and does not record the correspondence between the virtual physical address and the real physical address in the table in advance, the address mapping table can be established after the CXL storage device is powered on, or when the CXL storage device writes the running data of the computing device for the first time, or when the computing device reads data from the CXL storage device for the first time, and the embodiment of the present 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 the data of the first type of storage is migrated to the second type of storage, and the present application does not limit this.
[0110] Since the CXL storage device can provide storage space for multiple computing devices, and the storage space used by each computing device is physically isolated, if the CXL storage device provides storage space for multiple computing devices, the CXL controller maintains the address mapping table of each computing device respectively, and the address mapping tables of each computing device do not affect each other.
[0111] S102: The CXL storage device sends the virtual physical address and storage capacity of the device storage space to the computing device.
[0112] 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.
[0113] The computing device is a computing device connected to the CXL storage device.
[0114] 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.
[0115] Exemplarily, the virtual physical address range received by the computing device is: 0x0-0x100000000, the storage capacity is 4G, 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~0x110000000.
[0116] The device file is the interface of the device driver, allowing the application to interact with the device through the standard input and output system calls. It can be understood that in the embodiment of the present application, the device file is the interface of the driver of the storage space in the CXL storage device, and the application can write data to the storage space corresponding to the device file through the device file, or read data in the storage space corresponding to the device file.
[0117] After the computing device mounts the device file to the specified directory, it can provide storage services for applications running in the operating system of the computing device, such as allocating storage space in the mounted device file to the application, or reclaiming storage space allocated to the application.
[0118] After the CXL storage device is initialized, the computing device starts the following first process based on the storage space provided by the CXL storage device. Please refer to Fig. 9 , is a flowchart of a data access method provided in an embodiment of the present application, and the method may include S201-S206.
[0119] 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.
[0120] 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.
[0121] 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.
[0122] 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.
[0123] 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 running data of the application eventually needs to be written to the CXL storage device. At this time, the logical address needs to be converted into a virtual physical address provided by the CXL storage device to the computing device. The address conversion process can be performed by the computing device or by the CXL controller, and this embodiment of the application does not limit this.
[0124] In one embodiment, an application needs to write data to a storage space corresponding to a first logical address, and the virtual physical address corresponding to the first logical address is a first address. If the address conversion process is performed by a computing device, the computing device converts the first logical address to the first address and 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 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.
[0125] In another embodiment, an application needs to write data to a storage space corresponding to a first logical address, and the virtual physical address corresponding to the first logical address is a first address. If the address conversion process is performed by the CXL controller, the computing device generates a write request including first data, a first logical address, and a length of the first data. The first data is the running data that the application needs to write to the first address. After receiving the write request, the CXL controller converts the first logical address to the first address, and the first address is a virtual physical address provided by the CXL storage device for the computing device.
[0126] 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.
[0127] If yes, execute S203; if no, execute S204.
[0128] The available memory space is the unused memory space in the first type of memory.
[0129] The required storage capacity is the storage capacity required to store the first data.
[0130] In one embodiment, the CXL controller records usage of the storage space of the first type of memory, the usage including used and unused, 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, wherein used means that the part of the storage space has stored data, and unused means that the part of the storage space has not stored data. 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.
[0131] Exemplarily, 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.
[0132] Table 2
[0133]
[0134] As can be seen from Table 2, the storage capacity of the first type of memory is 2GB in total, 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 storage capacity required for storing the first data (required storage capacity) is less than or equal to 512MB, it is determined that the storage capacity of the available storage space of the first type of memory is greater than or equal to the required storage capacity, and if the storage capacity required for storing the first data is greater than or equal to 512MB, it is determined that the storage capacity of the available storage space of the first type of memory is 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 part 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 there is a corresponding second mapping address for the first 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 mapping address is a partial address segment in the real physical address of the first type of memory. The first address has a corresponding second mapping address, which means 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 the available storage space, that is, the correspondence between the first address and the second mapping address, and recorded it in the address mapping table. At this time, the CXL controller can quickly determine the specific physical address of the storage space to which the first data is to be written through the second mapping address corresponding to the first address recorded in the address mapping table.
[0142] The first address does not have a corresponding second mapping address, which indicates that the CXL controller has not pre-allocated a corresponding mapping address for the first address. At this time, the CXL controller can arbitrarily select a storage space (such as the fourth storage space) whose storage capacity 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 100MB and the storage capacity of the available storage space is 512MB, the CXL controller may divide 100MB 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 the first data is stored in the available storage space, 412MB of available storage space remains in the available storage space. The CXL controller updates the usage of the storage space in Table 2 to Table 3.
[0146] Table 3
[0147]
[0148] After S203 is completed, S206 is executed.
[0149] S204: The CXL controller migrates 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.
[0150] 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.
[0151] In one embodiment, if the sum of the storage capacity of multiple storage spaces in the first type of memory and the storage capacity of the available storage space 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 at which the computing device reads data, for example, once a day.
[0152] Exemplarily, 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.
[0153] 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.
[0154] In the above process, if the data in the storage space with the lowest access frequency or the access frequency 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, thereby reducing resource waste.
[0155] In one implementation, the CXL controller migrates data in the first storage space of the first type of storage to the third storage space of the second type of storage, and the CXL controller 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.
[0156] 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.
[0157] The third storage space is part or all of the available storage space in the second type of storage.
[0158] 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.
[0159] 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.
[0160] In some embodiments, the CXL controller records in an address mapping table the correspondence between the virtual physical address of the storage space of the CXL storage device and the second-class real physical address. Optionally, the CXL controller also records the usage of the storage space of the second-class memory, wherein the virtual physical address recorded by the CXL controller in the address mapping table is the virtual physical address corresponding to the real physical address of the storage space of the first-class memory where the data is migrated from the first-class memory to the second-class memory before migration, for example, the first mapping address corresponding to the first storage space.
[0161] Exemplarily, an address mapping table is shown in Table 4, which records the correspondence between the virtual physical address of the storage space of the CXL storage device and the second real physical address, as well as the usage of the storage space of the second type of storage, and 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 storage where the data migrated from the first type of storage to the second type of storage 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", and the usage includes used or unused, and used indicates that the part of the storage space has stored data migrated from the first type of storage to the second type of storage. 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 the 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.
[0162] Table 4
[0163]
[0164] Optionally, after migrating the data in the first storage space to the third storage space of the second type of memory, the CXL controller cancels 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.
[0165] It can be understood that the corresponding relationship 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.
[0166] 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.
[0167] 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, the first mapping address can be found by traversing the data stored in the storage space of the second type of memory.
[0168] S205: The CXL controller writes the first data into a second storage space.
[0169] The second storage space is part or all of the storage space in the currently available storage space of the first type of storage.
[0170] 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.
[0171] 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.
[0172] 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.
[0173] Exemplarily, 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).
[0174] 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, and if the first address corresponds to multiple real physical addresses, it indicates that the first data is stored in multiple discontinuous storage spaces respectively.
[0175] S206: The CXL storage device sends feedback information indicating that the writing is successful to the computing device.
[0176] Specifically, the CXL controller of the CXL storage device sends feedback information indicating that the writing is successful to the computing device.
[0177] In the data writing method provided in the embodiment of the present application, the real storage space of the CXL storage device that provides the computing device with a fast data writing function is the first type of memory, and the storage space provided by the second type of memory is used as a virtual storage space to expand the storage space of the first type of memory. This method can not only ensure the reduction of the cost of the CXL storage device providing the computing device with a fast data writing storage space, but also provide a large-capacity storage space for the computing device.
[0178] 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 for the computing device. The embodiment of the present application does not limit the execution order of the second aspect and the first aspect.
[0179] Please refer to Fig.10 , which is a flowchart of another data access method provided in an embodiment of the present application, and the method may include S301-S308.
[0180] 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.
[0181] 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.
[0182] 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.
[0183] 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.
[0184] 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 data to be read by the application is finally stored in the CXL storage device. At this time, the logical address read by the application needs to be converted into a virtual physical address. The address conversion process can be performed by the computing device or by the CXL controller, and this embodiment of the application does not limit this.
[0185] In one embodiment, the application needs to read data in the storage space corresponding to the second logical address, and the virtual physical address corresponding to the second logical address is the second address. If the address conversion process is performed by the computing device, the computing device converts the second logical address into the second address and generates a read request including the second address and the data length. The data length indicates the length of the 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.
[0186] In another embodiment, the application needs to read data in the storage space corresponding to the second logical address, and the virtual physical address corresponding to the second logical address is the second address. If the address conversion process is performed by the CXL controller, the computing device generates a read request including the second logical address and the data length. The data length indicates the length of the data to be read starting from the second address. After receiving the read request, the CXL controller converts the second logical address into the second address.
[0187] S302: The CXL controller determines a storage space indicated by a second address.
[0188] In the case where the storage space indicated by the second address is the first storage area in the first type of memory, executing S303;
[0189] When the storage space indicated by the second address is the second storage area in the second type of memory, S304 is executed.
[0190] 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.
[0191] With respect to S302 , an embodiment of the present application proposes a specific method for determining a storage space indicated by a second address, including: a CXL controller determines a first mapping address corresponding to the second address.
[0192] The embodiments of this application are for Fig. 9 The first mapping address in the illustrated embodiment is distinguished, and the first mapping address corresponding to the second address is expressed as the third mapping address hereinafter.
[0193] 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;
[0194] 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.
[0195] In one embodiment, the CXL controller maintains an address mapping table of the first type of memory and an address mapping table of the second type of memory respectively. The address mapping table of the first type of memory records the correspondence between the real physical address and the virtual physical address of the data written by the computing device to the first type of memory, and the address mapping table of the second type of memory records the correspondence between the real physical address and the virtual physical address of the data migrated from the first type of memory to the second type of memory. The address mapping table of 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.
[0196] Exemplarily, as shown in Table 5, Table 5 is an address mapping table of the first type of memory maintained by the CXL controller, which 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".
[0197] Table 5
[0198] Virtual physical address First real physical address DPA1 RDPA1 DPA3 RDPA3
[0199] For example, as shown in Table 6, Table 6 is an address mapping table of the second type of memory maintained by the CXL controller, which records the correspondence between the virtual physical address and the physical address of the storage space of the second type of memory and the storage space of the CXL storage device. Table 6 includes: "virtual physical address" and "second real physical address". Among them, the "virtual physical address" is the virtual physical address corresponding to the real physical address of the storage space where the CXL storage device is located before migrating the data from the first type of memory to the second type of memory.
[0200] Table 6
[0201] Virtual physical address Second real physical address DPA2 A1 DPA10 A2
[0202] 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.
[0203] 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 a 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 a mapping address corresponding to the second address.
[0204] Exemplarily, if the second address is DPA2, the CXL controller does not find DPA2 in the address mapping table shown in Table 5. At this time, the CXL controller 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. Then, 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.
[0205] It can be understood that the corresponding relationship 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.
[0206] In another implementation, 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 a same address mapping table.
[0207] Exemplarily, 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.
[0208] Table 7
[0209] Virtual physical address Real physical address DPA1 RDPA1 DPA3 RDPA3 DPA2 A1 DPA10 A2
[0210] If the second address is DPA2, the CXL controller finds from the address mapping table shown in Table 7 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.
[0211] The above two address mapping tables are used to store 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, respectively, so that the relationship between the virtual physical address and the real physical addresses of the two memories can be managed more clearly. However, one 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, so only one table needs to be queried, which reduces the operation process and improves the query efficiency.
[0212] S303: The CXL storage device sends the data in the first storage area to the computing device.
[0213] 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 first storage area.
[0214] Exemplarily, as shown in Table 5, if the second address is DPA1, the third mapping address corresponding to DPA1 is RDPA1, and the CXL controller sends the data in the storage space indicated by RDPA1 to the computing device.
[0215] After S303 is completed, the process of the embodiment of the present application is completed.
[0216] S304: The CXL storage device sends the data in the second storage area to the computing device.
[0217] 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, and the storage space indicated by the third mapping address is the second storage area.
[0218] Exemplarily, 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.
[0219] Optionally, the CXL controller may migrate the data in the second storage area to the first type of storage before sending it to the computing device, or 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. S305-S306 below are the process of the CXL controller migrating the data in the second storage area to the first type of storage.
[0220] 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.
[0221] If the storage capacity of the available storage space of the first type of storage is less than the required storage capacity, first execute S306 and then execute S307;
[0222] 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.
[0223] The available memory space is the unused memory space in the first type of memory.
[0224] In one embodiment, the CXL controller records usage of the storage space of the first type of memory, the usage including used and unused, 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, wherein used means that the part of the storage space has stored data, and unused means that the part of the storage space has not stored data. 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.
[0225] Exemplarily, as shown in Table 8, Table 8 shows that the CXL controller records the usage of the storage space of the first type of memory. Table 8 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.
[0226] Table 8
[0227]
[0228] It can be seen from Table 8 that the storage capacity of the first type of memory is 2GB in total, 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, it is determined that the storage capacity of the available storage space of the first type of memory is greater than or equal to the required storage capacity; if the required storage capacity is greater than or equal to 512MB, it is determined that the storage capacity of the available storage space of the first type of memory is less than the required storage capacity.
[0229] 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.
[0230] 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.
[0231] In one embodiment, if the sum of the storage capacity of multiple storage spaces in the first type of memory and the storage capacity of the available storage space 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 at which the computing device reads data, for example, once a day.
[0232] Exemplarily, 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.
[0233] 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.
[0234] In one implementation, 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 the CXL controller 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.
[0235] The fourth mapping 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 the computing device.
[0236] The fifth storage area is part or all of the available storage space in the second type of storage.
[0237] 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.
[0238] Exemplarily, as shown in Table 8, if the fourth storage area is the storage space indicated by RDPA1 in Table 8, 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 (fifth storage area), a correspondence between the fourth mapping address DPA1 and the physical address A3 of the fifth storage area is established in the address mapping table shown in Table 6, and Table 6 is correspondingly updated to Table 9.
[0239] Table 9
[0240] Virtual physical address Second real physical address DPA2 A1 DPA10 A2 DPA1 A3
[0241] 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.
[0242] Optionally, the CXL controller updates the usage of the storage space indicated by A3 in the second type of storage from “unused” to “used”.
[0243] Optionally, after migrating the data in the fourth storage area to the fifth storage area of the second type memory, the CXL controller cancels the correspondence between the physical address of the fourth storage area and the fourth mapping address. For example, the CXL controller deletes the correspondence between the physical address of the fourth storage area and the fourth mapping address in the address mapping table.
[0244] 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.
[0245] It is understandable that after the CXL controller executes S306-S307, 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 to improve the data reading speed. In addition, the CXL controller does not need to repeatedly execute S305-S307, which can save waiting time.
[0246] S307: The CXL controller migrates the data in the second storage area to the third storage area of the first type of storage.
[0247] The third storage space is part or all of the currently available storage space of the first type of storage.
[0248] Optionally, the CXL controller stores a correspondence between the first address and the physical address of the third storage region in an address mapping table.
[0249] The CXL controller stores the correspondence between the first address and the physical address of the third storage area in the address mapping table. If 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.
[0250] S308: The CXL storage device sends a read failure feedback message to the computing device.
[0251] Specifically, the CXL controller of the CXL storage device sends a feedback message of read failure to the computing device.
[0252] Exemplarily, the CXL controller feeds back “0xff” or “0x00” to the computing device to indicate a read failure.
[0253] In the data reading method provided in the embodiment of the present application, the real storage space of the CXL storage device that provides the computing device with a fast data reading function is the first type of memory, and the storage space provided by the second memory is used as a virtual storage space to expand the storage space of the first type of memory. This method can not only ensure the reduction of the cost of the CXL storage device providing the computing device with a fast data reading storage space, but also provide a large-capacity storage space for the computing device.
[0254] In the traditional technology, the server's operating system kernel includes a swap-in & swap-out mechanism, which can swap in or out the data generated during the execution of the application between the local memory and the storage device, so as to store a large amount of data in a smaller memory space. This method requires the CPU computing power of the computing device. In the method proposed in the embodiment of the present application, the entire data swap-in / swap-out process is completed in the CXL storage device, which can reduce the computing power of the CPU of the computing device, save the computing resources of the computing device, and improve data access efficiency.
[0255] Optional, Fig. 9 or Fig.10 The illustrated embodiment may further include: when the storage capacity of the available storage space of the first type of storage is less than a preset threshold, the CXL controller migrates 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.
[0256] 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.
[0257] This optional 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.
[0258] The above mainly introduces the solution provided by the embodiment of the present application from the perspective of the method. In order to achieve the above functions, it includes hardware structures and / or software modules corresponding to the execution of each function. It should be easy to realize that the technical goals in this field are combined with the units and algorithm steps of each example described in the embodiments disclosed in this article, and the embodiments of the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical goals can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the embodiments of the present application.
[0259] The present application also provides a CXL controller 200, for example Figure 1 The CXL controller 121 is shown. Fig.11 , which is a schematic diagram of the structure of a CXL controller 200 provided in an embodiment of the present application.
[0260] The CXL controller 200 includes: a receiving unit 201, configured to receive a write request sent by a computing device; the write request is used to request to write first data into a CXL storage device; a processing unit 202, configured to migrate data in a first storage space of the first storage device to a second storage device when 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 current available storage space of the first storage device 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; and write the first data into the second storage space; the second storage space is part or all of the storage space in the current available storage space. For example, in combination with Fig. 9 The receiving unit 201 can be applied to S201 in the method embodiment, and the processing unit 202 can be applied to S202-S205 in the method embodiment.
[0261] In one implementation, the write request is used to request to write the first data to the first address of the CXL storage device; the first 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; the data in the first storage space is migrated to the third storage space of the second type of memory; the processing unit 202 is further used to store the correspondence between the first address and the physical address of the second storage space; and store 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. For example, the processing unit 202 can be applied to S203-S205 in the method embodiment.
[0262] In one embodiment, the processing unit 202 is further used to establish 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 a first address and a 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; 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 combination with Figure 8 The receiving unit 201 can be applied to S101 in the method embodiment, combined with Fig. 9 , the processing unit 202 can be applied to S203-S205 in the method embodiment.
[0263] In one implementation, 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 storage is greater than or equal to the required storage capacity. Fig. 9 , the processing unit 202 can be applied to S203 in the method embodiment.
[0264] In one implementation, the write request is used to request to write the first data to the first address of the CXL storage device; the processing unit 202 is specifically used to, when it is determined that the first address has a corresponding second mapping address, write the first data to 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 the first address does not have a corresponding second mapping address, write the first data to a fourth storage space; the fourth storage space is part or all of the storage space in the available storage space. For example, the processing unit 202 can be applied to S203 in the method embodiment.
[0265] In one embodiment, 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.
[0266] The present application embodiment also provides a CXL controller 300, for example Figure 1 The CXL controller 121 in FIG. Fig.12 , which is a schematic diagram of the structure of a CXL controller 300 provided in an embodiment of the present application.
[0267] The CXL controller 300 includes: a receiving unit 301, configured to receive a read request sent by a 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 partial address segment in a virtual physical address of a storage space of a CXL storage device reported by the CXL storage device to the computing device; a sending unit 302, configured to send data in the first storage area to the computing device when the storage space indicated by the second address is a first storage area in a first type of storage; and to send data in the second storage area to the computing device when the storage space indicated by the second address is a second storage area in a second type of storage. For example, in combination with Fig.10 The receiving unit 301 can be applied to S301 in the method embodiment, and the sending unit 302 can be applied to S304 in the method embodiment.
[0268] In one embodiment, the CXL controller 300 further includes a processing unit 303, which is configured to migrate data in the second storage area to a third storage area of the first type of memory when the storage space indicated by the second address is the second storage area in the second 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. For example, in combination Fig.10, the processing unit 303 can be applied to S307 in the method embodiment.
[0269] 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, when the storage capacity of the available storage space of the first type of storage is less than the required storage capacity, migrate 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; 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. Fig.10 , the processing unit 303 can be applied to S306 in the method embodiment.
[0270] In one implementation, 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 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. For example, the processing unit 303 can be applied to S306 in the method embodiment.
[0271] In one implementation, the processing unit 303 is further configured to store the correspondence between the second address and the physical address of the third storage area after migrating the data in the second storage area to the third storage area of the first type of memory. Fig.10 , the processing unit 303 can be applied to S307 in the method embodiment.
[0272] Of course, the CXL controller 200 or CXL controller 300 provided in the embodiment of the present application includes but is not limited to the above modules.
[0273] 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 the processor calling the computer program code in the memory. The specific execution process can be referred to the description of the above method part, which will not be repeated here.
[0274] Another embodiment of the present application further provides a CXL controller, comprising a processor. The processor is coupled to a memory; the memory is used to store computer program code, and the computer program code includes computer instructions. When the processor executes the computer instructions, the CXL controller executes each step of the data access method shown in the above method embodiment.
[0275] Another embodiment of the present application further provides a computer-readable storage medium storing computer instructions. When the computer instructions are executed on the 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.
[0276] Another embodiment of the present application also provides a chip system, which is applied to a CXL controller. The chip system includes one or more interface circuits and one or more processors. The interface circuit and the processor are interconnected through a line. The interface circuit is used to receive a signal from a memory of the CXL controller and send a signal to the processor, the signal including a computer instruction stored in the memory. When the CXL controller processor executes the computer instruction, the CXL controller executes each step performed by the CXL controller in the data access method flow shown in the above method embodiment.
[0277] 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.
[0278] The above embodiments may be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using a software program, the above embodiments may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer execution instructions are loaded and executed on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, a server or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more servers that can be integrated with the medium. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., an SSD), etc.
[0279] The above is only a specific implementation of the present application. Those skilled in the art may conceive of changes or substitutions based on the specific implementation provided by the present application, which should all be included in the protection scope of the present application.
Claims
1. A 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; and 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 partial address segment in a virtual physical address of a storage space of the CXL storage device reported by the CXL storage device to the computing device; 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
Cited By
Cross-host memory sharing method, system, equipment and medium
CN120371537A