Memory block recovery method and device

The media controller recycles and manages memory blocks in NVDIMM, which solves the problem of limited write times of NVM chips, achieves wear leveling and performance improvement of memory blocks, and extends the service life of NVDIMM.

CN113760185BActive Publication Date: 2024-09-24HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110856426.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2017-11-07
Publication Date
2024-09-24
Estimated Expiration
2037-11-07

AI Technical Summary

Technical Problem

The NVM chip has a limited number of writes, which causes uneven wear of memory blocks and affects the service life of NVDIMM. It is difficult to effectively manage the recycling and wear leveling of memory blocks with existing technology.

Method used

The media controller receives the release command sent by the memory controller, reclaims the memory block according to the memory logical address information, converts it into a usable memory block, deletes the mapping relationship between the memory logical address and the physical address, and adds it to the memory free list. Improve wear leveling effect.

Benefits of technology

Improves the storage performance and service life of NVDIMM, enhances wear balancing between memory blocks, extends the service life of NVDIMM, and improves the efficiency of memory management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113760185B
    Figure CN113760185B
Patent Text Reader

Abstract

A memory block recovery method and device, the method comprising: a media controller receives a release command sent by a memory controller, the release command includes memory logical address information of a memory block to be recovered (S201); the media controller recovers the memory block according to the memory logical address information; wherein the recovered memory block is an available memory block (S202). After receiving the release command sent by the memory controller, the media controller releases the corresponding memory block according to the memory logical address information of the memory block to be recovered included in the release command, recovers the memory block, improves the media management operation effect of the media controller, thereby improving the storage performance of NVDIMM and extending the life of NVDIMM.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to computer technology, and in particular to a memory block recovery method and device. Background Art

[0002] A non-volatile dual in-line memory module (NVDIMM) is a random access memory (RAM) of a computer. An NVDIMM may include multiple non-volatile memory (NVM) chips. NVDIMM can save complete memory data even when the system is completely powered off. It is understandable that the NVM chip on the NVDIMM may specifically be a non-volatile random access memory (NVRAM). The NVM on the NVDIMM may include phase change memory (PCM), resistive random access memory (RRAM), magnetic random access memory (MRAM), spin-transfer torque MRAM (STT MRAM), and the like. NVDIMM uses the NVDIMM-P protocol to communicate with the memory controller. The NVDIMM-P protocol is a bus access protocol compatible with the double data rate (DDR) protocol.

[0003] However, compared with dynamic random access memory (DRAM), NVM has poor fatigue resistance and a limited number of writes. Therefore, when some memory blocks in the NVM chip reach the maximum number of writes, the NVM chip will become unusable, which will affect the service life of the entire NVDIMM. In order to avoid uneven write times of different memory blocks in the NVM chip, improve the effect of wear leveling, and extend the service life of the NVDIMM, memory management of the NVDIMM is required. Summary of the invention

[0004] The embodiments of the present application provide a memory block recovery method and device, which can increase the recovery speed of memory blocks and improve the wear leveling effect.

[0005] In a first aspect, an embodiment of the present application provides a memory block recovery method, the method being applied to a computer system, the computer system comprising a memory controller, a media controller, and a non-volatile memory connected to the media controller, the memory controller communicating with the media controller through an NVDIMM-P protocol, the non-volatile memory comprising a plurality of memory blocks, the method comprising:

[0006] The media controller receives a release command sent by the memory controller, wherein the release command includes memory logical address information of a memory block to be reclaimed; the media controller reclaims the memory block according to the memory logical address information; wherein the reclaimed memory block is an available memory block.

[0007] After receiving the release command sent by the memory controller, the above-mentioned media controller releases the corresponding memory block according to the memory logical address information of the memory block to be reclaimed included in the release command, and reclaims the memory block, thereby improving the media management operation effect of the media controller, thereby improving the storage performance of NVDIMM and extending the life of NVDIMM.

[0008] In a possible implementation manner, the media controller reclaims the memory block according to the memory logical address information, including:

[0009] The media controller deletes the mapping relationship between the memory logical address of the memory block and the corresponding memory physical address according to the memory logical address information; and the media controller adds the memory physical address of the memory block to a memory free list.

[0010] Since the media controller can delete the mapping relationship between the memory logical address of the memory block and the corresponding memory physical address in time, it can increase the number of available memory blocks, enhance the wear leveling effect between memory blocks, and improve the performance and life of NVDIMM. It realizes the management of memory modules when NVDIMM is used as memory.

[0011] In a possible implementation, the memory logical address information includes a starting address and length information of the memory block to be reclaimed, the starting address is used to indicate the first address of the memory block to be reclaimed, and the length information is used to indicate the number of memory blocks to be reclaimed.

[0012] In a possible implementation manner, the release command further includes erasure mode indication information; and the method further includes:

[0013] If the erasure mode indication information indicates erasing the data information in the memory block, the media controller writes preset data into the memory block.

[0014] In this embodiment, the release command also includes erase mode indication information, which can instruct the media controller to use preset data to overwrite the sensitive data when the data in the memory block is sensitive data, thereby protecting the sensitive data and improving the security of the NVDIMM.

[0015] In a possible implementation, the method further includes:

[0016] The media controller receives a read command sent by the memory controller, wherein the read command includes the memory logical address information of the data to be read;

[0017] The media controller determines that no corresponding memory physical address is found according to the memory logical address information;

[0018] The media controller sends error response information to the memory controller; wherein the error response information is used to indicate that the read command execution fails.

[0019] In a second aspect, an embodiment of the present application further provides a memory block recovery method, the method being applied to a computer system, the computer system comprising a processor, a memory controller, a media controller, and a non-volatile memory connected to the media controller, the memory controller communicating with the media controller through an NVDIMM-P protocol, the non-volatile memory comprising a plurality of memory blocks, the method comprising:

[0020] The memory controller receives a TRIM instruction sent by the processor, wherein the TRIM instruction includes memory logical address information of a memory block to be reclaimed;

[0021] The memory controller sends a release command to the media controller;

[0022] The release command includes the memory logical address information of the memory block to be reclaimed, and the release command is used to instruct the media controller to reclaim the memory block, and the reclaimed memory block is an available memory block.

[0023] In a possible implementation, the memory logical address information includes a starting address and length information of the memory block to be reclaimed, the starting address is used to indicate the first address of the memory block to be reclaimed, and the length information is used to indicate the number of memory blocks to be reclaimed.

[0024] In a possible implementation, the release command further includes erase mode indication information; when the erase mode indication information indicates erasing the data information in the memory block, the release command is further used to instruct the media controller to write preset data into the memory block.

[0025] In a possible implementation, the method further includes:

[0026] The memory controller sends a read command to the media controller, where the read command includes the memory logical address information of the data to be read;

[0027] The memory controller receives error response information sent by the media controller, wherein the error response information is used to indicate that the read command fails to execute.

[0028] In a third aspect, the embodiment of the present application further provides a memory for executing the memory block recovery method in the first aspect, which has the same technical features and technical effects, and will not be described in detail in this application.

[0029] A third aspect of an embodiment of the present application provides a memory, comprising a media controller and a non-volatile memory connected to the media controller, wherein the media controller communicates with a memory controller of a processor through an NVDIMM-P protocol, and the non-volatile memory comprises a plurality of memory blocks; the media controller is used to:

[0030] Receiving a release command sent by the memory controller, wherein the release command includes memory logical address information of a memory block to be reclaimed;

[0031] The memory block is recycled according to the memory logical address information, wherein the recycled memory block is an available memory block.

[0032] In a possible implementation manner, the media controller is further used for:

[0033] Deleting the mapping relationship between the memory logical address of the memory block and the corresponding memory physical address according to the memory logical address information;

[0034] Add the memory physical address of the memory block to a memory free list.

[0035] In a possible implementation, the memory logical address information includes a starting address and length information of the memory block to be reclaimed, the starting address is used to indicate the first address of the memory block to be reclaimed, and the length information is used to indicate the number of memory blocks to be reclaimed.

[0036] In a possible implementation manner, the release command further includes erase mode indication information, and the media controller is further configured to:

[0037] When the erasure mode indication information indicates erasing the data information in the memory block, the preset data is written into the memory block.

[0038] In a possible implementation manner, the media controller is further used for:

[0039] Receive a read command sent by the memory controller, wherein the read command includes the memory logical address information of the data to be read;

[0040] Determining that no corresponding memory physical address is found according to the memory logical address information;

[0041] Sending error response information to the memory controller; wherein the error response information is used to indicate that the read command execution fails.

[0042] In a fourth aspect, an embodiment of the present application further provides a computer system, the computer system comprising a processor, a memory controller, a media controller, and a non-volatile memory connected to the media controller, the memory controller and the media controller communicate through an NVDIMM-P protocol, the non-volatile memory comprising a plurality of memory blocks; wherein the memory controller is used to:

[0043] receiving a pruning instruction sent by the processor, wherein the pruning instruction includes memory logical address information of a memory block to be reclaimed;

[0044] Sending a release command to the media controller, wherein the release command includes memory logical address information of the memory block to be reclaimed, and the release command is used to instruct the media controller to reclaim the memory block;

[0045] The media controller is used for:

[0046] receiving the release command sent by the memory controller;

[0047] The memory block is recycled according to the memory logical address information, wherein the recycled memory block is an available memory block.

[0048] In a possible implementation, the memory logical address information includes a starting address and length information of the memory block to be reclaimed, the starting address is used to indicate the first address of the memory block to be reclaimed, and the length information is used to indicate the number of memory blocks to be reclaimed.

[0049] In a possible implementation manner, the release command further includes erase mode indication information; and the media controller is further configured to:

[0050] When the erasure mode indication information indicates erasing the data information in the memory block, the preset data is written into the memory block.

[0051] In a possible implementation manner, the memory controller is further configured to:

[0052] Receive a memory access request sent by a processor, wherein the memory access request includes the memory logical address information of the data to be read;

[0053] The memory controller is further used to send a read command to the media controller according to the memory access request, wherein the read command carries the memory logical address information;

[0054] The media controller is also used for:

[0055] Determining that no corresponding memory physical address is found according to the memory logical address information;

[0056] Sending error response information to the memory controller; wherein the error response information is used to indicate that the read command execution failed;

[0057] The memory controller is further configured to send read failure information to the processor according to the error response information. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for describing the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application.

[0059] Figure 1 A schematic diagram of a computer system architecture provided for an embodiment of the present application;

[0060] Figure 2 A flowchart of a memory block recovery method provided in Embodiment 1 of the present application;

[0061] Figure 3 A signaling flow chart of a memory block recovery method provided in Embodiment 2 of the present application;

[0062] Figure 4 A flow chart of a method for reading data provided in an embodiment of the present application. DETAILED DESCRIPTION

[0063] In order to make the technical personnel in the field of the present invention better understand the present invention, the technical solution in the present invention will be described in detail below in conjunction with the drawings in the present invention. Obviously, the described embodiments are only part of the present invention, not all of the embodiments.

[0064] Figure 1 A computer system architecture diagram provided in an embodiment of the present application. Figure 1 As shown, the computer system 100 may include at least a processor 102, a memory controller 106, and an NVDIMM 108. Generally, the memory controller 106 may be integrated into the processor 102. It should be noted that in the computer system provided in the embodiment of the present application, in addition to Figure 1In addition to the components shown, the computer system 100 may also include other components such as a communication interface and a disk as an external memory, which are not limited here.

[0065] The processor 102 is the computing core and control unit of the computer system 100. The processor 102 may include one or more processor cores 104. The processor 102 may be a very large scale integrated circuit. An operating system and other software programs are installed in the processor 102, so that the processor 102 can access the NVDIMM 108, cache and disk. It is understood that in the embodiment of the present application, the Core 104 in the processor 102 may be, for example, a central processing unit (CPU) or other application specific integrated circuits (ASIC).

[0066] The memory controller 106 is a bus circuit controller that controls the NVDIMM 108 inside the computer system 100 and is used to manage and plan data transmission from the NVDIMM 108 to the Core 104. Through the memory controller 106, data can be exchanged between the NVDIMM 108 and the Core 104. The memory controller 106 can be a separate chip and connected to the Core 104 through the system bus. Those skilled in the art will appreciate that the memory controller 106 can also be integrated into the processor 102 (e.g., Figure 1 106) may also be built into the north bridge. The embodiment of the present application does not limit the specific location of the memory controller 106. In practical applications, the memory controller 106 may include a communication interface 1062 and a control circuit 1064, and the memory controller 106 may communicate with the processor 102 and the NVDIMM 108 through the communication interface 1062. The memory controller 106 may control the necessary logic to write data to the NVDIMM 108 or read data from the NVDIMM 108 through the control circuit 1064.

[0067] NVDIMM 108 is a random access memory RAM of computer system 100, which can be used as memory or storage of computer system 100. NVDIMM 108 may include a media controller 110, at least one NVM 112, and one or more caches 114. The media controller 110 may include a logic circuit with control capabilities. NVM 112 is used to store various running software in the operating system, input and output data, and information exchanged with external memory. Among them, NVM 112 can exist in the form of a chip. Exemplarily, NVM 112 may include phase change memory (PCM), resistive random access memory (RRAM), magnetic random access memory (MRAM), spin-transfer torque MRAM (STT MRAM), etc., which can be used as non-volatile memory of memory.

[0068] The memory controller 106 is connected to the NVDIMM 108 via the bus 105. The communication between the memory controller 106 and the NVDIMM 108 complies with the NVDIMM-P protocol. The NVDIMM-P protocol is an asynchronous protocol compatible with the double data rate (DDR) protocol. The media controller 110 can access the data stored in the NVM 112 according to the memory access command of the memory controller 106. It can be understood that the memory access command sent by the memory controller 106 can be a read command or a write command. The media controller 110 can read data from the NVM 112 and store it in the read buffer according to the read command sent by the memory controller 106, and send an asynchronous signal to the memory controller 106 to notify the memory controller 106 to read the data from the read buffer, or the media controller 110 can also store the data in the write buffer according to the write command sent by the memory controller 106, and write the data in the write buffer to the NVM 112 or the cache 114.

[0069] In the embodiment of the present application, the bus 105 may include at least a data bus and a command / address bus. The data bus is used to transmit data and metadata. The command / address bus is used to transmit memory access commands such as read commands and write commands. The cache 114 is used to cache data read from the NVM 112 by the media controller 110.

[0070] In order to extend the life of NVDIMM and improve the performance of NVDIMM, the media controller needs to perform different media management operations, such as wear leveling, bad block management, and data movement between cache and NVM. Among them, wear leveling refers to distributing data evenly to each memory block of NVDIMM as much as possible to ensure the same number of erase and write times for each memory block to improve the life of NVDIMM. When the media controller allocates a new memory block for data, it gives priority to the memory block with less wear times in the memory free list. Bad block management refers to selecting a new memory block in the memory free list for the data in the current bad block after determining that the memory block is a bad block. The data movement between cache and NVM is to save frequently accessed data in the cache, and infrequently accessed data is moved to NVM to improve the processing speed of read and write requests. However, when writing data in the cache to NVM, it is necessary to select a new memory block in the memory free list for the data in the cache. From the above analysis, it can be seen that the timely update of the memory free list determines the management effect of the media management operation of the media controller, which in turn affects the life and performance of NVDIMM.

[0071] In order to improve the efficiency of the above-mentioned media management operation, an embodiment of the present application provides a memory block recovery method and device.

[0072] The memory block recovery method and device provided by the embodiments of the present application are described in detail below in conjunction with specific embodiments. In the following specific embodiments, the same or similar concepts or processes may not be described in detail in some embodiments.

[0073] On the one hand, an embodiment of the present application provides a memory block recovery method. Figure 2 A flowchart of a memory block recovery method provided in the first embodiment of the present application. In this embodiment, the media controller receives a release command sent by the memory controller, recovers the memory block according to the release command, and converts the memory block into an available memory block, thereby improving the management effect of the media management operation of the media controller, thereby improving the storage performance of the NVDIMM and extending the life of the NVDIMM. Figure 2 As shown, the memory block recovery method provided in this embodiment is applied to Figure 1 In the computer system shown in FIG. 1 , the execution subject of the memory block recovery method can be exemplarily Figure 1 The computer system includes a memory controller, a media controller, and a non-volatile memory connected to the media controller. The memory controller communicates with the media controller through an NVDIMM-P protocol. The non-volatile memory includes multiple memory blocks. The memory block recovery method includes:

[0074] S201. The memory controller sends a release command to the media controller, where the release command includes memory logical address information of a memory block to be reclaimed.

[0075] Exemplarily, when the media controller receives an access request sent by the memory controller, it usually allocates a corresponding memory physical address to the memory logical address in the access request, and stores the mapping relationship between the memory logical address and the memory physical address. When the memory controller reads or writes the memory logical address, the media controller can read or write to the corresponding memory physical address according to the mapping relationship. When the media controller allocates a memory physical address to the memory logical address, the media controller selects a memory block from the memory free list. In order to ensure the wear balancing effect of the memory blocks in the NVM chip, it should be ensured that the unused memory blocks are converted into available memory blocks in a timely manner to avoid some memory blocks from being unable to participate in the media management, wasting memory resources, and reducing the life of the NVDIMM. To achieve the above purpose, the memory controller sends a release command (unmap command) to the media controller, and the release command carries the memory logical address information of the memory block to be recovered. The release command is used to instruct the media controller to recover the memory block according to the release command. When the media controller receives the release command, it can determine the memory physical address information to be recovered according to the memory logical address information of the memory block to be recovered in the release command.

[0076] S202: The media controller reclaims the memory block according to the memory logical address information; wherein the reclaimed memory block is an available memory block.

[0077] Exemplarily, the media controller recycles the specified memory block according to the memory logical address information in the release command. The reclaimed memory block is an available memory block. The media controller can manage the memory block when performing media management such as wear leveling. When releasing an object, the existing memory controller usually does not send a release command for the memory block occupied by the data corresponding to the object to the media controller. This embodiment recycles the specified memory block by sending a release command to the media controller, so that the memory block becomes an available memory block, so that the unused memory block can be released as soon as possible, avoiding the problem of high overhead caused by over-configuration. It also allows unused memory blocks to be managed as early as possible in media management operations, improving the storage performance of NVDIMM and extending the life of NVDIMM.

[0078] The embodiment of the present application provides a memory block recovery method, the method comprising: a media controller receives a release command sent by a memory controller, the release command includes memory logical address information of a memory block to be recovered; the media controller recovers the memory block according to the memory logical address information; wherein the recovered memory block is an available memory block. After receiving the release command sent by the memory controller, the media controller releases the corresponding memory block according to the memory logical address information of the memory block to be recovered included in the release command, recovers the memory block, improves the media management operation effect of the media controller, thereby improving the storage performance of the NVDIMM and extending the life of the NVDIMM.

[0079] For example, in Figure 2 Based on the illustrated embodiment, the embodiment of the present application also provides a memory block recycling method. Figure 3 This is a signaling flow chart of the memory block recovery method provided in the second embodiment of the present application. In this embodiment, the specific process of the media controller recovering the memory block according to the release command is described in detail. Figure 3 As shown, the memory block recovery method includes:

[0080] S301: The media controller receives a release command sent by the memory controller, where the release command includes memory logical address information of a memory block to be reclaimed.

[0081] For example, S301 in this embodiment is Figure 2 S201 in the illustrated embodiment is the same and will not be described in detail in this application.

[0082] Optional, in Figure 2 and Figure 3 In the illustrated embodiment, the memory logical address information includes the starting address and length information of the memory block to be reclaimed, the starting address is used to indicate the first address of the memory block to be reclaimed, and the length information is used to indicate the number of memory blocks to be reclaimed.

[0083] Exemplarily, when the media controller recycles the memory blocks, it determines which memory blocks in the memory physical address will be reclaimed according to the starting address of the memory blocks to be reclaimed in the release command and the total length of the memory blocks to be reclaimed. Exemplarily, when the memory blocks to be reclaimed are consecutive memory blocks 1, 2 and 3, the starting address can be the first address of memory block 1, and the length information can be 3. Optionally, the memory controller and the media controller agree on the granularity of the memory blocks. Optionally, the release command can also include the granularity size information of the memory blocks.

[0084] Optionally, based on the above embodiment, before S301, the memory block recycling method further includes:

[0085] S300: The memory controller receives a pruning instruction sent by a processor, where the pruning instruction includes memory logical address information of a memory block to be reclaimed.

[0086] For example, a processor (e.g. Figure 1 Any processor core 104 in the memory controller sends a trim command (TRIM command) to the memory controller, and after receiving the TRIM command, the memory controller sends a release command to the media controller. The TRIM command is a command used by the operating system to notify the memory which memory blocks are no longer used and can be erased.

[0087] Specifically, when the operating system running in the processor deletes an object, the media controller cannot know that the object has been deleted, and the mapping relationship between the logical address and the physical address is also stored in the media controller. Therefore, in an embodiment of the present application, when the object file is deleted, the processor can send a TRIM instruction to the memory controller, and the TRIM instruction carries the address of the memory block. The TRIM instruction is used to notify the memory controller that the object corresponding to the data of the memory block has been deleted, the data of the memory block can be deleted, and the memory block can be recycled.

[0088] In actual applications, when the processor detects any of the following situations, the processor sends a trim instruction to the memory controller:

[0089] An object and the data corresponding to the object are released, a memory block exceeding a preset size is released, an application ends, the number of read and write requests to the memory is less than a preset number, or the processor determines that a trim instruction needs to be sent according to a preset operating system memory management algorithm.

[0090] Exemplarily, when the processor detects that an object has been released, the processor sends a trim instruction to the memory controller for the memory block occupied by the object as a memory block to be reclaimed. Optionally, in order to reduce the signaling interaction between the processor core and the memory controller, when the processor detects that memory blocks exceeding a preset size have been released, the processor sends a trim instruction to the memory controller for these memory blocks as memory blocks to be reclaimed. Optionally, when the processor detects that an application has ended, the processor sends a trim instruction to the memory controller for the memory blocks occupied by the application as memory blocks to be reclaimed. Optionally, when the processor detects that there are fewer read and write requests, that is, when the memory is idle, the processor sends a trim instruction to the memory controller to avoid releasing the memory when the memory is busy, thereby improving the read and write performance of the memory. Optionally, the processor may also send a trim instruction to the memory controller when the preset operating system memory management algorithm determines that a trim instruction needs to be sent.

[0091] In practical applications, a fourth-generation double data rate synchronous (DDR4) interface or a fifth-generation double data rate synchronous (DDR5) interface may be used between the media controller and the memory controller. When different DDR interfaces are used, the format of the release command sent by the memory controller to the media controller is different.

[0092] In the first possible implementation, a DDR4 interface is used between the media controller and the memory controller, and the format of the release command (unmap command) is shown in Table 1 below:

[0093] Table 1

[0094]

[0095]

[0096] Exemplarily, since the release command is limited in length and cannot carry the complete address information of the memory block to be reclaimed, the memory controller usually sends an extended address command after sending the release command. The release command and the extended address command are sent back to back, that is, the memory controller sends the release command and the extended address command alternately. For example, after the memory controller sends the first release command in the first clock beat, it sends the first extended address command in the second clock beat, and then sends the second release command and the second extended address command in subsequent clock beats in sequence. Among them, the release command and the extended address command are sent in two clock beats. The format of the extended address command is also shown in Table 1. Among them, one clock beat is a clock change edge, and the change edge can be a rising edge or a falling edge.

[0097] Exemplarily, as shown in Table 1, H (high) in the release command and the extended address command represents binary data 1, and L (low) represents binary data 0. Among them, the CKE0 (Clock Enable) bit is used to indicate the clock enable signal, the Previous (previous cycle) bit is used to indicate whether the previous clock is valid, and the Current (current cycle) bit is used to indicate whether the current clock is valid. As shown in Table 1, when the Previous bit and the Current bit are both H, the clock enable signal is valid, and the media controller receives the release command when the clock enable signal is valid. CS (Chip Select) is a chip select signal. There are multiple memory bars on the memory channel, and the memory controller can determine the memory bar that receives the release command and the extended address command through the chip select signal. When the chip select signal received by a certain memory bar is L, it indicates that it is selected and receives the release command and the extended address command. Among them, the ADDR[39:2] field is used to store the starting address of the memory block to be recovered. In other words, ADDR[39:2] is the starting address of the memory block to be recovered, that is, the starting address of the first memory block to be recovered. LENGTH[4:0] is used to indicate the length information of the memory block to be reclaimed, and specifically, can be used to indicate the number of memory blocks to be reclaimed. Taking LENGTH[4:0] as an example, the maximum value of the LENGTH[4:0] field is 32. Therefore, through an unmap command, 32 memory blocks can be reclaimed. The OPCODE[0] field is used to indicate the erase mode information.

[0098] In the second possible implementation, a DDR5 interface is used between the media controller and the memory controller, and the format of the release command is shown in Table 2 below:

[0099] Table 2

[0100]

[0101] Among them, similar to the first possible implementation, due to the limited length of the release command, it is impossible to carry the complete address information of the memory block to be recovered. Therefore, after sending the release command, the memory controller usually sends an extended address command. The release command and the extended address command are sent back to back, that is, the memory controller sends the release command and the extended address command alternately. Different from the first possible implementation, in this implementation, the release command and the extended address command both need to take up two clock cycles to send, and each clock cycle includes a clock rising edge and a clock falling edge. In this embodiment, after the memory controller sends the first part of the release command on the two clock edges in the first clock cycle, it sends the second part of the release command on the two clock edges in the second clock cycle, and then the memory controller sends the first part of the extended address command on the two clock edges in the third clock cycle, and then sends the second part of the extended address command on the two clock edges in the fourth clock cycle. The memory controller then sends other release commands and extended address commands in subsequent clock beats in sequence. The format of the extended address command is also shown in Table 2.

[0102] In the release command and the extended address command, H (high) represents binary data 1, and L (low) represents binary data 0. CS (Chip Select) is a chip select signal. When CS is detected as L in the first clock cycle, it indicates that the release command or the extended address command starts. For the release command or the extended address command in the second clock cycle, when CS is detected as H, it indicates that the second part of the release command or the extended address command is received. However, when CS is still detected as L in the second clock, it indicates that the release command or the extended address command is wrong. At this time, the release command or the extended address command in the two clock cycles can be discarded, or the release command or the extended address command in which CS is detected as L in the first clock cycle can be discarded. The ADDR[39:1] field is used to indicate the starting address of the memory block to be reclaimed. In other words, the ADDR[39:1] field is used to indicate the starting address of the first memory block to be reclaimed. LENGTH[6:0] is used to indicate the length information of the memory block to be reclaimed, and specifically, it can be used to indicate the number of memory blocks to be reclaimed. Taking LENGTH[6:0] as an example, the maximum value of the LENGTH[6:0] field is 128. Therefore, through an unmap command, 128 memory blocks can be instructed to be reclaimed. The OPCODE[0] field is used to indicate the erase mode information.

[0103] S302. The media controller deletes the mapping relationship between the memory logical address of the memory block and the corresponding memory physical address according to the memory logical address information. Specifically, after receiving the release command, the media controller can determine the first memory physical address corresponding to the first memory logical address according to the first memory logical address information in the release command, so that the media controller can delete the mapping relationship between the first memory logical address and the first memory physical address, so that the first memory physical address no longer has a corresponding memory logical address, and the media controller can allocate a new memory logical address for the first memory physical address. If the mapping relationship between the first memory logical address and the first memory physical address is not deleted, the media controller can only access the first memory physical address when the memory controller accesses the first memory logical address next time, but the interval between the two accesses may be very long, which will make the erase and write times of the first memory physical address significantly lower than the erase and write times of other memory blocks in the NVM, which may affect the life of the NVDMM.

[0104] S303, the media controller adds the memory physical address of the memory block to the memory free list. In the embodiment of the present application, the memory physical address without the corresponding memory logical address is an available memory block, and the media controller adds the memory physical address to the memory free list. In the embodiment of the present application, the memory block indicated in the memory free list is an available memory block. In other words, when a memory block needs to be allocated for a new access request, the media controller can allocate the memory block according to the memory free list. In practical applications, the memory blocks in the memory free list can be arranged from small to large according to the number of writes of the memory block. In the process of allocating memory blocks, the media controller can give priority to allocating memory blocks with fewer erase and write times. Of course, in practical applications, the media controller can also randomly allocate memory blocks. This is not limited here. In the computer system including NVDIMM provided in the embodiment of the present application, the memory controller can send a release command to the media controller according to the NVDIMM-P protocol to instruct the media controller to recycle the memory block. After receiving the release command, the media controller can delete the mapping relationship between the memory logical address of the memory block and the corresponding memory physical address according to the memory logical address information carried in the release command, and recycle the corresponding memory block.

[0105] The method provided in the embodiment of the present application of sending a release command to the media controller through the memory controller enables the media controller to delete the mapping relationship between the memory logical address of the memory block and the corresponding memory physical address in time, thereby increasing the number of available memory blocks, enhancing the wear leveling effect between memory blocks, and improving the performance and life of NVDIMM. The management of memory modules is realized when NVDIMM is used as memory.

[0106] Those skilled in the art will appreciate that, since the NVM chip supports byte-by-byte writing, the data in the memory block can be directly rewritten when the memory is updated, without erasing and garbage collecting the unused memory blocks in advance. Therefore, in practical applications, in order to improve the processing speed, when releasing the memory block, the recovered memory block may not be erased. However, for sensitive data, there may be a risk of leakage of unerased data. Therefore, in an embodiment of the present application, as shown in Tables 1 and 2 above, the release command may also include an OPCODE[0] field. The OPCODE[0] field is used to indicate the erase mode information. Specifically, the media controller may determine whether the data block needs to be erased based on the erase mode indication information of the OPCODE[0] field in the release command. For example, when the OPCODE[0] value is 0, it indicates that the data information in the memory block does not need to be erased. When the OPCODE[0] value is 1, it indicates that the data information in the memory block needs to be erased.

[0107] Specifically, Figure 3 As shown, after S302, the memory block recovery method may further include:

[0108] S304. If the erase mode indication information indicates erasing the data information in the memory block, the media controller writes the preset data into the memory block. Exemplarily, in an embodiment of the present application, when OPCODE[0] takes a value of 1, the media controller deletes the mapping relationship between the memory logical address of the memory block and the corresponding memory physical address, and after recycling the memory block, the media controller can write the preset data (pre-defined pattern) into the recycled memory block to overwrite the original data in the memory block to prevent the leakage of sensitive data in the memory block. In practical applications, the preset data can be stored in a preset register. The preset data can be all 0, all 1, or any other predefined data. It is not limited here. In practical applications, S304 can be executed before S303, or after S303, or simultaneously with S303, and the present application does not limit this.

[0109] In the memory block recovery method provided in the embodiment of the present application, the release command also includes erase mode indication information, which can instruct the media controller to use preset data to overwrite the sensitive data when the data in the memory block is sensitive data, thereby protecting the sensitive data and improving the security of the NVDIMM.

[0110] Furthermore, in actual applications, there may be multiple processors or multiple processor cores accessing the same memory block. Then, when a memory block is recycled, there may be other processors accessing the memory block. The following describes in detail the process of reading data between the memory controller and the media controller after the memory block is recycled. Figure 4A flow chart of a method for reading data provided in an embodiment of the present application. Figure 4 As shown, the method may include:

[0111] S402: The memory controller receives a memory access request sent by the processor, wherein the memory access request includes memory logical address information of the data to be read. In an embodiment of the present application, the memory logical address information in the read request is the same as the memory logical address information in the Trim command described in the above embodiment.

[0112] S404, the memory controller sends a read command to the media controller. Specifically, the memory controller sends a read command to the media controller according to the received memory access request, wherein the read command is used to read data in the memory block, and the memory access request carries the memory logical address of the memory block to be accessed.

[0113] S406. The media controller determines that the corresponding memory physical address is not found according to the memory logical address information. When receiving the read command, the media controller queries the memory physical address corresponding to the memory logical address in the read command. Since the memory logical address information in the read command is the same as the memory logical address in the Trim command, the media controller has recovered the memory block corresponding to the memory logical address according to the aforementioned Trim instruction. Therefore, the media controller cannot find the corresponding memory physical address according to the memory logical address information.

[0114] S408, the media controller sends an error response message to the memory controller; wherein the error response message is used to indicate that the read command execution failed. As mentioned above, since the media controller cannot find the corresponding memory physical address according to the memory logical address information, the media controller cannot obtain the corresponding data from the corresponding physical address and return it to the memory controller. Therefore, in this step, the media controller can send an error response message to the memory controller to inform the memory controller that the read command execution failed.

[0115] S410: The memory controller sends a read failure message to the processor according to the error response message. Exemplarily, after receiving the error response message sent by the media controller, the memory controller may also send a read failure message to the processor according to the error response message, and the read failure message is used to notify the processor that the read command execution fails.

[0116] Optionally, when receiving the error response information, the memory controller needs to determine the error type according to the error type indication information carried in the error response information. Specifically, the memory controller can determine the error type in the received error response information according to the mapping relationship between the preset error type indication information and the failure type. The mapping relationship between the preset error type indication information and the failure type can be stored in the mode register.

[0117] Optionally, in an embodiment of the present application, the error response information includes error type indication information and error indication information (Poison); wherein the error indication information is used to indicate the failure of the read command execution; the error type indication information is used to indicate the failure type; the failure types include: erroneous data, uncorrectable checksum error, medium error and memory channel error.

[0118] Exemplarily, the error response information includes a Poison bit, and when the Poison bit takes a value of 0, it indicates that the read command is executed successfully. When the Poison bit takes a value of 1, it indicates that the read command fails to execute. The error response information also includes error type indication information, which is used to indicate the type of failure to execute the read command. Exemplarily, the memory controller determines that the read command fails to execute according to the value of the Poison bit in the error response information being 1, and the type of failure to execute the read command can be determined according to the error type indication information, and the media controller determines that there is no memory physical address corresponding to the memory block. Exemplarily, when the values ​​of the error type indication information are different, different error types can be represented. The error type can also be: erroneous data, uncorrectable checksum error, media error, memory channel error, etc.

[0119] In one case, when a DDR4 interface is used between the media controller and the memory controller, a possible format of the error response information is shown in Table 3 below:

[0120] Table 3

[0121]

[0122] Among them, DQ0~DQ 63 and CB0~CB7 are data lines for transmitting data. UI0~UI7 are clock lines, indicating the clock beats during data transmission. For example, UI0 is the first clock beat, which is the rising edge of the clock, and UI1 is the second clock beat, which is the falling edge of the clock. In DDR4, an error response message requires at least 4 clock cycles to send. As shown in Table 3, in the error response information shown in the embodiment of the present application, the RID[7:0] field is used to indicate the identification ID of the read command. The error indication information is used to indicate whether the read command is erroneous. The error type indication information field is used to indicate the type of error. The ECC field is used to indicate the check information (Error Correcting Code, ECC) of the transmitted data. The RFU field is a reserved bit.

[0123] In another case, when a DDR5 interface is used between the media controller and the memory controller, a possible format of the error response information is shown in Table 4 below:

[0124] Table 4

[0125]

[0126] Different from the error response information shown in Table 3, in DDR5, the number of bits of the data line is less, wherein DQ is 32 bits. Therefore, in order to transmit the same number of bits of error response information, the number of clock beats required in DDR5 is greater than the number of clock beats required in DDR4.

[0127] The read failure information sent by the memory controller to the processor may include error type indication information and error indication information. Optionally, the read failure information may also be error indication information, and the error indication information is only used to indicate the read failure.

[0128] Another aspect of the present application embodiment further provides a memory, which can be Figure 1 In the NVDIMM, the memory structure can be as follows Figure 1 As shown in the NVDIMM in FIG. 1 , the NVDIMM includes a media controller 110 and a non-volatile memory (eg, Figure 1 The media controller 110 communicates with the memory controller 106 of the processor via the NVDIMM-P protocol, and the non-volatile memory includes multiple memory blocks. The media controller 110 can exemplarily perform the above Figures 2 to 4 Specifically, the media controller 110 is used for:

[0129] receiving a release command sent by the memory controller 106, where the release command includes memory logical address information of the memory block to be reclaimed;

[0130] The memory block is reclaimed according to the memory logical address information, wherein the reclaimed memory block is an available memory block.

[0131] Optionally, the media controller 110 is further configured to:

[0132] According to the memory logical address information, the mapping relationship between the memory logical address of the memory block and the corresponding memory physical address is deleted;

[0133] Add the memory physical address of the memory block to the memory free list.

[0134] Optionally, the memory logical address information includes the starting address and length information of the memory block to be reclaimed, the starting address is used to indicate the first address of the memory block to be reclaimed, and the length information is used to indicate the number of memory blocks to be reclaimed.

[0135] Optionally, the release command further includes erase mode indication information, and the media controller 110 is further configured to:

[0136] When the erase mode indication information indicates erasing the data information in the memory block, the preset data is written into the memory block.

[0137] Optionally, the media controller 110 is further configured to:

[0138] Receive a read command sent by the memory controller 106, where the read command includes memory logical address information of data to be read;

[0139] Determine that no corresponding memory physical address is found according to the memory logical address information;

[0140] Send an error response message to the memory controller 106; wherein the error response message is used to indicate that the read command execution fails.

[0141] Another aspect of the present application embodiment further provides a computer system, the structure of the computer system is as follows Figure 1 As shown, the system includes a processor 102, a memory controller 106, a media controller 110, and a non-volatile memory (eg, Figure 1 The memory controller 106 communicates with the media controller 110 via the NVDIMM-P protocol, and the non-volatile memory includes a plurality of memory blocks; wherein the memory controller 106 is used to:

[0142] receiving a pruning instruction sent by the processor 102, where the pruning instruction includes memory logical address information of a memory block to be reclaimed;

[0143] Sending a release command to the media controller 110, wherein the release command includes memory logical address information of the memory block to be reclaimed, and the release command is used to instruct the media controller 110 to reclaim the memory block;

[0144] The media controller 110 is used to:

[0145] receiving a release command sent by the memory controller 106;

[0146] The memory block is reclaimed according to the memory logical address information, wherein the reclaimed memory block is an available memory block.

[0147] Optionally, the memory logical address information includes the starting address and length information of the memory block to be reclaimed, the starting address is used to indicate the first address of the memory block to be reclaimed, and the length information is used to indicate the number of memory blocks to be reclaimed.

[0148] Optionally, the release command further includes erase mode indication information; the media controller 110 is further configured to:

[0149] When the erasing mode indication information indicates erasing the data information in the memory block, the preset data is written into the memory block.

[0150] Optionally, the memory controller 106 is further configured to:

[0151] receiving a memory access request sent by a processor, wherein the memory access request includes memory logical address information of data to be read;

[0152] The memory controller 106 is also used to send a read command to the media controller 110 according to the memory access request, and the read command carries the memory logical address information;

[0153] The media controller 110 is also used to:

[0154] Determine that no corresponding memory physical address is found according to the memory logical address information;

[0155] Sending an error response message to the memory controller 106; wherein the error response message is used to indicate that the read command execution failed;

[0156] The memory controller 106 is further configured to send read failure information to the processor according to the error response information.

[0157] It should be noted that the embodiments provided in this application are merely illustrative. Those skilled in the art can clearly understand that, for the convenience and brevity of description, in the above embodiments, the descriptions of each embodiment have their own emphasis, and for parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments. The features disclosed in the embodiments, claims, and drawings of this application may exist independently or in combination. The features described in the embodiment of this application in the form of hardware may be executed by software, and vice versa. This is not limited here.

[0158] Those of ordinary skill in the art will appreciate that the method steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0159] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server, data center, etc. that contains one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a CD), or a semiconductor medium (e.g., a solid-state drive (SSD)), or other non-transitory machine-readable medium that can store program code.

[0160] It should be noted that the embodiments provided in this application are merely illustrative. Those skilled in the art can clearly understand that, for the convenience and brevity of description, in the above embodiments, the descriptions of each embodiment have their own emphasis, and for parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments. The features disclosed in the embodiments, claims, and drawings of this application may exist independently or in combination. The features described in the embodiment of this application in the form of hardware may be executed by software, and vice versa. This is not limited here.

Claims

1. A memory block recovery method, characterized in that: The method is applied to a computer system, wherein the computer system includes a memory controller, a media controller, and a non-volatile memory connected to the media controller, wherein the memory controller communicates with the media controller through an NVDIMM-P protocol, wherein the media controller and the memory controller communicate with each other through a fourth-generation double-bit rate synchronous DDR4 interface or a fifth-generation double-bit rate synchronous DDR5 interface, wherein the non-volatile memory includes a plurality of memory blocks, and wherein the method includes: The media controller receives a release command and an extended address command sent alternately by the memory controller, wherein both the release command and the extended address command include memory logical address information of a memory block to be reclaimed; The media controller reclaims the memory block according to the memory logical address information, wherein the reclaimed memory block is an available memory block.

2. The method according to claim 1, characterized in that The memory logical address information includes the starting address and length information of the memory block to be reclaimed, the starting address is used to indicate the first address of the memory block to be reclaimed, and the length information is used to indicate the number of the memory blocks to be reclaimed.

3. The method according to claim 1, characterized in that: When the media controller and the memory controller communicate using a fourth-generation double-bit rate synchronous DDR4 interface, the release command includes the following format: Among them, ADDR is used to indicate the starting address of the memory block to be recovered; OPCODE is used to indicate the erase mode information; LENGTH is used to indicate the length information of the memory block to be recovered; CKE_0 bit is used to indicate the clock enable signal; Previous bit is used to indicate whether the previous clock is valid; Current bit is used to indicate whether the current clock is valid; CS is the chip select signal.

4. The method according to claim 1, characterized in that When the media controller and the memory controller communicate using a fifth-generation double-bit rate synchronous DDR5 interface, the release command includes the following format: Among them, ADDR is used to indicate the starting address of the memory block to be reclaimed; OPCODE is used to indicate the erase mode information; LENGTH is used to indicate the length information of the memory block to be reclaimed; CS is the chip select signal; and the RFU field is a reserved bit.

5. The method according to any one of claims 1 to 4, characterized in that: The media controller reclaims the memory block according to the memory logical address information, including: The media controller deletes the mapping relationship between the memory logical address of the memory block and the corresponding memory physical address according to the memory logical address information; The media controller adds the memory physical address of the memory block to a memory free list.

6. The method according to any one of claims 1 to 4, characterized in that The release command also includes erase mode indication information; the method also includes: If the erasure mode indication information indicates erasing the data information in the memory block, the media controller writes preset data into the memory block.

7. The method according to any one of claims 1 to 4, characterized in that The method further comprises: The media controller receives a read command sent by the memory controller, wherein the read command includes the memory logical address information of the data to be read; The media controller determines that no corresponding memory physical address is found according to the memory logical address information; The media controller sends error response information to the memory controller; wherein the error response information is used to indicate that the read command execution fails.

8. A memory, characterized in that: The invention comprises a media controller and a non-volatile memory connected to the media controller, wherein the media controller communicates with a memory controller of a computer system through an NVDIMM-P protocol, and the media controller and the memory controller communicate with each other through a fourth-generation double-bit rate synchronous DDR4 interface or a fifth-generation double-bit rate synchronous DDR5 interface, and the non-volatile memory comprises a plurality of memory blocks; the media controller is used for: Receiving a release command and an extended address command sent alternately by the memory controller, wherein both the release command and the extended address command include memory logical address information of a memory block to be reclaimed; The memory block is recycled according to the memory logical address information, wherein the recycled memory block is an available memory block.

9. The memory according to claim 8, characterized in that: The memory logical address information includes the starting address and length information of the memory block to be reclaimed, the starting address is used to indicate the first address of the memory block to be reclaimed, and the length information is used to indicate the number of the memory blocks to be reclaimed.

10. The memory according to claim 8, characterized in that: When the media controller and the memory controller communicate using a fourth-generation double-bit rate synchronous DDR4 interface, the release command includes the following format: Among them, ADDR is used to indicate the starting address of the memory block to be recovered; OPCODE is used to indicate the erase mode information; LENGTH is used to indicate the length information of the memory block to be recovered; CKE_0 bit is used to indicate the clock enable signal; Previous bit is used to indicate whether the previous clock is valid; Current bit is used to indicate whether the current clock is valid; CS is the chip select signal.

11. The memory according to claim 8, characterized in that: When the media controller and the memory controller communicate using a fifth-generation double-bit rate synchronous DDR5 interface, the release command includes the following format: Among them, ADDR is used to indicate the starting address of the memory block to be reclaimed; OPCODE is used to indicate the erase mode information; LENGTH is used to indicate the length information of the memory block to be reclaimed; CS is the chip select signal; and the RFU field is a reserved bit.

12. The memory according to any one of claims 8 to 11, characterized in that: The media controller is also used for: Deleting the mapping relationship between the memory logical address of the memory block and the corresponding memory physical address according to the memory logical address information; Add the memory physical address of the memory block to a memory free list.

13. The memory according to any one of claims 8 to 11, characterized in that: The release command also includes erase mode indication information, and the media controller is further used for: When the erasure mode indication information indicates erasing the data information in the memory block, the preset data is written into the memory block.

14. The memory according to any one of claims 8 to 11, characterized in that: The media controller is also used for: Receive a read command sent by the memory controller, wherein the read command includes the memory logical address information of the data to be read; Determining that no corresponding memory physical address is found according to the memory logical address information; Sending error response information to the memory controller; wherein the error response information is used to indicate that the read command execution fails.

15. The memory according to any one of claims 8 to 11, characterized in that: The memory includes a non-volatile dual in-line memory module (NVDIMM).

16. A computer system, characterized in that: The computer system includes a processor, a memory controller, a media controller, and a non-volatile memory connected to the media controller, wherein the memory controller communicates with the media controller through an NVDIMM-P protocol, the media controller and the memory controller communicate using a fourth-generation double-bit rate synchronous DDR4 interface or a fifth-generation double-bit rate synchronous DDR5 interface, and the non-volatile memory includes a plurality of memory blocks; wherein the memory controller is used to: Sending a release command to the media controller, wherein the release command includes memory logical address information of the memory block to be reclaimed; The media controller is used for: receiving the release command and the extended address command sent alternately by the memory controller, wherein both the release command and the extended address command include memory logical address information of the memory block to be reclaimed; The memory block is recycled according to the memory logical address information, wherein the recycled memory block is an available memory block.

17. The system according to claim 16, characterized in that The memory logical address information includes the starting address and length information of the memory block to be reclaimed, the starting address is used to indicate the first address of the memory block to be reclaimed, and the length information is used to indicate the number of the memory blocks to be reclaimed.

18. The system according to claim 16, characterized in that When the media controller and the memory controller communicate using a fourth-generation double-bit rate synchronous DDR4 interface, the release command includes the following format: Among them, ADDR is used to indicate the starting address of the memory block to be recovered; OPCODE is used to indicate the erase mode information; LENGTH is used to indicate the length information of the memory block to be recovered; CKE_0 bit is used to indicate the clock enable signal; Previous bit is used to indicate whether the previous clock is valid; Current bit is used to indicate whether the current clock is valid; CS is the chip select signal.

19. The system according to claim 16, characterized in that When the media controller and the memory controller communicate using a fifth-generation double-bit rate synchronous DDR5 interface, the release command includes the following format: Among them, ADDR is used to indicate the starting address of the memory block to be reclaimed; OPCODE is used to indicate the erase mode information; LENGTH is used to indicate the length information of the memory block to be reclaimed; CS is the chip select signal; and the RFU field is a reserved bit.

20. The system according to any one of claims 16 to 19, characterized in that: The release command also includes erase mode indication information; the media controller is also used for: When the erasure mode indication information indicates erasing the data information in the memory block, the preset data is written into the memory block.

21. The system according to any one of claims 16 to 19, characterized in that: The memory controller is further configured to: Receive a memory access request sent by a processor, wherein the memory access request includes the memory logical address information of the data to be read; The memory controller is further used to send a read command to the media controller according to the memory access request, wherein the read command carries the memory logical address information; The media controller is also used for: Determining that no corresponding memory physical address is found according to the memory logical address information; Sending error response information to the memory controller; wherein the error response information is used to indicate that the read command execution failed; The memory controller is further configured to send read failure information to the processor according to the error response information.