CXL memory module, data storage method, controller, and medium

By receiving host instructions from the controller, a one-time write area is set in the CXL memory module and updated to read-only. This solves the problem of inflexible storage space management in the existing technology, realizes dynamic read-only area management, and improves the application flexibility of storage space.

WO2026242558A1PCT designated stage Publication Date: 2026-11-26BEIJING SUPERSTRING ACAD OF MEMORY TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2026/080864
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2025-05-21
Filing Date
2026-03-02
Publication Date
2026-11-26

AI Technical Summary

Technical Problem

When storing read-only data, the CXL memory module has low flexibility in storage space management and application, and existing technologies make it difficult to dynamically set read-only areas.

Method used

The controller receives the host's area setting instruction, sets the memory area to a one-time write area, and updates it to read-only after the data is written. It determines the read-only attribute by monitoring the write status or time period, and supports dynamic read-only area management.

Benefits of technology

It enables dynamic setting of read-only regions in CXL memory modules, providing flexible read-only region management functions and the timing for triggering read-only attribute settings, thereby improving the flexibility of storage space management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2026080864_26112026_PF_FP_ABST
    Figure CN2026080864_26112026_PF_FP_ABST
Patent Text Reader

Abstract

A CXL memory module, a data storage method, a controller, and a medium, relating to the technical field of data storage. The CXL memory module comprises a controller (110) and a memory (120), wherein the controller (110) is configured for: receiving a region configuration command sent by a host, and configuring, according to the region configuration command, a corresponding region in the memory (120) as a write-once region; according to a data write command for the write-once region sent by the host, writing data to the write-once region, and, once data writing is completed, updating a read-write attribute of the write-once region from read-write to read-only; and receiving a release command for the write-once region sent by the host, and releasing the write-once region.
Need to check novelty before this filing date? Find Prior Art

Description

CXL memory modules, data storage methods, controllers and media

[0001] This application claims priority to Chinese Patent Application No. 202510662819.2, filed on May 21, 2025, entitled "CXL Memory Module, Data Storage Method, Controller and Medium", the contents of which are to be understood as incorporated herein by reference. Technical Field

[0002] This disclosure relates to, but is not limited to, the field of data access technology, and particularly to a CXL memory module, data storage method, controller, and medium. Background Technology

[0003] According to the current CXL (Compute Express Link) protocol, CXL memory modules typically use static configuration or designate a portion (usually a large area) of memory as read-only during the initialization phase, and then report the address range of the read-only area to the host. When storing read-only data, users write the read-only data into the pre-defined read-only area. Therefore, CXL memory modules offer relatively low flexibility in storage space management and application. Summary of the Invention

[0004] The following is an overview of the subject matter described in detail herein. This overview is not intended to limit the scope of the claims.

[0005] In a first aspect, embodiments of this disclosure provide a CXL memory module, including a controller and memory, wherein the controller is configured to: receive a region setting instruction sent by a host, set a corresponding region in the memory as a one-time write region according to the region setting instruction; write data to the one-time write region according to a write data instruction sent by the host for the one-time write region, and update the read / write attribute of the one-time write region from read-write to read-only after the data writing is completed; and receive a release instruction sent by the host for the one-time write region and release the one-time write region.

[0006] Secondly, this disclosure provides a data storage method applied to the CXL memory module in the above embodiments. The method includes: receiving a region setting instruction sent by a host, setting a corresponding region in the memory as a one-time write region according to the region setting instruction; writing data to the one-time write region according to a write data instruction sent by the host for the one-time write region, and updating the read / write attribute of the one-time write region from read-write to read-only after the data writing is completed; and receiving a release instruction sent by the host for the one-time write region to release the one-time write region.

[0007] Thirdly, this disclosure provides a controller applied to the CXL memory module in the above embodiments, wherein the controller's processor is configured to execute the data storage method in the above embodiments.

[0008] Fourthly, this disclosure provides a non-transient computer storage medium, which stores a computer program that, when executed by a processor, implements the data storage method described in the above embodiments.

[0009] After reading and understanding the accompanying diagrams and detailed descriptions, other aspects can be understood.

[0010] Overview of the attached figures

[0011] The accompanying drawings are used to provide an understanding of the technical solutions of this disclosure and form part of the specification. They are used together with the embodiments of this disclosure to explain the technical solutions of this disclosure and do not constitute a limitation on the technical solutions of this disclosure.

[0012] Figure 1 is a schematic diagram of the structure of an embodiment of the CXL memory module disclosed herein;

[0013] Figure 2 is a structural schematic diagram of another embodiment of the CXL memory module disclosed herein;

[0014] Figure 3 is a schematic diagram of instruction interaction in one embodiment of the CXL memory module of this disclosure;

[0015] Figure 4 is a flowchart illustrating an embodiment of the data storage method of this disclosure;

[0016] Figure 5 is a schematic diagram of the data replacement process in one embodiment of the data storage method of this disclosure;

[0017] Figure 6 is a schematic diagram of the process of performing hash calculation on the physical address of a device in one embodiment of the data storage method of this disclosure;

[0018] Figure 7 is a schematic diagram of the process for determining the target region in one embodiment of the data storage method of this disclosure;

[0019] Figure 8 is a schematic diagram of the structure of an embodiment of the controller disclosed herein.

[0020] Detailed Explanation

[0021] The embodiments of this disclosure will be described in detail below with reference to the accompanying drawings. Unless otherwise specified, the embodiments and features described herein can be combined arbitrarily.

[0022] The embodiments disclosed herein are not necessarily limited to the dimensions shown in the drawings, and the shapes and sizes of the components in the drawings do not reflect actual proportions. Furthermore, the drawings schematically illustrate ideal examples, and the embodiments of this disclosure are not limited to the shapes or values ​​shown in the drawings.

[0023] The ordinal numbers such as "first" and "second" in this disclosure are used to avoid confusion among the constituent elements and do not indicate any order, quantity, or importance.

[0024] This disclosure describes several embodiments, but these descriptions are exemplary and not restrictive, and many more embodiments and implementations are possible within the scope of the embodiments described herein, which will be apparent to those skilled in the art. Although many possible combinations of features are shown in the drawings and discussed in the detailed description, many other combinations of the disclosed features are also possible. Unless specifically limited, any feature or element of any embodiment may be used in combination with or in lieu of any other feature or element in any other embodiment.

[0025] This disclosure includes and contemplates combinations of features and elements known to those skilled in the art. The embodiments, features, and elements disclosed in this disclosure may also be combined with any conventional features or elements to form the scheme defined by the claims. Any feature or element of any embodiment may also be combined with features or elements from other disclosed schemes to form another scheme defined by the claims. Therefore, it should be understood that any feature shown and discussed in this disclosure may be implemented individually or in any suitable combination. Therefore, the embodiments are not limited except by the limitations imposed by the appended claims and their equivalents. Furthermore, various modifications and changes may be made within the scope of the appended claims.

[0026] Furthermore, in describing representative embodiments, the specification may have presented methods and processes as a specific sequence of steps. However, the method or process should not be limited to the specific order of steps described in this disclosure to the extent that it does not depend on such a specific order. As will be understood by those skilled in the art, other sequences of steps are also possible. Therefore, the specific order of steps set forth in the specification should not be construed as a limitation of the claims. Moreover, the claims concerning the method and process should not be limited to performing the steps in the written order, and those skilled in the art will readily understand that these orders can be varied and still remain within the spirit and scope of the embodiments of this disclosure.

[0027] In the description of this disclosure, unless otherwise stated, "multiple" means two or more.

[0028] This disclosure provides a CXL memory module, as shown in FIG1. ​​The CXL memory module may include a controller 110 and the memory 120 managed by it.

[0029] CXL is developed based on PCIe 5.0 and runs on top of the PCIe physical layer. Based on the characteristics of memory access, CXL is divided into three sub-protocols: CXL.io, CXL.mem, and CXL.cache. Correspondingly, CXL devices (also called CXL memory modules) are divided into three types: Type 1 CXL device, Type 2 CXL device, and Type 3 CXL device. Type 2 and Type 3 devices can have multiple memory modules, which can be of types such as DDR (Double Data Rate) and HBM (High Bandwidth Memory). Taking Type 2 devices as an example, Type 2 devices can be accelerator cards (such as GPUs) in real-world applications. The host provides data, and the accelerator card handles the computation. The HDM model allows the host to directly manage and control the storage space on the Type 2 device, dynamically allocating and configuring device memory according to application needs, and directly performing read and write operations. CXL Type 3 devices can provide hosts with large-capacity DRAM (Dynamic Random Access Memory) and can also support persistent media (i.e., non-volatile media, such as flash memory chips).

[0030] As an example, the CXL memory module can be a type 2 CXL device or a type 3 CXL device. The controller 110, also known as a CXL controller, can be equipped with a CXL interface based on the CXL protocol, allowing the host CPU to interact with the controller 110 via the CXL interface. For example, based on the CXL.io protocol, the host CPU can send instructions to the controller 110; based on the CXL.mem protocol, the host CPU can read data from memory 120 and write external data to memory 120. The control chip 110 also has a memory controller (as shown in the figure, a DDR controller) to manage memory 120. As shown in Figure 1, the controller 110 can also be equipped with dedicated hardware, such as an MCU (Memory Controller Unit), an Access Hardware Unit (Access Hardware Unit), and MMIO (Memory Mapped I / O). The MCU is used for interrupt handling and managing the list of allowed access areas of the host, such as allocating and releasing areas and setting attributes. The Access Hardware Unit can receive read and write commands from the host and is responsible for converting the host physical address in the command to the device physical address. The MMIO can realize the command interaction between the host and the controller 110 through the registers set in the CXL memory module.

[0031] In this article, physical addresses (such as host physical addresses and device physical addresses) are typically represented by a starting address and an address length.

[0032] Memory 120 can be, for example, a DRAM chip or a flash memory (NAND) chip.

[0033] In this embodiment, the controller 110 is configured to: receive a region setting instruction sent by the host, set the corresponding region in memory as a one-time write region according to the region setting instruction; write data to the one-time write region according to a write data instruction sent by the host for the one-time write region, and update the read / write attribute of the one-time write region from read-write to read-only after the data writing is completed; and receive a release instruction sent by the host for the one-time write region and release the one-time write region.

[0034] As an example, the host and the CXL memory module can be connected via a PCIe interface. The host can transmit a locale setting command to the CXL memory module via the MMIO interface. This locale setting command can carry the address information of a region in memory 120, such as the starting device physical address and length. The controller 110 can determine the region in memory 120 based on this address information, set the region as a one-time write region, and then send the execution result back to the host via MMIO. Here, the one-time write region can include one or more regions (Extents) that the host is allowed to access.

[0035] Subsequently, the host can write data to the one-time write area based on the CXL.mem protocol. The controller 110 can use the Access HW Unit to monitor the data writing status. When the data writing is completed, the controller updates the read / write attribute of the one-time write area from read / write to read-only. In this way, the CXL memory module can dynamically set a read-only area in the storage space of memory 120 according to the host instruction, and use the data writing status as the trigger for the read-only attribute. As an example, the Access HW Unit can send an interrupt through the MCU to update the attribute of the one-time write area after determining that the data writing is complete; or, the Access HW Unit can change the attribute of the one-time write area to read-only on its own.

[0036] In some optional implementations of this embodiment, the controller can write data to the one-time write area in the following manner: sequentially write data to the one-time write area. During the writing process, the controller can use the Access HW Unit to monitor the position of the write pointer. When the write pointer reaches the end of the one-time write area, it is determined that the data writing is complete.

[0037] In this embodiment, data is written to the one-time write area in a sequential writing manner. When the write pointer reaches the end of the one-time write area, it can be determined that the data writing is complete. No additional interface or command is required, making it easier to trigger the read-only attribute of the one-time write area.

[0038] In some alternative implementations of this embodiment, the controller can write data to the one-time write area in the following manner: sequentially write data to the one-time write area, and determine that the data writing is complete if no new data is written within a preset time period after the data is written to the one-time write area.

[0039] As an example, controller 110 can set a timer for the one-time write region via a time control unit. Each time controller 110 writes data to the one-time write region, the access HW unit can reset the timer and stop it when new data is written, in order to calculate the time interval between two data writes. If no new data is written within a preset time period after the initial data write, controller 110 can determine that the data write is complete. Here, the preset time period can be pre-set according to the performance of the CXL memory module. The time control unit can send an interrupt via the MCU so that the MCU can update the attributes of the one-time write region.

[0040] In this implementation, the writing status of data can be easily and accurately determined by monitoring the time when data is written.

[0041] In a specific example of this embodiment, the host can be configured with an Application Programming Interface (API) that can be called by the application (APP) layer. Applications running on the host can generate region setting and release instructions via the API. For example, the API may contain the following information: the address allocation length of the region, the length of a preset time period (i.e., the time interval between when a one-time write region becomes read-only and the last data write), the returned virtual address space pointer (this value can be obtained by the host operating system through physical address translation), the address information of the one-time write region to be released (e.g., the starting virtual address), etc. The host CPU sends the region setting and release instructions to the CXL memory module, thereby dynamically allocating read-only regions in the memory of the CXL memory module for different applications.

[0042] In this embodiment, the controller can set a specified area as a one-time write area according to the area setting instruction sent by the host, and update the read / write attribute of the one-time write area from read-write to read-only after the data writing is completed. It can also release the one-time write area according to the release instruction sent by the host, thereby realizing the dynamic setting of the read-only area in the CXL memory module. This can provide flexible read-only area management functions and triggering timing of read-only attribute setting for different users and applications.

[0043] Figure 2 shows a schematic diagram of an embodiment of the CXL memory module of this disclosure. As shown in Figure 2, the CXL memory module may include a controller 210 and a memory 220. The memory 220 may include a first storage chip 221 and a second storage chip 222, wherein the first storage chip 221 is a DRAM chip and the second storage chip 222 is a ZNS (Zoned Namespace) chip; the one-time write area is located in the first storage chip.

[0044] In this embodiment, the first storage chip 221 can provide the CXL memory module with faster read and write speeds, while the second storage chip 222 can provide the CXL memory module with larger storage space. Setting the one-time write area within the first storage chip can improve the read and write speed of this area. Furthermore, using a ZNS chip as the second storage chip allows the CXL memory module to support sequential writing of large blocks of data, and also allows for control of ZNS garbage collection within the CXL module. This enables the CXL module to control ZNS garbage collection as expected, contributing to improved overall performance of the CXL memory module.

[0045] In some optional embodiments of this example, the controller 210 is further configured to: count the number of accesses to each region in the first storage chip 221 within a preset time window; when the utilization rate of the first storage chip 221 reaches a preset threshold, determine the region to be swapped out in the first storage chip 221 based on the number of accesses; determine a free region in the free resources of the second storage chip 222 that matches the region to be swapped out; replace the data in the region to be swapped out with the free region, and record the address correspondence between the region to be swapped out and the free region.

[0046] In this embodiment, the utilization rate can be the proportion of the stored data in the total storage space of the first storage chip 221. The preset threshold can be set according to the performance parameters of the first storage chip 221. When the utilization rate reaches the preset threshold, in order to avoid affecting the read and write performance of the first storage chip 221, some data in the first storage chip 221 can be swapped to the second storage chip. The free area matching the area to be swapped out is usually the same size as the area to be swapped out or slightly larger than the area to be swapped out.

[0047] As an example, controller 210 may use LFU (Least Frequently Used) or LRU (Least Recently Used) to select the area to be swapped out in order to replace it with the second memory chip 222.

[0048] Here, the second storage chip 222 is a ZNS chip that does not support overwrite. In order to avoid frequently resetting the ZNS chip's zone, a free area of ​​the same size can be determined in the free area of ​​the second storage chip 222 according to the size of the area to be swapped out. Then, the data in the area to be swapped out can be swapped into the free area to reduce the time spent on data swapping and the wear and tear on the lifespan of the ZNS chip.

[0049] In this embodiment, the controller can monitor the utilization rate of the first memory chip and, when the utilization rate reaches a preset threshold, replace some of the data in the first memory chip with data in the second memory chip to avoid reducing the performance of the first memory chip.

[0050] Figure 3 shows a schematic diagram of instruction interaction between the host and the CXL memory module in one embodiment of the CXL memory module of this disclosure. In the embodiment shown in Figure 3, the host and the CXL memory module can be connected through a PCIe interface. The storage space of the CXL memory module includes a control address space 310 for transmitting instructions (i.e., Ctrl Addr Spa in Figure 3) and a physical address space 320 for storing data (i.e., Host Phy Addr Spa in Figure 3). The one-time write area is located in the physical address space 320.

[0051] The host can access the physical address space 320 based on the CXL.mem protocol and access the registers in the control address space 310 based on the CXL.io protocol. For example, the attribute information of the one-time write region carried in the region setting instruction (as shown in Figure 3, RO Att Set) can be directly written into the registers in the control address space 310.

[0052] The controller (not shown) can obtain the attribute information of the one-time write region carried by the locale setting instruction from the control address space 310, thereby receiving the locale setting instruction sent by the host. The attribute information includes the address information of the one-time write region. For example, the address information may include information such as the starting host physical address and address length of the one-time write region.

[0053] In some optional implementations of this embodiment, the attribute information may also include at least one of the following: the duration of the preset time period and the initialized write pointer.

[0054] In this embodiment, the preset time period can represent the time interval between when the one-time write area becomes read-only and the last data write. The controller can monitor the data writing status according to the duration of the preset time period and / or the initialized write pointer, so as to update the read / write attribute of the one-time write area to read-only after the data writing is completed.

[0055] In a specific example, the application in the host (i.e., APP in Figure 3) can call the region configuration interface (i.e., OTW_Allocator in Figure 3) to configure the one-time write region that the application needs to use. This can include, for example, the size of the one-time write region, virtual address, etc. Then, the host operating system (OS in Figure 3) determines the attribute information of the one-time write region and generates a region setting instruction. Afterward, the host CPU can transmit the region setting instruction to the CXL memory module based on the CXL.io protocol, write the attribute information of the one-time write region to the registers in the control address space 310, so that the controller can obtain the attribute information of the one-time write region from the registers and determine the attributes of the one-time write region based on this attribute information.

[0056] In this embodiment, the memory storage space can be divided into a control address space and a physical address space, which are used for instruction transmission and data storage respectively, thus helping to improve the response speed and data storage efficiency of the CXL memory module.

[0057] In some optional implementations of this embodiment, the controller may also use the control address space to feed back the execution result (payload) of the instruction to the host. For example, it may include storing the execution result of the release instruction into the control address space to feed back the release result to the host; and storing the execution result of the locale setting instruction into the control address space to feed back the locale setting result to the host.

[0058] Typically, the controller of the CXL memory module can proactively feed back the execution results of instructions to the host via interrupts. However, when the execution time of the CXL memory module is less than the interrupt receiving and processing time, or when the amount of data of the execution results to be fed back is large, this feedback method requires a long response time.

[0059] To address this issue, the CXL memory module in this embodiment can write the execution results that need to be fed back into the control address space. The host can obtain feedback by polling the control address space, which can shorten the time consumed by instruction feedback.

[0060] In an optional example of this implementation, the controller of the CXL memory module can select the corresponding feedback method as needed to improve the response speed of the CXL memory module.

[0061] For example, when the CXL memory module takes a long time to execute instructions, it can use an interrupt to provide feedback; or, it can combine interrupts and control address space for feedback. For instance, when the execution result that needs to be fed back is large, the controller of the CXL memory module can send an interrupt to notify the host to complete the task and write the execution result into the control address space, so that the host can then obtain the execution result from the specific control address space.

[0062] In some embodiments, the controller may set a one-time write region by converting the host physical address carried in the region setting instruction into a device physical address and determining a target region in memory that matches the device physical address; determining the target region as a one-time write region and setting the attributes of the target region, including the length of a preset time period and an initial write pointer.

[0063] In this embodiment, the controller can obtain the starting host physical address and address length of the one-time write region from the control address space, and then convert the host physical address into the device physical address (for example, through Access HW Unit) to determine the target region, and obtain the length of the preset time period and the initial write pointer corresponding to the target region, so that the controller can monitor the data writing status through time or write pointer, and determine the timing of updating the attributes of the one-time write region.

[0064] In some optional implementations of this embodiment, the controller is further configured to: perform a hash calculation on the device physical address corresponding to each region in memory to obtain a hash value corresponding to each region in memory, and store the correspondence between each region in memory and the hash value in a hash list so as to find the region corresponding to the device physical address according to the hash list.

[0065] In this embodiment, the controller can determine the correspondence between each region (Extent) in memory and the physical address of the device through hash operation, so that the controller can determine the corresponding region based on the converted physical address of the device, which can improve the efficiency of address comparison.

[0066] In some embodiments, the controller may perform hash calculation on the device physical address corresponding to each region in memory in the following manner: divide each region in memory into multiple sub-regions of a preset size, and perform hash calculation on the starting device physical address of each sub-region to obtain a hash value corresponding to each sub-region; insert the hash value corresponding to each sub-region into the corresponding hash queue, and store the storage address of index information and metadata of the region in each inserted node. The index information includes the starting device physical address and length of the region, and the metadata includes the write pointer and timer of the region. The timer is used to represent a preset time period.

[0067] As an example, regions can be divided into sections at the granularity of huge pages, with each sub-region containing one or more huge pages.

[0068] Because regions vary in size, different regions may be mapped to the same hash queue after hash calculation. Each hash queue can include one or more hash values, such as one or more hash values ​​belonging to the same interval, or one or more hash values ​​obtained using the same discrete function. In this case, by comparing the address information carried in the locale setting instruction with the index information in the node, it can be determined whether the node corresponds to the locale setting instruction.

[0069] In this embodiment, the hash list may include multiple hash queues. The controller can divide each region into multiple sub-regions. Then, it performs a hash operation on the starting device physical address of each sub-region and inserts the resulting hash values ​​into the corresponding hash queues. Each inserted node stores the storage address of the metadata of that region (the region to which the sub-region belongs). This allows the controller to retrieve the corresponding node in the hash queue based on the device physical address of any sub-region written to in one go, and then obtain the corresponding write pointer and timer based on the storage address in that node. This enables the controller to determine the region corresponding to the device physical address more quickly and accurately.

[0070] In some optional implementations of this embodiment, the controller can determine the target region corresponding to the device physical address in the following manner: convert the host physical address carried in the region setting instruction into a device physical address; normalize the converted initial device physical address; mask the normalized device physical address according to the size of the sub-region to obtain multiple masked addresses, each masked address corresponding to multiple sub-regions; perform hash calculation on each masked address to determine the hash value corresponding to each masked address; search the hash list based on the obtained hash values ​​to determine the node corresponding to each masked address in the hash list, and compare the converted initial device physical address with the index information stored in that node; determine the target region based on the metadata stored in the node where the converted initial device physical address matches the index information.

[0071] As an example, the normalized device physical address can be masked by setting a mask value (i.e., address bits) based on the amount of data in a large page or a power of two of the large page data. For instance, different fields of the device physical address can be masked to obtain multiple masked addresses. When multiple nodes are obtained by retrieving the hash queue based on multiple hash values, it can be determined whether the node corresponds to the locale setting instruction by comparing the converted starting device physical address with the index information. Then, the storage address of the metadata stored in one or more nodes with matching comparison results is obtained, and the target region is determined accordingly.

[0072] In this embodiment, after converting the host physical address carried in the regional setting instruction into a device physical address, the starting device physical address can be masked according to the size of the sub-region, resulting in multiple masked device physical addresses. Then, a hash calculation is performed on the masked device physical addresses, and a hash list is retrieved based on the calculated hash value. The nodes in the hash queue corresponding to the masked device physical addresses are then filtered based on the converted starting device physical address and index information to determine the node corresponding to the regional setting value. Finally, the metadata of the target region stored in that node is obtained, and the target region can be determined based on the device physical address in the metadata. This helps improve the efficiency of address comparison.

[0073] As shown in Figure 4, this disclosure also provides a data storage method applied to the CXL memory module in any of the above embodiments. The method includes the following steps.

[0074] Step 410: Receive the locale setting instruction sent by the host, and set the corresponding locale in memory as a one-time write locale according to the locale setting instruction.

[0075] Step 420: Write data to the one-time write area according to the write data instruction sent by the host for the one-time write area, and update the read / write attribute of the one-time write area from read-write to read-only after the data writing is completed.

[0076] In some optional implementations of this embodiment, data can be written to the one-time write area in the following manner: data is written sequentially to the one-time write area, and when the write pointer reaches the end of the one-time write area, it is determined that the data writing is complete.

[0077] In this embodiment, data is written to the one-time write area in a sequential writing manner. When the write pointer reaches the end of the one-time write area, it can be determined that the data writing is complete. No additional interface or command is required, making it easier to trigger the read-only attribute of the one-time write area.

[0078] In some alternative implementations of this embodiment, data can be written to the one-time write area in the following manner: data is written sequentially to the one-time write area, and if no new data is written within a preset time period after the data is written to the one-time write area, the data writing is determined to be complete.

[0079] In this implementation, the writing status of data can be easily and accurately determined by monitoring the time when data is written.

[0080] Step 430: Receive the release command sent by the host for the one-time write area and release the one-time write area.

[0081] In this embodiment, the controller can set a specified area as a one-time write area according to the area setting instruction sent by the host, and update the read / write attribute of the one-time write area from read-write to read-only after the data writing is completed. It can also release the one-time write area according to the release instruction sent by the host, thereby realizing the dynamic setting of the read-only area in the CXL memory module. This can provide flexible read-only area management functions and triggering timing of read-only attribute setting for different users and applications.

[0082] In some optional embodiments of this example, the memory includes a control address space for transmitting instructions and a physical address space for storing data, wherein the one-time write region is located in the physical address space. Step 410 can receive the locale setting instruction sent by the host in the following manner: obtain the attribute information of the one-time write region carried by the locale setting instruction from the control address space, the attribute information including the address information of the one-time write region.

[0083] In this embodiment, the memory storage space can be divided into a control address space and a physical address space, which are used for instruction transmission and data storage respectively, thus helping to improve the response speed and data storage efficiency of the CXL memory module.

[0084] In an optional example of this implementation, the attribute information may further include at least one of the following: the duration of the preset time period and the initialized write pointer.

[0085] In some optional embodiments of this example, the embodiment shown in FIG4 may further include the following steps.

[0086] Step 440: Store the execution result of the release instruction into the control address space to send the release result back to the host.

[0087] Step 450: Store the execution result of the locale setting instruction into the control address space to report the locale setting result to the host.

[0088] In this embodiment, the CXL memory module can write the execution results that need to be fed back into the control address space. The host can obtain the feedback by polling the control address space, which can shorten the time for instruction feedback.

[0089] In some embodiments, the memory includes a first memory chip and a second memory chip, wherein the first memory chip is a DRAM chip and the second memory chip is a ZNS chip; a one-time write area is located in the first memory chip.

[0090] In this embodiment, the first storage chip provides faster read and write speeds for the CXL memory module, while the second storage chip provides a larger storage space. Setting the one-time write area within the first storage chip improves the read and write speed of this area. Furthermore, using a ZNS chip as the second storage chip allows the CXL memory module to support sequential writing of large blocks of data, and also enables control of ZNS garbage collection within the CXL module. This allows the CXL module to control ZNS garbage collection as expected, contributing to improved overall performance of the CXL memory module.

[0091] In some optional embodiments of this example, the data storage method of this disclosure may further include the process shown in FIG5. As shown in FIG5, the process may include the following steps.

[0092] Step 510: Count the number of times each region in the first memory chip is accessed within a preset time window.

[0093] Step 520: When the utilization rate of the first memory chip reaches a preset threshold, determine the area to be replaced in the first memory chip based on the number of accesses.

[0094] Step 530: Determine a free area in the free resources of the second memory chip that matches the area to be swapped out.

[0095] Step 540: Replace the data in the area to be swapped out with the free area, and record the address correspondence between the area to be swapped out and the free area.

[0096] In this embodiment, the controller can monitor the utilization rate of the first memory chip and, when the utilization rate reaches a preset threshold, replace some of the data in the first memory chip with data in the second memory chip to avoid reducing the performance of the first memory chip.

[0097] In some embodiments, step 410 above can set the corresponding region in memory as a one-time write region in the following way: convert the host physical address carried in the region setting instruction to a device physical address, and determine the target region in memory that matches the device physical address; determine the target region as a one-time write region, and set the attributes of the target region, including: the length of the preset time period and the initialization write pointer.

[0098] In this embodiment, the controller can obtain the starting host physical address and address length of the one-time write region from the control address space, and then convert the host physical address into the device physical address to determine the target region. The controller can also set the length of the preset time period corresponding to the target region and initialize the write pointer so that the controller can monitor the data writing status through time or write pointer and determine the timing of updating the attributes of the one-time write region.

[0099] In some optional embodiments of this example, the data storage method may further include: performing a hash calculation on the device physical address corresponding to each region in memory to obtain a hash value corresponding to each region in memory, and storing the correspondence between each region in memory and the hash value in a hash list so as to find the region corresponding to the device physical address according to the hash list.

[0100] In this embodiment, the controller can determine the correspondence between each region (Extent) in memory and the physical address of the device through hash operation, so that the controller can determine the corresponding region based on the converted physical address of the device, which can improve the efficiency of address comparison.

[0101] In an optional example of this implementation, the device physical address corresponding to each region in memory can be hashed using the process shown in Figure 6. As shown in Figure 6, the process may include the following steps.

[0102] Step 610: Divide each region in memory into multiple sub-regions of a preset size, and perform hash calculation on the starting device physical address of each sub-region to obtain the hash value corresponding to each sub-region.

[0103] In this embodiment, the hash list includes multiple hash queues.

[0104] Step 620: Insert the hash value corresponding to each sub-region into the corresponding hash queue, and store the index information and the storage address of metadata in each inserted node.

[0105] The index information includes the physical address and length of the starting device for the region, and the metadata includes the write pointer and timer for the region. The timer is used to represent a preset time period.

[0106] In this embodiment, the controller can divide each region into multiple sub-regions. Then, it performs a hash operation on the starting device physical address of each sub-region and inserts the resulting hash values ​​into corresponding hash queues. Each inserted node stores the storage address of the region's metadata. This allows the controller to retrieve the corresponding node in the hash queue based on the device physical address of any sub-region within the region, and then obtain the corresponding write pointer and timer based on the storage address in that node. This enables a faster and more accurate determination of the region corresponding to the device physical address.

[0107] Based on the example shown in Figure 6, the host physical address carried in the locale setting instruction can be converted into a device physical address through the process shown in Figure 7, and a target region matching the device physical address can be determined in memory. As shown in Figure 7, the process may include the following steps.

[0108] Step 710: Convert the host physical address carried in the region setting instruction to a device physical address, normalize the converted starting device physical address, and mask the normalized device physical address according to the size of the sub-region to obtain multiple masked addresses.

[0109] Each address behind a mask corresponds to multiple sub-regions.

[0110] Step 720: Perform a hash calculation on the address behind each mask to determine the hash value corresponding to each address behind the mask.

[0111] Step 730: Based on the multiple hash values ​​obtained, retrieve the hash list, determine the node corresponding to each masked address in the hash list, and compare the converted starting device physical address with the index information stored in that node.

[0112] Step 740: Determine the target region based on the metadata stored in the node whose physical address matches the index information obtained from the conversion.

[0113] In the embodiment shown in Figure 7, after converting the host physical address carried in the region setting instruction into a device physical address, the initial device physical address can be masked according to the size of the sub-region, resulting in multiple masked device physical addresses. Then, a hash calculation is performed on the masked device physical addresses, and a hash list is retrieved based on the calculated hash value. The nodes in the hash queue corresponding to the masked device physical addresses are then filtered based on the converted initial device physical address and index information to determine the node corresponding to the region setting value. Finally, the metadata of the target region stored in that node is obtained, and the target region can be determined based on the device physical address in the metadata. This helps improve the efficiency of address comparison.

[0114] As shown in Figure 8, this disclosure also provides a controller applied to a CXL memory module, wherein the controller's processor is configured to execute the data storage method in any of the above embodiments.

[0115] The controller may include a processor 810, an interface 820 for connecting to a host, a storage interface 830 for connecting to memory, and other hardware 840. The processor 810 is configured to execute the data storage method in any embodiment of this disclosure.

[0116] The processor in this embodiment can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), a microprocessor, etc., or other conventional processors. The processor can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), an off-the-shelf programmable gate array (FPGA), discrete logic or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or combinations of the above devices. That is, the processor in this embodiment can be any processing device or combination of devices that implements the methods, steps, and logic block diagrams disclosed in the embodiments of this invention. If the embodiments of this disclosure are implemented in part in software, then instructions for software can be stored in a suitable non-volatile computer-readable storage medium, and one or more processors can be used to execute the instructions in hardware to implement the methods of the embodiments of this disclosure.

[0117] This disclosure also provides a non-transient computer storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the data processing method or task processing method described above.

[0118] It will be understood by those skilled in the art that all or some of the steps, systems, or apparatuses disclosed above, and their functional modules / units, can be implemented as software, firmware, hardware, or suitable combinations thereof. In hardware implementations, the division between functional modules / units mentioned above does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed collaboratively by several physical components. Some or all components may be implemented as software executed by a processor, such as a digital signal processor or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit (ASIC). Such software may be distributed on a computer-readable medium, which may include computer storage media (or non-transitory media) and communication media (or transient media). As is known to those skilled in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tape, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and can be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.

Claims

1. A CXL memory module, comprising a controller and memory, wherein, The controller is configured to: receive a region setting instruction sent by the host, set the corresponding region in the memory as a one-time write region according to the region setting instruction; write data to the one-time write region according to a write data instruction sent by the host for the one-time write region, and update the read / write attribute of the one-time write region from read-write to read-only after the data writing is completed; and receive a release instruction sent by the host for the one-time write region and release the one-time write region.

2. The CXL memory module of claim 1, wherein, The controller writes data to the one-time write area by sequentially writing data to the one-time write area, and when the write pointer reaches the end of the one-time write area, it determines that the data writing is complete.

3. The CXL memory module of claim 1, wherein, The controller writes data to the one-time write area by: sequentially writing data to the one-time write area, and determining that the data writing is complete if no new data is written within a preset time period after the data is written to the one-time write area.

4. The CXL memory module of claim 1, wherein, The memory includes a control address space for transmitting instructions and a physical address space for storing data, and the one-time write area is located in the physical address space; The controller receives a locale setting instruction sent by the host, including: obtaining attribute information of the one-time write region carried by the locale setting instruction from the control address space, wherein the attribute information includes the address information of the one-time write region.

5. The CXL memory module of claim 4, wherein, The attribute information also includes at least one of the following: the duration of the preset time period and the initialized write pointer.

6. The CXL memory module of claim 4, wherein, The controller is further configured to: store the execution result of the release instruction into the control address space to feed back the release result to the host; and store the execution result of the locale setting instruction into the control address space to feed back the locale setting result to the host.

7. The CXL memory module of claim 1, wherein, The memory includes a first storage chip and a second storage chip, wherein the first storage chip is a DRAM chip and the second storage chip is a ZNS chip; the one-time write area is located in the first storage chip.

8. The CXL memory module of claim 7, wherein, The controller is also configured to: Count the number of times each region in the first memory chip is accessed within a preset time window; When the utilization rate of the first memory chip reaches a preset threshold, the area to be replaced in the first memory chip is determined based on the number of accesses. A free region matching the region to be swapped out is determined from the free resources of the second memory chip; The data in the region to be swapped out is replaced in the free region, and the address correspondence between the region to be swapped out and the free region is recorded.

9. The CXL memory module of claim 5, wherein, The controller sets the corresponding region in the memory as a one-time write region according to the region setting instruction, including: The host physical address carried in the region setting instruction is converted into a device physical address, and a target region matching the device physical address is determined in the memory; The target area is determined as the one-time write area, and the attributes of the target area are set, including at least one of the following: the length of the preset time period and the initial write pointer.

10. The CXL memory module of claim 9, wherein, The controller is also configured to: A hash calculation is performed on the physical address of the device corresponding to each region in the memory to obtain a hash value for each region in the memory. The correspondence between each region in the memory and the hash value is stored in a hash list so that the region corresponding to the physical address of the device can be found according to the hash list.

11. The CXL memory module of claim 10, wherein, The hash list includes multiple hash queues; The controller performs a hash calculation on the physical device address corresponding to each region in the memory, including: dividing each region in the memory into multiple sub-regions of a preset size, and performing a hash calculation on the starting physical device address of each sub-region to obtain a hash value corresponding to each sub-region; inserting the hash value corresponding to each sub-region into a corresponding hash queue, and storing the storage address of index information and metadata in each inserted node, wherein the index information is the starting physical device address and length of the region to which the sub-region belongs, and the metadata includes a write pointer and a timer for that region, wherein the timer is used to characterize the preset time period.

12. The CXL memory module of claim 11, wherein, The controller translates the host physical address carried in the region setting instruction into a device physical address, and determines a target region in the memory that matches the device physical address, including: The host physical address carried in the region setting instruction is converted into a device physical address. The converted starting device physical address is normalized. The normalized device physical address is masked according to the size of the sub-region to obtain multiple masked addresses. Each masked address corresponds to multiple sub-regions. Perform a hash calculation on each address behind the mask to determine the hash value corresponding to each address behind the mask; Based on the obtained hash values, the hash list is retrieved to determine the node corresponding to each masked address in the hash list, and the converted starting device physical address is compared with the index information stored in that node. The target region is determined based on the metadata stored in the node whose starting device physical address matches the index information obtained from the conversion.

13. A data storage method applied to a CXL memory module according to any one of claims 1 to 12, the CXL memory module comprising a controller and memory, the method comprising: Receive a region setting instruction sent by the host, and set the corresponding region in the memory as a one-time write region according to the region setting instruction; According to the write data instruction sent by the host for the one-time write area, write data to the one-time write area, and after the data writing is completed, update the read and write attributes of the one-time write area from read-write to read-only; as well as, The host sends a release command for the one-time write area, and the one-time write area is released.

14. The method of claim 13, wherein, The process of writing data to the one-time write area includes: Data is written sequentially to the one-time write area. When the write pointer reaches the end of the one-time write area, the data writing is determined to be complete.

15. The method of claim 13, wherein, The process of writing data to the one-time write area includes: Data is sequentially written to the one-time write area. If no new data is written within a preset time period after the data is written to the one-time write area, the data writing is determined to be complete.

16. The method of claim 13, wherein, The memory includes a control address space for transmitting instructions and a physical address space for storing data, and the one-time write area is located in the physical address space; The receiving host sends a locale setting instruction, which includes: obtaining attribute information of the one-time write region carried by the locale setting instruction from the control address space, wherein the attribute information includes the address information of the one-time write region.

17. The method of claim 16, wherein, The attribute information also includes at least one of the following: the duration of the preset time period and the initialized write pointer.

18. The method of claim 16, further comprising: The execution result of the release instruction is stored in the control address space to send the release result back to the host; In addition, the execution result of the locale setting instruction is stored in the control address space to feed back the locale setting result to the host.

19. The method of claim 13, wherein, The memory includes a first storage chip and a second storage chip, wherein the first storage chip is a DRAM chip and the second storage chip is a ZNS chip; the one-time write area is located in the first storage chip.

20. The method of claim 19, further comprising: Count the number of times each region in the first memory chip is accessed within a preset time window; When the utilization rate of the first memory chip reaches a preset threshold, the area to be replaced in the first memory chip is determined based on the number of accesses. A free region matching the region to be swapped out is determined from the free resources of the second memory chip; The data in the region to be swapped out is replaced in the free region, and the address correspondence between the region to be swapped out and the free region is recorded.

21. The method of claim 17, wherein, Setting the corresponding region in memory as a one-time write region according to the region setting instruction includes: The host physical address carried in the region setting instruction is converted into a device physical address, and a target region matching the device physical address is determined in the memory; The target area is determined as the one-time write area, and the attributes of the target area are set, including the length of the preset time period and the initial write pointer.

22. The method of claim 21, further comprising: A hash calculation is performed on the physical address of the device corresponding to each region in the memory to obtain a hash value for each region in the memory. The correspondence between each region in the memory and the hash value is stored in a hash list so that the region corresponding to the physical address of the device can be found according to the hash list.

23. The method of claim 22, wherein, The hash list includes multiple hash queues; The step of hashing the physical device address corresponding to each region in the memory includes: dividing each region in the memory into multiple sub-regions of a preset size, and hashing the starting physical device address of each sub-region to obtain a hash value corresponding to each sub-region; inserting the hash value corresponding to each sub-region into a corresponding hash queue, and storing the storage address of index information and metadata in each inserted node, wherein the index information is the starting physical device address and length of the region to which the sub-region belongs, and the metadata includes a write pointer and a timer for that region, wherein the timer is used to characterize the preset time period.

24. The method of claim 23, wherein, The step of converting the host physical address carried in the region setting instruction into a device physical address and determining the target region in the memory that matches the device physical address includes: The host physical address carried in the region setting instruction is converted into a device physical address. The converted starting device physical address is normalized. The normalized device physical address is masked according to the size of the sub-region to obtain multiple masked addresses. Each masked address corresponds to multiple sub-regions. Perform a hash calculation on each address behind the mask to determine the hash value corresponding to each address behind the mask; Based on the multiple hash values ​​obtained, the hash list is retrieved to determine the node corresponding to each masked address in the hash list, and the converted starting device physical address is compared with the index information stored in that node. The target region is determined based on the metadata stored in the node whose starting device physical address matches the index information obtained from the conversion.

25. A controller for use with a CXL memory module, wherein, The processor of the controller is configured to perform the data storage method according to any one of claims 13 to 24.

26. A non-transitory computer storage medium storing a computer program, wherein, When the computer program is executed by a processor, it implements the data storage method according to any one of claims 13 to 24.