A method, device and equipment for storing and restoring SSD metadata snapshots

By saving and recovery in SSD metadata snapshot, the ratio of the preset power recovery time is used to reflect the ratio of Base Buffer and Delta Buffer, calculate the write amplification value and adjust the ratio The problem of balanced SSD has achieved efficient recovery and long life of SSD.

CN115080454BActive Publication Date: 2025-01-24INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210904975.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-29
Publication Date
2025-01-24
Estimated Expiration
2042-07-29

AI Technical Summary

Technical Problem

The prior art lacks an effective solution to balance write amplification and power-on recovery time, especially in the process of saving and restoring SSD metadata snapshots.

Method used

By the preset power recovery time reflecting the SSD metadata brush writing frame, the size of the Base Buffer in the frame to the Delta Buffer is calculated to calculate the magnifying value, and adjust the ratio as required to balance the power recovery time and the requirements of large writing.

Benefits of technology

While extending the life of the SSD, it can quickly enter the working state after SSD is called, and effectively balances the time of writing and the recovery time of power -on.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115080454B_ABST
    Figure CN115080454B_ABST
Patent Text Reader

Abstract

The present application relates to the field of computer technology, and discloses a method for preserving and restoring SSD metadata snapshots. For a method of preserving metadata using delta+base snapshots, the method reversely infers the ratio of the base buffer size to the delta buffer size in the SSD metadata flush frame by presetting the power-on recovery time, and then obtains the write amplification value. Then, it is evaluated whether the write amplification meets the requirements. If not, the ratio is adjusted, that is, the ratio of the base buffer size to the delta buffer size is adjusted, so as to balance the power-on recovery time and the write amplification requirements, while extending the life of the SSD, allowing the SSD to quickly enter a working state after power-on. In addition, the present application also provides an SSD metadata snapshot preservation and recovery device, equipment, and readable storage medium, and its technical effects correspond to the technical effects of the above method.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method, device, equipment and readable storage medium for storing and restoring SSD metadata snapshots. Background Art

[0002] Metadata, also known as management data, is the core data for the normal operation of the SSD (Solid State Drives) system, including L2P (Logical To Physical Table), trim table, block info and other types. When the SSD is running, the metadata resides in the DDR of the SSD. When the SSD is powered off, the metadata residing in the DDR needs to be flushed to the NAND; when the SSD is powered on, the metadata needs to be read from the NAND and restored to the location in the DDR.

[0003] There are two common ways to save metadata: full copy saving and snapshot saving. The full copy saving method is that the SSD writes all metadata of this type to NAND during power-off. It is suitable for metadata with a relatively small amount of data, usually several times the size of the NAND SLC Page. The snapshot saving method, also known as the incremental saving method, collects the metadata changes (incremental data) during operation and stores them in the cache buffer. When the amount of incremental data meets the threshold condition, the quantitative metadata in the DDR can be copied to the cache buffer according to certain rules, and then the cache buffer is written to NAND. Obviously, the snapshot method is suitable for metadata with a relatively large amount of data. In the event of abnormal power failure, since the internal backup power supply of the SSD can only provide power for tens of ms, the SSD only needs to write a small amount of partial cache buffer to NAND.

[0004] During power-on recovery, for metadata saved in full, the SSD only needs to read out all of them and restore them to the corresponding positions in the DDR; for metadata saved in snapshot mode, the SSD needs to read the snapshots from the NAND in sequence. Within a single snapshot, the quantitative metadata stored in the cache buffer during the saving process is first restored to the corresponding position in the DDR, and then the incremental data stored in the snapshot is updated in sequence to the corresponding position in the DDR.

[0005] For the above-mentioned snapshot saving method, how to achieve a balance between write amplification and power-on recovery time is a problem that needs to be solved urgently by those skilled in the art. Summary of the invention

[0006] The purpose of this application is to provide a method, device, equipment and readable storage medium for storing and restoring SSD metadata snapshots, so as to solve the problem of the current lack of an effective solution to balance write amplification and power-on recovery time. The specific solution is as follows:

[0007] In a first aspect, the present application provides a method for storing and restoring SSD metadata snapshots, including:

[0008] S1. Determine the delta data update amount according to the preset power-on recovery time;

[0009] S2. determining the amount of user data to be written according to the delta data update amount and the user data unit size;

[0010] S3, determining a ratio according to the delta data update amount and the size of the L2P table;

[0011] S4, calculating a write amplification value according to the delta data update amount, the size of the L2P table, and the write amount of the user data;

[0012] S5, determining whether the write amplification value falls within the target range, and if so, outputting the ratio; otherwise, adjusting the ratio and returning to S4;

[0013] S6. According to the ratio finally outputted, snapshot storage and recovery of metadata are performed.

[0014] Optionally, determining the delta data update amount according to a preset power-on recovery time includes:

[0015] Determine the time consumed to read the entire L2P table from the NAND according to the size of the L2P table and the read bandwidth;

[0016] Subtracting the preset power-on recovery time from the time consumed for reading the entire L2P table to obtain the time consumed for updating the L2P table;

[0017] The delta data update amount is determined according to the time consumed for updating the L2P table.

[0018] Optionally, before determining the time consumed for reading the entire L2P table from the NAND according to the size and read bandwidth of the L2P table, the method further includes:

[0019] The SSD capacity is obtained, and the size of the L2P table is determined according to the SSD capacity.

[0020] Optionally, determining the size of the L2P table according to the SSD capacity includes:

[0021] According to the target formula, the size of the L2P table is calculated according to the SSD capacity, and the target formula is: L2P_TABLE_SIZE=SSD_CAP / 1000, wherein L2P_TABLE_SIZE represents the size of the L2P table, in GB; SSD_CAP represents the SSD capacity, in TB.

[0022] Optionally, determining the delta data update amount according to the time consumed for updating the L2P table includes:

[0023] By constructing a test case, the speed of the SSD controller randomly accessing the DDR with a preset size is obtained; and the delta data update amount is determined according to the speed and the time consumed for updating the L2P table.

[0024] Optionally, before determining the amount of user data to be written according to the delta data update amount and the user data unit size, the method further includes:

[0025] The size of the write cache is set to be equal to the SLC page size, and the write cache includes a header buffer, a delta buffer, and a base buffer.

[0026] Optionally, adjusting the ratio includes:

[0027] Reduce the base buffer size by 10%.

[0028] In a second aspect, the present application provides an SSD metadata snapshot storage and recovery device, comprising:

[0029] A delta data update amount determination module, used to determine the delta data update amount according to a preset power-on recovery time;

[0030] A base data total amount determination module, used to determine the user data write amount according to the delta data update amount and the user data unit size;

[0031] A ratio determination module, used to determine the ratio according to the delta data update amount and the size of the L2P table;

[0032] A write amplification value calculation module, used to calculate the write amplification value according to the delta data update amount and the size of the L2P table, and the write amount of the user data;

[0033] A judging module, used for judging whether the write amplification value falls within a target range, and if so, outputting the ratio; otherwise, triggering an adjusting module, used for adjusting the ratio, and returning to the write amplification value calculating module;

[0034] The saving and restoring module is used to save and restore the snapshot of metadata according to the ratio finally outputted.

[0035] Optionally, the delta data update amount determination module includes a time consumption submodule, a difference operation submodule and a determination submodule;

[0036] The time consumption submodule is used to determine the time consumed to read the entire L2P table from NAND according to the size of the L2P table and the read bandwidth;

[0037] A difference operation submodule is used to make a difference between the preset power-on recovery time and the time consumed for reading the entire L2P table to obtain the time consumed for updating the L2P table;

[0038] The determination submodule is used to determine the delta data update amount according to the time consumed by updating the L2P table.

[0039] Optionally, it also includes a module for determining the size of the L2P table;

[0040] The L2P table size determination module is used to obtain the SSD capacity and determine the size of the L2P table according to the SSD capacity.

[0041] Optionally, the L2P table size determination module is used to calculate the size of the L2P table according to the SSD capacity according to a target formula, and the target formula is: L2P_TABLE_SIZE=SSD_CAP / 1000, wherein L2P_TABLE_SIZE represents the size of the L2P table in GB; SSD_CAP represents the SSD capacity in TB.

[0042] Optionally, a submodule is determined to obtain a speed at which the SSD controller randomly accesses DDR with a preset size by constructing a test case; and a delta data update amount is determined according to the speed and the time consumed in updating the L2P table.

[0043] Optionally, a setting module is also included;

[0044] The setting module is used to set the size of the write cache to be equal to the SLC page size. The write cache includes the header cache, delta buffer, and base buffer.

[0045] Optionally, the adjustment module is used to reduce the base buffer size by 10%.

[0046] In a third aspect, the present application provides an SSD metadata snapshot storage and recovery device, including:

[0047] Memory: used to store computer programs;

[0048] Processor: used to execute the computer program to implement the SSD metadata snapshot storage and recovery method as described above.

[0049] In a fourth aspect, the present application provides a readable storage medium having a computer program stored thereon, and the computer program, when executed by a processor, is used to implement the SSD metadata snapshot storage and recovery method as described above.

[0050] The present application provides an SSD metadata snapshot preservation and recovery method, including: determining a delta data update amount according to a preset power-on recovery time; determining a user data write amount according to the delta data update amount and a user data unit size; determining a ratio according to the delta data update amount and an L2P table size; calculating a write amplification value according to the delta data update amount and the L2P table size, as well as the user data write amount; determining whether the write amplification value falls within a target range, and if so, outputting the ratio; otherwise, adjusting the ratio and returning to the step of calculating the write amplification value; and performing metadata snapshot preservation and recovery according to the ratio finally outputted.

[0051] It can be seen that for the method of using delta+base snapshots to save metadata, this method reversely infers the ratio of the base buffer size to the delta buffer size in the SSD metadata flush frame by presetting the power-on recovery time, and then obtains the write amplification value. Then, it is evaluated whether the write amplification meets the requirements. If not, the ratio is adjusted, that is, the ratio of the base buffer size to the delta buffer size is adjusted, so as to balance the power-on recovery time and the write amplification requirements, while extending the life of the SSD and allowing the SSD to quickly enter the working state after powering on.

[0052] In addition, the present application also provides an SSD metadata snapshot storage and recovery device, equipment and readable storage medium, the technical effects of which correspond to the technical effects of the above-mentioned method and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] In order to more clearly illustrate the embodiments of the present application or the technical solutions of the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0054] Figure 1 This is an overall flow chart of the first embodiment of the SSD metadata snapshot storage and recovery method provided by the present application;

[0055] Figure 2A schematic diagram of the cache structure of the first embodiment of the SSD metadata snapshot storage and recovery method provided in the present application;

[0056] Figure 3 This is a detailed flow chart of step S11 in the first embodiment of the SSD metadata snapshot storage and recovery method provided by the present application;

[0057] Figure 4 The embodiment of the SSD metadata snapshot storage and recovery device provided by the present application is a schematic diagram;

[0058] Figure 5 A schematic diagram of an SSD metadata snapshot storage and recovery device embodiment provided in this application. DETAILED DESCRIPTION

[0059] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.

[0060] The terms "including" and "having" in the specification and claims of this application and the above drawings, as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the listed steps or units, but may include steps or units that are not listed.

[0061] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0062] The core of this application is to provide a method, device, equipment and readable storage medium for preserving and restoring SSD metadata snapshots, which reversely calculates the ratio of delta data to base data in the metadata flushing frame by presetting the power-on recovery time, and obtains the write amplification value. On this basis, by adjusting the ratio, the write amplification caused by the power-on recovery time and the metadata preservation is balanced.

[0063] The following is an introduction to the first embodiment of the SSD metadata snapshot storage and recovery method provided by the present application. Figure 1 , Embodiment 1 includes:

[0064] S11, determining the delta data update amount according to the preset power-on recovery time;

[0065] S12, determining the amount of user data to be written according to the delta data update amount and the user data unit size;

[0066] S13, determining a ratio according to the delta data update amount and the size of the L2P table;

[0067] S14, calculating the write amplification value according to the delta data update amount, the size of the L2P table, and the write amount of the user data;

[0068] S15, determining whether the write amplification value falls within the target range, if so, outputting the ratio; otherwise, adjusting the ratio and returning to S14;

[0069] S16. According to the final output ratio, the metadata snapshot is saved and restored.

[0070] The power-on recovery time is an important indicator of the SSD. The shorter the recovery time, the faster the SSD will enter the working state. Usually, the recovery time is required to be about 10 seconds. Since the L2P table in the metadata has the largest amount of data, for example, the L2P table of a 4TB SSD has 4GB. The entire power-on recovery time of the SSD is basically spent in the process of restoring the L2P table, and the recovery time of other metadata can be basically ignored. Therefore, this embodiment mainly considers the recovery process of the L2P table.

[0071] This embodiment uses a snapshot storage method based on SSD to save metadata, that is, a delta+base method is used to save metadata, where delta refers to incremental data, which is derived from base data. Specifically, the entire L2P table in DDR is called base data, and a table entry (lba0, pba0) of the L2P table is copied to (lba0, pba1), then (lba0, pba1) is an L2P type delta data.

[0072] like Figure 2 As shown, the metadata flush frame includes buffer header information, delta data and base data. Several write buffers (i.e., write buffers for caching metadata flush frames) are opened in DDR. The first header size of each write buffer is used to cache buffer header information, the following delta buffer size is used to cache delta data, and the remaining base buffer size is used to cache base data, where write buffer = (header buffer, delta buffer, base buffer).

[0073] From this, we can see that write buffer size = header size + delta buffer size + base buffer size. It is worth mentioning that the L2P table is stored in SLC, and NAND reads and writes in pages, so the write buffer size is generally the SLC page size, that is, 16K. The header size is generally 64 bytes. Therefore, the sum of the delta buffer size and the base buffer size is also a fixed value.

[0074] Assume delta buffer size:base buffer size = 1:N. If N is increased, delta buffer size will be reduced accordingly, and the speed of SSD writing write buffer will be faster, but write amplification will also increase. On the contrary, if N is decreased, delta buffer size will be increased accordingly, and more incremental data can be stored. The power-on recovery time is mainly related to the number of L2P type incremental data. The larger the incremental data, the longer the power-on recovery time. Therefore, the value of N affects the write amplification and power-on recovery time. How to determine a value of N to ensure a balance between write amplification and power-on recovery time is very critical.

[0075] like Figure 3 As shown, the above S11 specifically includes the following steps:

[0076] S31, determining the time consumed to read the entire L2P table from the NAND according to the size of the L2P table and the read bandwidth;

[0077] Specifically, the SSD capacity is obtained, and the size of the L2P table is calculated according to the SSD capacity. The specific calculation method is L2P_TABLE_SIZE=SSD_CAP / 1000, where L2P_TABLE_SIZE represents the size of the L2P table in GB; SSD_CAP represents the SSD capacity in TB.

[0078] S32, subtracting the preset power-on recovery time from the time consumed for reading the entire L2P table to obtain the time consumed for updating the L2P table;

[0079] S33. Determine the delta data update amount according to the time consumed in updating the L2P table.

[0080] Specifically, by constructing a test case, the speed of the SSD controller randomly accessing the DDR with a preset size is obtained; and the delta data update amount is determined according to the speed and the time consumed for updating the L2P table.

[0081] As mentioned above, the sum of the delta buffer size and the base buffer size is a constant, so adjusting the basebuffer size is equivalent to adjusting the delta buffer size at the same time, that is, adjusting the ratio N of the two.

[0082] During the adjustment process, if N is increased, the delta buffer size will be reduced accordingly, and the speed of SSD writing write buffer will become faster, but the write amplification will also increase; on the contrary, if N is reduced, the delta buffer size will be increased accordingly, and the power-on recovery time will be longer. The preset power-on recovery time described above is an ideal value. Therefore, in order to ensure that the write amplification meets the requirements, N is generally adjusted to a smaller direction, that is, the base buffer size is reduced. At the same time, in order to avoid the adjusted power-on recovery time being too long, it is necessary to gradually fine-tune, such as reducing the base buffer size by a smaller ratio. The specific adjustment strategy can be set according to actual needs, and this embodiment is not limited.

[0083] The SSD metadata snapshot preservation and recovery method provided in this embodiment aims at the problem that in the scheme of preserving metadata in the delta+base snapshot method, it is necessary to determine the ratio N of the delta buffer to the base buffer in the write buffer. A method of reversely calculating the ratio by presetting the power-on recovery time is proposed to obtain the write amplification value. Furthermore, within a reasonable write amplification range, the SSD power-on recovery time can be optimized by fine-tuning to increase the N value; under acceptable power-on recovery time requirements, the write amplification caused by the SSD writing metadata can be reduced by fine-tuning to reduce the N value, thereby increasing the SSD life. This method can effectively balance the write amplification caused by the writing of metadata and the power-on recovery time requirements. In short, the method of adjusting the N value in this embodiment not only ensures that the write amplification is within a reasonable range, but also satisfies the power-on recovery time in accordance with development requirements.

[0084] The following is a detailed introduction to the second embodiment of the SSD metadata snapshot storage and recovery method provided by the present application. Based on the above-mentioned first embodiment, the second embodiment uses actual application as an example to explain the entire solution in detail. The following is divided into four parts: metadata storage process, metadata recovery process, ratio calculation process, and ratio adjustment process.

[0085] First, save the process

[0086] In SSD, JM (Journal Manager) is responsible for saving and restoring the L2P table. When saving the L2P table, JM regards the entire L2P table in DDR as base data and divides the entire L2P table into segments according to the base buffer size. Each segment is called a base segment. The number of base segments is equal to the number of JM_LBAs in the L2P table. Each JM_LBA uniquely corresponds to a base segment. JM_LBA is used to index the JM_l2p_entry of the L2P table.

[0087] JM receives the incremental data from L2P and stores it in the delta buffer area in the write buffer. After the incremental data fills up the delta buffer, it copies the base segments to the base buffer area in the write buffer in order, adds the corresponding JM_LBA and other information to the buffer header, and then writes the 16K write buffer to the SLC. The flashed SLC flash address is recorded as PCA, and a pair of mapping relationships (JM_LBA, PCA) is generated with JM_LBA and updated to the JM l2p table. When all base segments are saved for one round, the entire L2P table is flushed once. JM_LBA can be used repeatedly.

[0088] Second, metadata recovery process

[0089] Power-on recovery is the reverse process of the save process. JM first reads the JM_l2p table in sequence according to JM_LBA, and sends a NAND read request after obtaining PCA. The NAND controller will move the current 16K SLC page size data to the writebuffer. JM first restores the base data to the corresponding position in DDR, and then reads the delta data in sequence and updates it to the L2P table. When all JM_LBA reads are completed, the entire L2P table is restored to the corresponding position in DDR.

[0090] Third, the ratio of delta buffer to base buffer in the write buffer

[0091] Get the power-on recovery time. The power-on recovery time is a required indicator and is defined here as RECVOERY_TIME_IN_SEC. Get the read bandwidth. The read bandwidth is one of the main performance indicators of the SSD and is defined here as READ_THROUGHPUT. For an SSD with a capacity of SSD_CAP (in TB), the L2P table size is calculated as follows: L2P_TABLE_SIZE = (SSD_CAP / 1000) GB.

[0092] Then, the time consumption of the SLC to read the entire L2P table from NAND is:

[0093] READ_SLC_TIME=L2P_TABLE_SIZE / READ_THROUGHPUT;

[0094] The remaining time for l2p delta to update the L2P table is:

[0095] PATCH_L2P_TOTAL_TIME=RECVOERY_TIME_IN_SEC-READ_SLC_TIME;

[0096] By building a test case, we can obtain the random access speed of the SSD controller in DWORD size to DDR, which is defined as WRITE_DWORD_CNT_PER_SEC. Then, within the required delta update time, the amount of data that can be updated is:

[0097] TOTAL_L2P_PATCH_CNT=WRITE_DWORD_CNT_PER_SEC*PA TCH_L2P_TOTAL_TIME;

[0098] Assume that SSD HOST_DATA_UINT_SIZE = 4KiB, that is, each l2p delta corresponds to a 4KiB user data, then the total amount of updated user data is:

[0099] TOTAL_HOST_DATA_SIZE=TOTAL_L2P_PATCH_CNT*HOST_DATA_UINT_SIZE;

[0100] From the above, we can see that when the amount of user data written by the Host to the SSD is TOTAL_HOST_DATA_SIZE, the SSD needs to rewrite a whole L2P table. The format of L2P delta is (HOST LBA, PBA), and its size is recorded as L2P_DELTA_SIZE. Then the total amount of L2P delta data generated is:

[0101] TOTAL_L2P_DELTA_SIZE=TOTAL_L2P_PATCH_CNT*L2P_DELTA_SIZE;

[0102] Then, the ratio of delta to base is:

[0103] Delta:base=TOTAL_L2P_DELTA_SIZE:L2P_TABLE_SIZE=1:N;

[0104] Write amplification is:

[0105] SSD_WA=(L2P_TABLE_SIZE+TOTAL_L2P_DELTA_SIZE+TOTAL_HOST_DATA_SIZE) / TOTAL_HOST_DATA_SIZE.

[0106] In summary, if the write amplification SSD_WA calculated by the above calculation does not meet the write amplification requirement, the N value can be appropriately adjusted to reduce it. This will extend the power-on recovery time to varying degrees. At this time, the power-on recovery time can be shortened by optimizing the power-on recovery process or using the concurrency of multi-core recovery.

[0107] Fourth, the Delta and base ratio adjustment process

[0108] By reversely calculating the power-on recovery time, the ratio of delta to base in the write buffer is obtained as delta:base=1:N, where the N value can be regarded as the basic ratio value and the write amplification WA value.

[0109] Generally, it is acceptable that the ratio of write amplification caused by flushing metadata to the total write amplification is less than 5%. For example, when N=3, the delta buffer in the 16k write buffer is 4kiB, the base buffer is 12kiB, and the size of each L2P delta is 8 bytes. Then the delta buffer can store delta_num_per_buf=512(4kiBwrite_buf_size / 8L2P_delta_size), and the user data to be flushed is 512delta_num_per_buf*4kiBhost_data_unit=2048kiB. Write amplification WA=(16kiB write_buf_size+2048kiB host_data_size) / 2048kiB host_data_size=1+1 / 128. Generally, the total write amplification of SSD is at least 2. Therefore, the ratio value (1 / 128) / 2*100%=0.3%, which is much smaller than the upper limit of 5%.

[0110] Furthermore, if the actual power-on recovery time of the SSD using the N value does not meet the requirements, you can fine-tune the N value to obtain a power-on recovery time that meets the requirements:

[0111] (1) Reducing the N value can reduce the number of deltas stored in the delta buffer, which is beneficial for reducing the power-on recovery time. Reduce the base buffer size by 10%, which is one tenth of delta_num_per_buf, that is, (delta_num_per_buf / 10), to reduce the number of deltas stored in the delta buffer until the measured power-on recovery time meets the requirements. However, reducing the number of deltas in the delta buffer will speed up the write buffer flushing speed, and the write amplification will also increase, further affecting the write performance of the SSD. Therefore, the minimum limit for reducing the number of deltas stored in the delta buffer is to not affect the write performance of the SSD, which can be verified by actual SSD measurements. At the minimum, if the power-on recovery time still cannot meet the requirements, other methods for optimizing the power-on recovery time should be considered on this basis, such as increasing the number of CPUs participating in the power-on recovery process.

[0112] (2) Increasing the N value can increase the number of deltas stored in the delta buffer, which helps reduce the write amplification caused by metadata flushing. However, the write amplification caused by metadata flushing is often of little impact, so this type of adjustment is rarely used, and more attention is paid to reducing the power-on recovery time indicator.

[0113] The following is an introduction to the SSD metadata snapshot storage and recovery device provided in an embodiment of the present application. The SSD metadata snapshot storage and recovery device described below and the SSD metadata snapshot storage and recovery method described above can be referenced to each other.

[0114] like Figure 4 As shown, the SSD metadata snapshot storage and recovery device of this embodiment includes:

[0115] A delta data update amount determination module 41, used to determine the delta data update amount according to a preset power-on recovery time;

[0116] A base data total amount determination module 42, used to determine the write amount of user data according to the delta data update amount and the user data unit size;

[0117] A ratio determination module 43, used to determine the ratio according to the delta data update amount and the size of the L2P table;

[0118] A write amplification value calculation module 44, used to calculate the write amplification value according to the delta data update amount and the size of the L2P table, as well as the write amount of user data;

[0119] A judging module 45 is used to judge whether the write amplification value falls within the target range. If so, the ratio is output; otherwise, an adjusting module 46 is triggered to adjust the ratio and return to the write amplification value calculating module 44;

[0120] The saving and restoring module 47 is used to save and restore the snapshot of metadata according to the final output ratio.

[0121] The SSD metadata snapshot preservation and recovery device of this embodiment is used to implement the aforementioned SSD metadata snapshot preservation and recovery method. Therefore, the specific implementation method of the device can be seen in the embodiment part of the SSD metadata snapshot preservation and recovery method in the previous text, and will not be repeated here.

[0122] Optionally, the delta data update amount determination module includes a time consumption submodule, a difference operation submodule and a determination submodule;

[0123] The time consumption submodule is used to determine the time consumed to read the entire L2P table from NAND according to the size of the L2P table and the read bandwidth;

[0124] A difference operation submodule is used to make a difference between the preset power-on recovery time and the time consumed for reading the entire L2P table to obtain the time consumed for updating the L2P table;

[0125] The determination submodule is used to determine the delta data update amount according to the time consumed by updating the L2P table.

[0126] Optionally, it also includes a module for determining the size of the L2P table;

[0127] The L2P table size determination module is used to obtain the SSD capacity and determine the size of the L2P table according to the SSD capacity.

[0128] Optionally, the L2P table size determination module is used to calculate the size of the L2P table according to the SSD capacity according to a target formula, and the target formula is: L2P_TABLE_SIZE=SSD_CAP / 1000, wherein L2P_TABLE_SIZE represents the size of the L2P table in GB; SSD_CAP represents the SSD capacity in TB.

[0129] Optionally, a submodule is determined to obtain a speed at which the SSD controller randomly accesses DDR with a preset size by constructing a test case; and a delta data update amount is determined according to the speed and the time consumed in updating the L2P table.

[0130] Optionally, a setting module is also included;

[0131] The setting module is used to set the size of the write cache to be equal to the SLC page size. The write cache includes the header cache, delta buffer, and base buffer.

[0132] Optionally, the adjustment module is used to reduce the base buffer size by 10%.

[0133] The present application provides an SSD metadata snapshot preservation and recovery device, a delta data update amount determination module, used to determine the delta data update amount according to a preset power-on recovery time; a base data total amount determination module, used to determine the user data write amount according to the delta data update amount and the user data unit size; a ratio determination module, used to determine the ratio according to the delta data update amount and the size of the L2P table; a write amplification value calculation module, used to calculate the write amplification value according to the delta data update amount and the size of the L2P table, and the user data write amount; a judgment module, used to judge whether the write amplification value falls within the target range, if so, output the ratio; otherwise, trigger the adjustment module, used to adjust the ratio and return to the write amplification value calculation module; a preservation and recovery module, used to perform metadata snapshot preservation and recovery according to the final output ratio.

[0134] It can be seen that for the method of using delta+base snapshots to save metadata, this method reversely infers the ratio of the base buffer size to the delta buffer size in the SSD metadata flush frame by presetting the power-on recovery time, and then obtains the write amplification value. Then, it is evaluated whether the write amplification meets the requirements. If not, the ratio is adjusted, that is, the ratio of the base buffer size to the delta buffer size is adjusted, so as to balance the power-on recovery time and the write amplification requirements, while extending the life of the SSD and allowing the SSD to quickly enter the working state after powering on.

[0135] In addition, the present application also provides an SSD metadata snapshot storage and recovery device, such as Figure 5 As shown, including:

[0136] Memory 100: used for storing computer programs;

[0137] Processor 200: used to execute the computer program to implement the SSD metadata snapshot storage and recovery method as described above.

[0138] Among them, the processor 200 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 200 can be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 200 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 200 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 200 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.

[0139] The memory 100 may include one or more computer-readable storage media, which may be non-transitory. The memory 100 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices and flash memory storage devices.

[0140] It is understandable that if the SSD metadata snapshot preservation and recovery method in the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium to execute all or part of the steps of each embodiment method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), electrically erasable programmable ROM, register, hard disk, removable disk, CD-ROM, magnetic disk or optical disk and other media that can store program code.

[0141] Based on this, the present application provides a readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it is used to implement the SSD metadata snapshot storage and recovery method as described above.

[0142] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0143] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may 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.

[0144] The above is a detailed introduction to the scheme provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for general technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A method for storing and restoring SSD metadata snapshots, characterized in that: include: S1. Determine the delta data update amount according to the preset power-on recovery time; S2. determining the amount of user data to be written according to the delta data update amount and the user data unit size; S3, determining a ratio according to the delta data update amount and the size of the L2P table; S4, calculating a write amplification value according to the delta data update amount, the size of the L2P table, and the write amount of the user data; S5, determining whether the write amplification value falls within a target range, and if so, outputting the ratio; Otherwise, adjust the ratio and return to S4; S6. Performing snapshot storage and recovery of metadata according to the ratio finally outputted; Determining the delta data update amount according to the preset power-on recovery time includes: Determine the time consumed to read the entire L2P table from the NAND according to the size of the L2P table and the read bandwidth; Subtracting the preset power-on recovery time from the time consumed for reading the entire L2P table to obtain the time consumed for updating the L2P table; The delta data update amount is determined according to the time consumed for updating the L2P table.

2. The method according to claim 1, characterized in that Before determining the time consumed for reading the entire L2P table from the NAND according to the size and read bandwidth of the L2P table, the method further includes: The SSD capacity is obtained, and the size of the L2P table is determined according to the SSD capacity.

3. The method according to claim 2, characterized in that The determining the size of the L2P table according to the SSD capacity includes: According to the target formula, the size of the L2P table is calculated according to the SSD capacity, and the target formula is: L2P_TABLE_SIZE=SSD_CAP / 1000, wherein L2P_TABLE_SIZE represents the size of the L2P table, in GB; SSD_CAP represents the SSD capacity, in TB.

4. The method according to claim 1, characterized in that The determining the delta data update amount according to the time consumed by updating the L2P table includes: By constructing a test case, the speed of the SSD controller randomly accessing the DDR with a preset size is obtained; and the delta data update amount is determined according to the speed and the time consumed for updating the L2P table.

5. The method according to any one of claims 1 to 4, characterized in that: Before determining the amount of user data to be written according to the delta data update amount and the user data unit size, the method further includes: The size of the write cache is set to be equal to the SLC page size, and the write cache includes a header buffer, a delta buffer, and a base buffer.

6. The method according to claim 5, characterized in that The adjusting the ratio comprises: Reduce the base buffer size by 10%.

7. An SSD metadata snapshot storage and recovery device, characterized in that: include: A delta data update amount determination module, used to determine the delta data update amount according to a preset power-on recovery time; A base data total amount determination module, used to determine the user data write amount according to the delta data update amount and the user data unit size; A ratio determination module, used to determine the ratio according to the delta data update amount and the size of the L2P table; A write amplification value calculation module, used to calculate the write amplification value according to the delta data update amount and the size of the L2P table, and the write amount of the user data; A judging module, configured to judge whether the write amplification value falls within a target range, and if so, output the ratio; Otherwise, triggering an adjustment module to adjust the ratio and returning to the write amplification value calculation module; A saving and restoring module, used for performing snapshot saving and restoration of metadata according to the ratio finally outputted; The delta data update amount determination module includes a time consumption submodule, a difference operation submodule and a determination submodule; The time consumption submodule is used to determine the time consumed to read the entire L2P table from NAND according to the size of the L2P table and the read bandwidth; A difference operation submodule is used to make a difference between the preset power-on recovery time and the time consumed for reading the entire L2P table to obtain the time consumed for updating the L2P table; The determination submodule is used to determine the delta data update amount according to the time consumed by updating the L2P table.

8. An SSD metadata snapshot storage and recovery device, characterized in that: include: Memory: used to store computer programs; Processor: used to execute the computer program to implement the SSD metadata snapshot storage and recovery method as described in any one of claims 1 to 6.

9. A readable storage medium, characterized in that: The readable storage medium stores a computer program, and when the computer program is executed by a processor, it is used to implement the SSD metadata snapshot storage and recovery method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Method for implementing data storage snapshot based on solid state disk, and solid state disk

    CN102591790A

  • Computer system, management computer, storage system, and backup management method

    US20070112893A1