SSD bad block replacement method

By using hardware acceleration modules to build a bad block mapping table in SSD, the power loss and efficiency impact caused by bad block processing in the prior art is solved, and the effect of reducing delay and power consumption is achieved.

CN119937916APending Publication Date: 2025-05-06浙江元储科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411935370.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2023-12-29
Filing Date
2024-12-26
Publication Date
2025-05-06

AI Technical Summary

Technical Problem

When existing SSD firmware deals with bad blocks, it needs to frequently calculate and look up mapping tables, resulting in power loss and efficiency impacts.

Method used

Use the hardware acceleration module to calculate the logical physical address and actual physical address before and after the mapping, build a bad block mapping table, and reduce the delay and power consumption of NAND writes.

Benefits of technology

The use of hardware acceleration module does not affect the speed of parallel reading and writing of NAND flash memory, reduces the load of the SSD master, reduces power consumption, and reduces the delay of the physical link.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119937916A_ABST
    Figure CN119937916A_ABST
Patent Text Reader

Abstract

The invention provides a bad block replacement method for an SSD (Solid State Disk). The method comprises the following steps: writing a physical address of a bad block and a physical address of a good block for replacing the bad block into a hardware acceleration module to construct a bad block mapping table; when the read-write request is processed, if the physical address corresponding to the logic address of the read-write request is not in the bad block mapping table, the physical address corresponding to the logic address of the read-write request is used for reading and writing, and if the physical address corresponding to the logic address of the read-write request is in the bad block mapping table, the read-write request is read and written. And if not, replacing the physical address of the bad block with the physical address of the good block for reading and writing. According to the method, the hardware acceleration module is used for calculating the logic physical address and the actual physical address before and after mapping, replacement mapping of the nand logic address and the physical address is achieved, meanwhile, the load of a CPU in the read-write process is reduced, the SSD power consumption is reduced, and the time delay of a physical link is also reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of solid state disk storage, and more particularly to a method for replacing bad blocks of an SSD. Background Art

[0002] Bad blocks will be generated when the SSD is shipped and during operation. Since the physical location of the bad blocks is random, when the existing firmware writes the SSD physical address, the random bad blocks will cause the physical address to be discontinuous. While ensuring the continuity of the write address, issuing NAND commands in parallel through multiple channels will affect the read and write speed. In order to ensure the continuity of physical location access, the SSD firmware will map the block location of bad blocks in different block locations of the same physical stripe to the block location of good blocks. The existing technology is implemented by storing the mapping relationship in the firmware. Each physical location access needs to be calculated multiple times by the SSD controller chip, and each IO needs to calculate and look up the mapping table multiple times, which has a certain power loss and efficiency impact. Summary of the invention

[0003] The purpose of the present invention is to provide an SSD bad block replacement method which uses a hardware acceleration module to calculate the logical physical address and the actual physical address before and after mapping, reduces the delay of NAND writing, and reduces power consumption.

[0004] According to one aspect of the present invention, a bad block replacement method for an SSD is provided.

[0005] Writing the physical address of the bad block and the physical address of the good block used to replace the bad block into the hardware acceleration module to construct a bad block mapping table;

[0006] When processing read and write requests:

[0007] If the physical address corresponding to the logical address of the read / write request is not in the bad block mapping table, the physical address corresponding to the logical address of the read / write request is used for reading and writing,

[0008] If the physical address corresponding to the logical address of the read / write request is in the bad block mapping table, the physical address of the good block is used to replace the physical address of the bad block for reading and writing.

[0009] In some implementations, the bad blocks include bad blocks generated during initialization and bad blocks generated during operation.

[0010] In some implementations, when the SSD is initialized, a write / erasure test is performed on multiple blocks in all NAND flash memories to find the physical addresses of all bad blocks.

[0011] In some implementations, a good block that can replace a bad block is found by a circular search.

[0012] In some implementations, the flash channel index, the chip index, the index of the bad block, and the good block are written into the hardware acceleration module through a register to construct a bad block mapping table.

[0013] In some implementations, the physical address corresponding to the logical address of the read / write command is searched through the FTL module, and the physical address is written into the NAND controller, and the NAND controller searches the bad block mapping table.

[0014] The beneficial effects are as follows: the present invention uses a hardware acceleration module to replace the mapping relationship between the bad logical address block and the physical address with the mapping relationship between the logical address and the good block physical address without affecting the parallel reading and writing speed of the NAND flash memory; at the same time, it reduces the load of the SSD master controller during the reading and writing process, reduces the power consumption of the SSD, and also reduces the delay of the physical link. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 A schematic diagram of a bad block search process of a bad block replacement method for an SSD according to an embodiment of the present invention;

[0016] Figure 2 The present invention is a flowchart of a read-write physical address mapping of a method for replacing a bad block of an SSD according to an embodiment of the present invention. DETAILED DESCRIPTION

[0017] The present invention designs a hardware acceleration module. When bad blocks are generated during the power-on initialization and operation process of the SSD, the module finds as many good blocks as possible that can be replaced for the bad blocks through cyclic search, and writes the physical addresses of the bad blocks and the physical addresses of the good blocks used to replace the bad blocks into the hardware acceleration module through registers for building a bad block mapping table; each time the firmware writes or reads the physical address corresponding to the logical address, the hardware acceleration module searches for all written mapping relationships in the bad block mapping table to find the actual physical address.

[0018] Specifically, Figure 1As shown in the figure, the minimum unit for flash erasure and resource management in the SSD system is a block, and the physical address of a block is determined by the flash channel, chip index, and block index. When the SSD is initialized, all blocks of the flash NAND are erased and written to find the physical addresses of all bad blocks, and the information is recorded in the bad block table. As many good physical blocks as possible are found to replace the bad blocks through a loop search. The flash channel index, chip (CE) index, block index of good blocks, and block index of bad blocks of all NAND flash memories are written to the hardware acceleration module through registers in turn. The hardware acceleration module builds a bad block mapping table for search during reading and writing. At the same time, the bad blocks generated during runtime will also trigger the calculation of the mapping relationship, and these updates will be written into the bad block mapping table. The bad block mapping table maps the physical address of the bad block to the physical address of the good block to ensure that the data can be correctly written to the new good block.

[0019] like Figure 2 As shown in the figure, when the host reads and writes the physical address of the SSD, the physical address corresponding to the logical address of the read and write command is first found through the FTL module inside the SSD, and this physical address is written to the NAND controller. The NAND controller uses an algorithm to find the bad block mapping table built by the hardware acceleration module. If this physical address does not exist in the mapping table, the original physical address is used for reading and writing. If the mapping relationship is found in the mapping table, the current bad block physical address is replaced with the good block physical address for reading and writing, thereby achieving the purpose of accelerating and simplifying reading and writing.

[0020] Specifically, the FTL module is responsible for converting the logical address sent by the host into the actual physical address of the NAND flash memory inside the SSD. The host sends a read / write command to the SSD through the interface, and the read / write command includes the logical address. After the SSD receives the command, the FTL module searches the internal L2P mapping table to find the physical address corresponding to the logical address. After the FTL module determines the physical address of the data, it sends the physical address to the NAND controller, and the NAND controller interacts with the NAND flash memory to perform the actual read / write operation. If there is no record of the physical address in the mapping table built by the hardware acceleration module, this means that the physical address is new or has not been mapped before. In this case, the NAND controller will use this physical address for read / write operations, because this address is directly obtained by the FTL module based on the logical address conversion without any modification or replacement of the mapping table. If the mapping relationship is found in the mapping table built by the hardware acceleration module, this usually means that the current physical address is a physical address that has been marked as a bad block. In this case, the FTL module replaces the bad block physical address with the good block physical address, and the NAND controller uses the good block physical address for read / write operations. By using mapping tables and hardware acceleration modules, SSDs can speed up read and write operations, reduce CPU operations, and reduce software complexity.

[0021] The above are only some embodiments of the present invention. For those skilled in the art, several modifications and improvements can be made without departing from the creative concept of the present invention, which all belong to the protection scope of the present invention.

Claims

1. A method for replacing a bad block of an SSD, characterized in that: include: Writing the physical address of the bad block and the physical address of the good block used to replace the bad block into the hardware acceleration module to construct a bad block mapping table; When processing read and write requests: If the physical address corresponding to the logical address of the read / write request is not in the bad block mapping table, the physical address corresponding to the logical address of the read / write request is used for reading and writing, If the physical address corresponding to the logical address of the read / write request is in the bad block mapping table, the physical address of the good block is used to replace the physical address of the bad block for reading and writing.

2. The bad block replacement method of SSD according to claim 1, characterized in that: The bad blocks include bad blocks generated during initialization and bad blocks generated during operation.

3. The bad block replacement method of SSD according to claim 2, characterized in that: When the SSD is initialized, multiple blocks in all NAND flash memories are erased and written to find the physical addresses of all bad blocks.

4. The bad block replacement method of SSD according to claim 1, characterized in that: Good blocks that can replace bad blocks are found through a circular search.

5. The bad block replacement method of SSD according to claim 1, characterized in that: The flash channel index, the chip index, the index of the bad block and the good block are written into the hardware acceleration module through a register to construct a bad block mapping table.

6. The bad block replacement method of SSD according to claim 1, characterized in that: The physical address corresponding to the logical address of the read / write command is searched through the FTL module, and the physical address is written into the NAND controller, and the NAND controller searches the bad block mapping table according to the physical address.