A bad block management method based on NAND Flash

By combining the skip strategy and the replacement strategy, the management method is dynamically adjusted according to the number of bad blocks on Die, the bottleneck problem of writing parallelism and available space in NAND Flash bad block management is solved, and a more efficient bad in NAND Flash is achieved Block management.

CN113921071BActive Publication Date: 2024-11-08SHANDONG SINOCHIP SEMICON CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202111157900.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-30
Publication Date
2024-11-08
Estimated Expiration
2041-09-30

AI Technical Summary

Technical Problem

When the existing NAND Flash bad block management method handles bad blocks on different Dies, it cannot effectively balance the write parallelism and the utilization of available space, resulting in bottlenecks in writing performance and available space.

Method used

Combining the skip strategy and the replacement strategy, set the threshold according to the number of bad blocks on each die, and dynamically adjust the bad block management method. In the life cycle of SSD, the replacement strategy is initially adopted. As the bad blocks increase, it is converted into a skip strategy. The number of bad blocks in each Die is counted to judge the adjustment management method.

Benefits of technology

By dynamically adjusting the bad block management strategy, the write parallelism is ensured while avoiding the reduction of available space caused by too many bad blocks in a certain Die, which improves the writing efficiency and utilization of available space.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113921071B_ABST
    Figure CN113921071B_ABST
Patent Text Reader

Abstract

The present invention discloses a bad block management method based on NAND Flash. The method combines two bad block management strategies and adopts different bad block management methods to manage bad blocks according to the bad block conditions on different Dies of SSD. At the beginning of the life cycle of SSD, there are fewer bad blocks at this time, and it is appropriate to adopt a bad block management method with a replacement strategy. As time goes by, the number of bad blocks increases, and it is appropriate to adopt a skip strategy to manage the bad blocks. The number of bad blocks on each Die is counted throughout the life cycle of SSD, and the bad block management method is adjusted according to the number of bad blocks on each Die. The advantages of the two bad block management methods are combined to ensure write parallelism while avoiding the situation where the entire SSD has less available space due to too many bad blocks on a certain Die.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of storage, and in particular to a bad block management method based on NAND Flash. Background Art

[0002] Due to the process characteristics of NAND Flash itself, bad blocks will appear more or less when leaving the factory, and as the flash memory blocks are used, especially due to erase and write wear, some good blocks will become bad blocks, so it is very necessary to rationally manage bad blocks. Reasonable bad block management methods can not only reduce the error rate when writing data, but also help improve writing efficiency, which is crucial to writing performance.

[0003] There are two general bad block management methods: one is to adopt a skip strategy, and the other is to adopt a replacement strategy.

[0004] The skip strategy is to abandon the block directly when a bad block is encountered during writing according to the bad block table saved by the user, and directly write the data to the corresponding block on the next Die. This bad block management method is relatively simple to implement and does not require the maintenance of the mapping table, but it will cause a loss of write parallelism, especially when bad blocks appear in different locations on each Die, which will seriously reduce the write parallelism and affect the write performance.

[0005] The replacement strategy is to divide the flash memory space into two areas: user space and reserved space. When writing in the user space, if a bad block is found on a certain Die, the written data should be written to the block of the reserved space of the Die without jumping to the next Die. The replacement strategy is more complicated to implement than the skip strategy. On the one hand, the flash memory space should be reasonably divided into two parts, and on the other hand, a mapping table from bad blocks to replacement blocks should be maintained. Its advantage is obvious, that is, it can ensure the parallelism of writing and further ensure the writing performance, but it also has the barrel effect. If a certain Die has many bad blocks due to factory defaults or unreasonable erasure during use, then this Die will become the bottleneck of the entire SSD, and the available space of the entire SSD will become smaller due to the reduction of the available space of this Die. Summary of the invention

[0006] The technical problem to be solved by the present invention is to provide a bad block management method based on NAND Flash, which combines two bad block management strategies and adopts different bad block management methods to manage bad blocks according to the bad block conditions on different dies of SSD.

[0007] In order to solve the above problem, the technical solution adopted by the present invention is: a bad block management method based on NAND Flash, comprising the following steps:

[0008] Step 1: Power on;

[0009] Step 2: Scan the entire disk and count the initial bad block number cnt on the i-th Die i , 0≤i≤N-1, N is the number of all the dies of Nand flash on the entire SSD;

[0010] Step 3: Set a threshold TH1. If the number of bad blocks on a die exceeds this threshold, the die is considered bad. If the number of bad blocks on the die does not exceed this threshold, the die is considered good.

[0011] Step 4: Define a parameter count for counting the number of bad dies, set a threshold TH2, if count is greater than or equal to TH2, change the bad block management strategy to the skip strategy, and end the process. If cnt is less than TH2, execute step 5;

[0012] Step 5: When a bad block is encountered during data writing, the number of bad blocks on the corresponding Die is increased by 1. At the same time, the firmware adopts a replacement strategy to manage the bad blocks and returns to step 3.

[0013] Furthermore, the skip strategy is to abandon the block directly when encountering a bad block during writing, and directly write the data to the corresponding block on the next Die; the replacement strategy is to divide the flash memory space into two areas: user space and reserved space. When writing in the user space, if a bad block is found on a certain Die, the written data must be written to the block in the reserved space of the Die without jumping to the next Die.

[0014] Furthermore, in step 2, the bad block management strategy is initialized as a replacement strategy, and the SSD flash memory space is divided into user space and reserved space. In step 3, when the bad block management strategy is changed to a skip strategy, the reserved space and user space division conditions are deleted at the same time, and they are all used as user space, and the process ends.

[0015] Furthermore, when performing a write operation normally and encountering a write error while writing on a certain block, the block is rewritten. If the write error occurs again, the block is identified as a bad block.

[0016] Furthermore, when continuing to use the replacement strategy to manage bad blocks, the mapping table corresponding to the bad blocks to the replacement blocks is recorded at the same time. If power is off, the mapping table corresponding to the bad blocks to the replacement blocks is saved. When power is on, the mapping table corresponding to the bad blocks to the replacement blocks is loaded, and the write operation is performed normally. The process jumps to step two.

[0017] Furthermore, the threshold TH1 is taken as 1 / 4 of the total number of blocks on each Die.

[0018] Furthermore, the threshold TH2 is N / 4.

[0019] Beneficial effects of the present invention: The present invention combines two bad block management strategies, and adopts different bad block management methods to manage bad blocks according to the bad block conditions on different Dies of the SSD. At the beginning of the life cycle of the SSD, there are fewer bad blocks at this time, and it is appropriate to adopt a bad block management method with a replacement strategy. As time goes by, the number of bad blocks increases, and it is appropriate to adopt a skip strategy to manage the bad blocks. During the entire life cycle of the SSD, the number of bad blocks on each Die is counted, and the bad block management method is adjusted according to the number of bad blocks on each Die. Combining the advantages of the two bad block management methods can ensure write parallelism while avoiding the situation where the entire SSD has less available space due to too many bad blocks on a certain Die. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 Schematic diagram of two bad block management strategies;

[0021] Figure 2 This is a flow chart of the method described in Example 1. DETAILED DESCRIPTION

[0022] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments.

[0023] Example 1

[0024] This embodiment discloses a bad block management method based on NAND Flash, which combines two bad block management strategies, namely, a skip strategy and a replacement strategy. Figure 1 As shown in FIG. 1 , two schematic diagrams of bad block management strategies are shown. White blocks represent blank blocks with no data written into them, black blocks represent bad blocks encountered during writing, and gray blocks represent blocks with data written into them. Figure 1 The SSD in the example has four channels, each of which has a flash die. That is, when writing data, the maximum parallelism is 4. When writing data, it is found that block 2 on Die 1 is a bad block. For the skip strategy, the data will be written to block 3 in Die 2 (such as Figure 1 For the replacement strategy, the flash memory space needs to be divided into user space and reserved space, and the data that should have been written on block 2 of Die 1 is written to block 2 of the reserved space in Die 1. , On (such as Figure 1 At the same time, the mapping table from bad blocks to replacement blocks needs to be updated.

[0025] like Figure 2 As shown, the bad block management method described in this embodiment includes the following steps:

[0026] Step 1: Power on;

[0027] Step 2: Scan the entire disk and count the initial bad blocks on each Die. i (0≤i≤N-1, N is the number of all dies in the Nand flash on the entire SSD);

[0028] Step 3: Set a threshold TH1 (this threshold is generally 1 / 4 of the total number of blocks on each Die). If the number of bad blocks on a Die exceeds this threshold, the Die is considered a bad Die. If the number of bad blocks on the Die does not exceed this threshold, the Die is considered a good Die.

[0029] Step 4: Define a parameter count for counting the number of bad dies, set a threshold TH2 (this threshold is generally N / 4), if count is greater than or equal to TH2, change the bad block management strategy to the skip strategy, and end the process. If cnt is less than TH2, execute step 5;

[0030] Step 5: When a bad block is encountered during data writing, the number of bad blocks on the corresponding Die is increased by 1. At the same time, the firmware adopts a replacement strategy to manage the bad blocks and returns to step 3.

[0031] Example 2

[0032] This embodiment discloses a method applicable to the case where the Nand flash used by the SSD has a die that is an integer multiple of 4, and adjusts the bad block management strategy by determining the number of bad blocks on different dies. The specific steps are as follows:

[0033] Step 1: When powered on for the first time, scan the bad blocks on each Die and initialize the bad block count value on each Die. The bad block management strategy adopts the replacement strategy to divide the SSD flash memory space into user space and reserved space.

[0034] Step 2: Perform a write operation normally. When writing to a block, if a write error occurs, rewrite the block. If the write error occurs again, the block is identified as a bad block and the bad block count of the Die where the block is located is increased by one. Determine whether the count value is greater than the set threshold. If it exceeds the threshold, the Die is identified as a bad Die and the bad Die count value is increased by one. If it does not exceed the threshold, the Die is identified as a good Die.

[0035] Step 3: Determine whether the bad die count value is greater than the set threshold. If it exceeds the threshold, change the bad block management strategy to the skip strategy, delete the reserved space and user space division conditions, and use them all as user space, ending the process;

[0036] Step 4: If the bad die count value is not greater than the set threshold, continue to perform the write operation, still use the replacement strategy to manage the bad blocks, and record the mapping table corresponding to the bad blocks to the replacement blocks;

[0037] Step 5: If power failure occurs, save the mapping table from bad blocks to replacement blocks;

[0038] Step 6: When power is turned on, the mapping table corresponding to the bad block to the replacement block is loaded, the write operation is performed normally, and the process jumps to step 2.

[0039] The method described in this embodiment combines two bad block management strategies, namely the skip strategy and the replacement strategy, and adopts different bad block management methods according to the bad block conditions on different dies of the SSD, giving full play to the advantages of the two bad block management strategies. On the one hand, it can ensure the parallelism of writing, reduce the error rate of data writing, and improve writing efficiency. On the other hand, it can reduce the barrel effect caused by too many bad blocks on one or several dies.

[0040] The above description is only the basic principle and preferred embodiments of the present invention. Improvements and substitutions made by those skilled in the art based on the present invention belong to the protection scope of the present invention.

Claims

1. A bad block management method based on NAND Flash, characterized in that: The following steps are involved: Step 1: Power on; Step 2: Scan the entire disk and count the initial bad block number cnt on the i-th Die i , 0≤i≤N-1, N is the number of all NAND Flash Dies on the entire SSD; Step 3: Set a threshold TH1. If the number of bad blocks on a die exceeds this threshold, the die is considered bad. If the number of bad blocks on the die does not exceed this threshold, the die is considered good. Step 4: Define a parameter count for counting the number of bad dies, set a threshold TH2, if count is greater than or equal to TH2, change the bad block management strategy to the skip strategy, and end the process; if count is less than TH2, execute step 5; Step 5: When a bad block is encountered during data writing, the number of bad blocks on the corresponding Die is increased by 1, and the firmware adopts a replacement strategy to manage the bad blocks, and returns to step 3; The skip strategy is to abandon a bad block when writing and write the data directly to the corresponding block on the next Die. The replacement strategy is to divide the flash memory space into two areas: user space and reserved space. When writing in the user space, if a bad block is found on a certain Die, the written data will be written to the block in the reserved space of the Die without jumping to the next Die. In step 2, the bad block management strategy is initialized as the replacement strategy, and the SSD flash memory space is divided into user space and reserved space. In step 4, when the bad block management strategy is changed to the skip strategy, the reserved space and user space division conditions are deleted at the same time, and they are all used as user space.

2. The bad block management method based on NAND Flash according to claim 1, characterized in that: When performing a write operation normally and encountering a write error while writing on a certain block, the block is rewritten. If the write error occurs again, the block is identified as a bad block.

3. The bad block management method based on NAND Flash according to claim 1, characterized in that: When continuing to use the replacement strategy to manage bad blocks, the mapping table corresponding to the bad blocks to the replacement blocks is recorded at the same time. If power is off, the mapping table from the bad blocks to the replacement blocks is saved. When power is on, the mapping table from the bad blocks to the replacement blocks is loaded, and the write operation is performed normally. The process jumps to step 2.

4. The bad block management method based on NAND Flash according to claim 1, characterized in that: The threshold TH1 is 1 / 4 of the total number of blocks on each Die.

5. The bad block management method based on NAND Flash according to claim 1, characterized in that: The threshold TH2 is N / 4.

Citation Information

Cited By

  • NAND FLASH bad block marking method

    CN116909483A

  • A method for marking bad blocks in NAND flash memory

    CN116909483B