Algorithm for optimizing power-on starting recovery time after SSD abnormal power failure

By optimizing the power-on recovery algorithm after an abnormal SSD power failure, and by delaying the mapping table update and selecting blocks with less valid data for garbage collection, the problem of excessively long power-on recovery time after an abnormal SSD power failure has been solved, resulting in a faster recovery process.

CN119003237APending Publication Date: 2024-11-22HEFEI DATANG STORAGE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410919851.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-10
Publication Date
2024-11-22

AI Technical Summary

Technical Problem

In existing technologies, the startup time of an SSD after an abnormal power outage is relatively long and cannot be effectively shortened.

Method used

The algorithm for restoring power after an abnormal SSD power failure has been optimized. By not immediately triggering mapping table updates and garbage collection upon power-up, garbage collection is performed on blocks with less valid data, and the trigger threshold for static mapping table GC is appropriately increased to control the timing of mapping table and data GC.

Benefits of technology

It significantly shortens the recovery time of SSD after abnormal power loss and improves the normal operating efficiency of SSD.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119003237A_ABST
    Figure CN119003237A_ABST
Patent Text Reader

Abstract

The invention discloses an algorithm for optimizing power-on start recovery time after SSD abnormal power failure, and the algorithm comprises the following steps: S001, starting to find the finally stored mapping table information; s002, judging whether the valid data volume of the mapping table needing to be updated currently exceeds 40W or not; and S003, if the valid data volume in the step S002 is lower than 40W, updating the mapping table. According to the method, the time is increased in some cases due to the fact that the time consumed in the process of updating the mapping table is different according to the situation before power failure, so that in the first optimization step, the mapping table is not immediately triggered to be updated in the power-on process, and a block of the current mapping table is not used as a special block to carry out GC (Gas Collapse) action at the first time; according to the method, the block of the first mapping table with the record at present is selected to be placed in the mapping table block group needing GC, and GC is carried out when the SSD runs normally, so that a part of time is saved, and the recovery time of re-electrification after abnormal power failure can be shortened as much as possible.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data storage, and in particular to an algorithm for optimizing the power-on startup time of an SSD after abnormal power failure. Background Art

[0002] The so-called abnormal power failure means that the SSD is powered off without receiving the power failure notification from the host; or the SSD receives the power failure notification from the host, but the power is cut off before it has time to process the information that needs to be written to the flash memory. Abnormal power failure may cause data loss. For example, the data cached in the SSD is not written to the flash memory in time, and the power failure causes this part of the data to be lost. In addition, according to the characteristics of flash memory, if the power failure occurs when writing the Upper page of the MLC, the corresponding LowerPage data will be destroyed, which means that the data previously written to the flash memory may also be lost due to abnormal power failure. The purpose of abnormal power failure recovery is, on the one hand, to restore user data as much as possible and minimize the loss; on the other hand, to allow the SSD to work normally after an abnormal power failure.

[0003] In the existing technology, when an SSD encounters an abnormal power failure, it can restore user data as much as possible and can also work normally. However, the time from restoring normal power to normal operation is short or long. This article provides an optimization algorithm to make this process as short as possible. Summary of the invention

[0004] The purpose of the present invention is to solve the shortcomings of the prior art and to propose an algorithm for optimizing the power-on recovery time after an abnormal power outage of an SSD, so as to shorten the power-on recovery time after an abnormal power outage as much as possible.

[0005] In order to achieve the above object, the present invention adopts the following technical solutions: An algorithm for optimizing the power-on startup time of an SSD after an abnormal power outage, the algorithm comprises the following steps: S001: Start, find the last stored mapping table information; S002: Determine whether the amount of valid data in the mapping table that needs to be updated currently exceeds 40W; S003: If the amount of valid data in S002 is less than 40W, update the mapping table; S004: Erase all free blocks and re-store all temporary blocks, rebuild the mapping table and update it to the flash memory, and end the execution; S005: If the amount of valid data in S002 exceeds 40W, the last stored mapping table information block is placed in the group that needs garbage collection, and a static GC threshold for the mapping table is provided; S006: The data GC selects several blocks for garbage collection and repeats step S004.

[0006] Preferably, in S005, power-on does not immediately trigger a mapping table update, and the blocks in the current mapping table are not treated as special blocks for the first GC (Garbage Collection) action. Instead, the blocks in the first mapping table with the current record are placed in the mapping table block group that requires GC, and GC is performed when the SSD is operating normally.

[0007] Preferably, the principle followed in selecting the S006 block is to select the one with less valid data.

[0008] Preferably, in S006, the number of blocks selected each time is reduced by selecting a block with the least valid data as the basis of the source flash memory block.

[0009] Compared with the prior art, the beneficial effect of the present invention is that the process of updating the mapping table in the present invention takes different time depending on the situation before the power failure, and in some cases it will increase the time. Therefore, the first step of optimization is not to trigger the mapping table update immediately after power-on, and not to treat the block of the current mapping table as a special block for the first GC (Garbage Collection) action. Instead, the block of the first mapping table with the current record is placed in the mapping table block group that needs GC, and GC is performed when the SSD is running normally, thereby saving some time and shortening the recovery time after powering on again after an abnormal power failure as much as possible. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] In order to more specifically and intuitively illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art are briefly introduced below.

[0011] Figure 1 The flowchart of the present invention after adding the optimization scheme; Figure 2 This is a flowchart of abnormal power failure and power-on recovery before the present invention is optimized. DETAILED DESCRIPTION

[0012] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments.

[0013] Reference Figure 1-2 , an algorithm for optimizing the power-on startup time of an SSD after abnormal power failure, the algorithm comprises the following steps: S001: Start, find the last stored mapping table information; S002: Determine whether the amount of valid data in the mapping table that needs to be updated currently exceeds 40W; S003: If the amount of valid data in S002 is less than 40W, update the mapping table; S004: Erase all free blocks and re-store all temporary blocks, rebuild the mapping table and update it to the flash memory, and end the execution; S005: If the amount of valid data in S002 exceeds 40W, the last stored mapping table information block is placed in the group that needs garbage collection, and a static GC threshold for the mapping table is provided; S006: The data GC selects several blocks for garbage collection and repeats step S004.

[0014] After normal power supply, the mapping table will be updated. The time taken to update the mapping table varies depending on the situation before power failure. In some cases, it will take longer. Therefore, the first step of optimization is not to trigger the mapping table update immediately after power-on. The blocks in the current mapping table are not treated as special blocks for the first GC (Garbage Collection) action. Instead, the blocks in the first mapping table with the current record are placed in the mapping table block group that needs GC. GC is performed when the SSD is running normally, thereby saving some time.

[0015] In this implementation scheme, when power is turned on, the mapping table update is not triggered immediately and the mapping table GC is not performed. In the long run, the required mapping table blocks will be insufficient. When a certain threshold is reached, the static mapping table GC will be triggered. The second step of optimization is to appropriately increase the trigger threshold of the static mapping table GC to artificially prevent it from performing the mapping table GC under the current circumstances.

[0016] In this implementation scheme, the third step of optimization is to select blocks with less valid data from a preferred perspective for the unavoidable mapping table GC, and also to select as few blocks as possible as long as they meet the current usage requirements.

[0017] In the fourth step of optimization in this embodiment, the necessary data GC guides it to perform forced GC. Because forced GC does not occur frequently, its GC time can be shortened by control. The control method can reduce the number of blocks selected each time based on selecting the block with the least valid data as the source flash memory block.

[0018] After abnormal power outage testing with specific testing instruments, the recovery time after abnormal power outage has improved to a certain extent.

[0019] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes according to the technical scheme and inventive concept of the present invention within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.

Claims

1. An algorithm to optimize the power-on startup time after abnormal power failure of SSD. It is characterized in that The algorithm consists of the following steps: S001: Start, find the last stored mapping table information; S002: Determine whether the amount of valid data in the mapping table that needs to be updated currently exceeds 40W; S003: If the amount of valid data in S002 is less than 40W, update the mapping table; S004: Erase all free blocks and re-store all temporary blocks, rebuild the mapping table and update it to the flash memory, and end the execution; S005: If the amount of valid data in S002 exceeds 40W, the last stored mapping table information block is placed in the group that needs garbage collection, and a static GC threshold for the mapping table is provided; S006: The data GC selects several blocks for garbage collection and repeats step S004.

2. According to claim 1, an algorithm for optimizing the power-on startup time of an SSD after an abnormal power outage, It is characterized in that In S005, power-on does not immediately trigger a mapping table update, and the blocks in the current mapping table are not treated as special blocks for the first GC (Garbage Collection) action. Instead, the blocks in the first mapping table with the current record are placed in the mapping table block group that requires GC, and GC is performed when the SSD is operating normally.

3. According to claim 2, an algorithm for optimizing the power-on startup time of an SSD after abnormal power failure, It is characterized in that The principle followed in selecting the S006 block is to select the one with less valid data.

4. According to claim 3, an algorithm for optimizing the power-on startup time of an SSD after abnormal power failure, It is characterized in that In S006, the number of blocks selected each time is reduced by selecting the block with the least valid data as the basis of the source flash memory block.