Method for optimizing garbage collection efficiency and solid state drive

By employing a three-level table entry management system for L2P mapping in solid-state drives and utilizing L2P bitmaps to construct effective data bitmaps, the problems of I/O overhead and computational overhead during garbage collection are solved, thereby improving garbage collection efficiency.

CN122240524APending Publication Date: 2026-06-19MAXIO TECHNOLOGY (HANGZHOU) CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
MAXIO TECHNOLOGY (HANGZHOU) CO LTD
Filing Date
2026-03-23
Publication Date
2026-06-19

Smart Images

  • Figure CN122240524A_ABST
    Figure CN122240524A_ABST
Patent Text Reader

Abstract

A method for optimizing garbage collection efficiency and a solid-state drive (SSD) are disclosed. The method includes: when updating L2P mappings, constructing and maintaining an L2P bitmap of physical blocks based on the old and new pointers of the L2P mappings; during garbage collection, determining whether the source physical block is associated with an L2P bitmap; if associated with an L2P bitmap, traversing the L2P bitmap to locate a third-level mapping table containing valid L2P mappings pointing to the source physical block; constructing a valid data bitmap based on the physical addresses obtained from the located third-level mapping table; and performing garbage collection on the source physical block according to the constructed valid data bitmap. This method can improve garbage collection efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of memory technology, and more specifically to a method for optimizing garbage collection efficiency and a solid-state drive. Background Technology

[0002] Solid-state drives (SSDs) are widely used in personal computing, data centers, and various embedded systems due to their high performance and low power consumption. Unlike traditional hard disk drives (HDDs), SSDs are based on flash memory chips, and their write operations must be performed on pre-erased physical blocks. Erasing operations are performed on a block-by-block basis and are significantly more time-consuming than read / write operations. This inherent hardware characteristic necessitates "erasure before write," leading to the introduction of garbage collection (GC) mechanisms.

[0003] In existing technologies, the garbage collection process typically includes: selecting a physical block with a low proportion of valid data as the source physical block; migrating the remaining valid data in the source physical block to a new physical block; and finally erasing the entire source physical block for later use. Identifying the valid data in the source physical block is a crucial step in the garbage collection process, and its efficiency directly affects the overall performance of garbage collection and the write latency of the SSD.

[0004] Currently, a common method for identifying valid data is to first scan the physical-to-logical mapping table (P2L table) in the source physical block to initially construct a valid data bitmap. The P2L table is written into the physical page when data is written and records the logical address of each physical page. Then, the logical-to-physical mapping table (L2P table) is queried to confirm whether the logical address still points to this physical page. If the L2P table shows that the logical address has pointed to a new physical page, it indicates that the data in the original physical page is invalid data, and the corresponding record in the valid data bitmap is marked as invalid.

[0005] The drawback of this approach is that it requires a large number of physical page read operations on the source physical block and frequent L2P table queries, resulting in significant input / output (I / O) and computational overhead. This is especially true when the L2P table is large and may be partially stored in external non-volatile memory (such as NAND flash memory itself), which can severely slow down garbage collection, cause performance fluctuations, and exacerbate flash memory wear. This problem is particularly prominent in high-capacity, high-performance solid-state drives. Summary of the Invention

[0006] In view of this, embodiments of the present disclosure provide a method for optimizing garbage collection efficiency and a solid-state drive.

[0007] According to a first aspect, embodiments of this disclosure provide a method for optimizing garbage collection efficiency, applied to a solid-state drive (SSD), wherein the SSD employs a three-level table entry management system for L2P mapping, and the method includes: When updating the L2P mapping, the L2P bitmap of the physical block is maintained based on the old and new pointers of the L2P mapping; When performing garbage collection, determine whether the source physical block to be garbage collected is associated with an L2P bitmap; If the L2P bitmap is associated, the L2P bitmap is traversed to locate the third-level mapping table containing the L2P mapping pointing to the source physical block. A valid data bitmap is constructed based on the physical address obtained from the third-level mapping table. Garbage collection is performed on the source physical block based on the constructed valid data bitmap. The L2P bitmap includes a TBMT matrix and a DBMT bitmap. The TBMT matrix is ​​used to identify the second-level mapping table to which the mapping relationship of physical pages with valid data in the source physical block belongs. The DBMT bitmap is used to indicate whether there is a valid L2P mapping pointing to the physical block in the third-level mapping table pointed to by each record in the second-level mapping table indicated by the TBMT matrix.

[0008] In some embodiments, during the process of constructing and maintaining the L2P bitmap of the physical block, if the TBMT matrix exceeds a preset complexity, the L2P bitmap is not constructed or destroyed.

[0009] In some embodiments, the method further includes: when it is determined that the source physical block is not associated with the L2P bitmap, constructing the valid data bitmap by scanning the P2L table of the source physical block.

[0010] In some embodiments, traversing the L2P bitmap to locate a third-level mapping table containing valid L2P mappings pointing to the source physical block includes: Traverse the TBMT matrix in the L2P bitmap to determine the second-level mapping table to which the mapping data of the physical page with valid data in the source physical block belongs; The second-level mapping table is determined by traversing the DBMT bitmap corresponding to the second-level mapping table to obtain a valid third-level mapping table; Read the L2P mapping relationship data in the corresponding third-level mapping table in sequence, and determine whether the physical address belongs to the source physical block. If it does, determine that the third-level mapping table where the L2P mapping relationship data is located is a third-level mapping table containing valid L2P mappings pointing to the source physical block.

[0011] In some embodiments, constructing a valid data bitmap based on the physical address obtained from the located third-level mapping table includes: Obtain the physical addresses one by one from the located third-level mapping table; Determine whether the obtained physical address belongs to the source physical block. If it does, set the data page corresponding to the physical address in the valid data bitmap to have valid data.

[0012] In some embodiments, the DBMT bitmap includes multiple bit sequences, and a 1 in the bit sequence indicates that there is a valid L2P mapping pointing to the source physical block in the corresponding DBMT, and a 0 in the bit sequence indicates that there is no valid L2P mapping pointing to the source physical block in the corresponding DBMT.

[0013] In some embodiments, the method further includes performing garbage collection on the source physical block only when the valid data of the source physical block is determined to be less than a preset threshold based on the valid data bitmap.

[0014] In some embodiments, the method further includes: establishing a tag array to identify whether each physical block is associated with the L2P bitmap.

[0015] According to a second aspect, embodiments of this disclosure provide a controller for a solid-state drive, wherein the controller is coupled to a storage medium composed of flash memory chips, and computer instructions are stored in the controller or the storage medium, wherein when the computer instructions are executed by a processing unit in the controller, the method described in any of the preceding descriptions is implemented.

[0016] According to a third aspect, an embodiment of the present disclosure provides a solid-state drive, which includes the controller described above and a storage medium composed of flash memory chips.

[0017] The method provided in this disclosure, compared to the traditional method of constructing a valid data bitmap using a P2L table, constructs a valid data bitmap based on a forward lookup of an L2P bitmap. The constructed valid data bitmap is effective and requires no subsequent L2P verification operations. Furthermore, this construction method helps improve garbage collection efficiency by reducing physical page traversal and redundant judgments. This method is particularly suitable for situations where the data in the physical blocks to be garbage collected is relatively concentrated. Attached Figure Description

[0018] Figure 1 It is a schematic block diagram of a computer system; Figure 2 This disclosure provides an embodiment applicable to... Figure 1 The method shown is for optimizing the garbage collection efficiency of a storage device consisting of a controller and storage media. Figure 3This is an example of the data management unit (TBMT) of the second-level mapping table and the data management unit (DBMT) of the third-level mapping table in a three-level mapping table management method; Figure 4 An example diagram of the L2P bitmap of physical blocks in a three-level mapping table management method is given; Figure 5 This is a schematic diagram of constructing a valid data bitmap in garbage collection according to an embodiment of this disclosure. Detailed Implementation

[0019] The present invention is described below based on embodiments, but the invention is not limited to these embodiments. In the detailed description of the invention below, certain specific details are described in detail. Those skilled in the art will fully understand the invention even without these details. To avoid obscuring the essence of the invention, well-known methods, processes, and procedures are not described in detail. Furthermore, the accompanying drawings are not necessarily drawn to scale.

[0020] The flowcharts and block diagrams in the accompanying drawings illustrate the possible system framework, functions, and operations of the systems, methods, and apparatuses according to embodiments of the present invention. The blocks in the flowcharts and block diagrams may represent a module, program segment, or simply a piece of code. These modules, program segments, and code are all executable instructions used to implement a specified logical function. It should also be noted that the executable instructions implementing the specified logical function can be recombine to generate new modules and program segments. Therefore, the blocks and their order in the accompanying drawings are only used to better illustrate the processes and steps of the embodiments and should not be construed as limiting the invention itself.

[0021] Terminology Explanation: AU Allocated Unit: The allocation unit for data management, with a default size of 4KB. LAA Logical AU Address. The logical address of the data. PAA Physical AU Address. The physical address of the data, which corresponds to the address in the NAND flash memory. L3_TLAA An L3 Table (LAA) is 4KB in size and can store 1024 entries. The LAA corresponding to an L2P third-level mapping table is called an L3 Table (TLAA). The relationship between L3_TLAA and LAA is: L3_TLAA = LAA >> 10 L3_TPAA L3_Table PAA. The physical address of L3_Table corresponds to the address in the flash memory storage medium. L2_TLAA L2_Table LAA. A second-level mapping table is 4KB in size and can store 1024 L2Ps of the L3 Table. The LAA corresponding to the second-level mapping table is called the L2 TLAA. The relationship between L2_TLAA and LAA is: L2_TLAA = LAA >> 20. The relationship between L2_TLAA and L3_TLAA is: L2_TLAA = L3_TLAA >> 10. L2_TPAA L2 Table PAA. The physical address of the L2 Table corresponds to the address in the flash memory storage medium. L1_Table The first level mapping table in the three-level table management method. It resides in SRAM, and the L1_Table is written to the flash memory storage medium before the main controller loses power normally. L2_Table The second-level mapping table in the three-level table entry management method is stored in flash memory, with a small portion stored in the cache unit. Each L2_Table is 4KB in size and can store 1024 L2P entries of the L3 Table. L3_Table The third-level mapping table in the three-level table entry management method. It is stored in NAND flash memory, with a small portion stored in cache units. Each L3_Table is 4KB in size and can store 1024 L2P entries of user data. L2P Bitmap Bitmap reflecting the logical-to-physical mapping VFC (ValidFrag Cnt) The number of valid fragments typically refers to the number of valid data pages in a physical block. VBM (ValidBitmap) A valid data bitmap typically refers to the distribution of physical pages containing valid data within a physical block. DBMT(DataBlockMappingTable) Data management unit of the third-level mapping table on flash memory TBMT (Tableof DBMT) Data management unit of the second-level mapping table on flash memory Figure 1 This is a schematic block diagram of a computer system. The computer system 100 includes a host 110, a controller 120, and a storage medium 130. The controller 120 and the storage medium 130 constitute various types of storage devices, such as solid-state drives.

[0022] The host interface 121 of the controller 120 is connected to the host 110. The host interface 121 is, for example, a SATA, M.2, mSATA, or PCI-E interface. The processor 123 is connected to the host interface 121, the cache controller 124, and the storage media interface 125. The cache chip of the controller 120 includes an SRAM chip 122 located inside the controller and a DRAM chip 126 located outside the controller. The processor 123 can execute the core software layer for memory control, namely the FTL (Flash Translation Layer). The FTL translates the logical addresses in the read and write commands sent by the host 110 into physical addresses by maintaining the mapping relationship data between logical addresses and physical addresses, thereby enabling the operating system and file system of the host 110 to access the storage media 130 as if it were accessing the host memory.

[0023] During a host write operation, the controller 120 receives a write command from the host 110. The FTL maps the logical address in the command to a physical address, then organizes the data to be written into physical pages, writes it to the storage medium 130 according to the physical address, and updates the mapping table. During a host read operation, the controller 120 controls the FTL to map the logical address in the command to a physical address, and reads data from the corresponding location in physical pages.

[0024] In normal operation, FTL can use a three-level mapping table to map logical addresses to physical addresses: first, query the first-level mapping table (L1_Table) to obtain the physical address L2_TPAA of the second-level mapping table (L2_Table), then locate the second-level mapping table (L2_Table) based on L2_TPAA, then query the second-level mapping table (L2_Table) to obtain the physical address (L3_TPAA) of the third-level mapping table (L3_Table) based on L3_TPAA, and finally obtain the physical address (PAA) of the target data from it.

[0025] Storage medium 130 is composed, for example, of flash memory chips. The storage medium interface 125 of controller 120 connects to multiple flash memory chips via multiple channels (CH0 and CH1). Each flash memory chip is divided into multiple physical planes in the column direction and multiple physical blocks in the row direction, and each physical block is further divided into multiple physical pages. The basic unit for reading and writing to a flash memory chip is a physical page, and the basic unit for erasing data from a flash memory chip is a physical block.

[0026] Referring to the background art, embodiments of this disclosure provide an application in... Figure 1 The method shown is for optimizing garbage collection efficiency in a storage device consisting of a controller 120 and a storage medium 130. This method helps reduce the overhead of identifying valid data during garbage collection. Figure 2 A flowchart of the method is provided.

[0027] In step S201, when updating the L2P mapping, an L2P bitmap for the physical block is constructed and maintained based on the old and new pointers of the L2P mapping. The L2P bitmap includes a TBMT matrix and a DBMT bitmap. The TBMT matrix is ​​a one-dimensional matrix (array) that indicates the second-level mapping table to which the mapping relationship data of the physical pages with valid data in the physical block belongs. The DBMT bitmap indicates whether there is a valid L2P mapping pointing to the source physical block in each third-level mapping table (L3_Table) pointed to by each second-level mapping table (L2_Table) indicated by the TBMT matrix.

[0028] In step S202, when performing garbage collection, it is determined whether the source physical block to be garbage collected is associated with an L2P bitmap. If yes, step S203 is executed; otherwise, step S205 is executed.

[0029] In step S203, the L2P bitmap is traversed to locate the third-level mapping table (L3_Table) containing valid L2P mappings pointing to the source physical block.

[0030] In step S204, a valid data bitmap is constructed based on the physical address information obtained from the located third-level mapping table (L3_Table).

[0031] In step S205, a valid data bitmap is constructed by scanning the P2L table of the source physical block.

[0032] In step S206, garbage collection is performed on the valid data in the source physical block according to the constructed valid data bitmap.

[0033] Based on this embodiment, L2P bitmaps for certain physical blocks are maintained during mapping table updates. Then, during garbage collection, for the source physical blocks to be garbage collected, a valid data bitmap construction method is provided corresponding to two cases: those with associated L2P bitmaps and those without. When there is an associated L2P bitmap, the second-level mapping table (L2_Table) depicting the source physical block in the L2P bitmap is used to locate the third-level mapping table (L3_Table) containing valid L2P mappings pointing to the source physical block. The valid L2P mapping pointing to the source physical block is found from the located third-level mapping table (L3_Table), and a valid data bitmap is constructed accordingly. When there is no associated L2P bitmap, the P2L scanning method mentioned in the background art is used to construct the valid data bitmap. The garbage collection initiation condition can be that the firmware detects that the number of free physical blocks is below a threshold.

[0034] The advantage of this embodiment is that it constructs a valid data bitmap by using a forward lookup table of the L2P bitmap. The constructed valid data bitmap is valid, and no further L2P verification operation is required. In addition, this construction method can improve garbage collection efficiency by reducing physical page traversal and redundant judgments. This method is especially useful when the data is relatively concentrated.

[0035] The following is for reference. Figures 3 to 5 This document details the process of constructing a valid data bitmap using an L2P bitmap method.

[0036] Figure 3 This is an example of the data management unit (TBMT) for the second-level mapping table and the data management unit (DBMT) for the third-level mapping table in a three-level mapping table management method. (Reference) Figure 3 As shown in the example, the data management unit TBMT1 of the second-level mapping table stores a fixed number of records (usually 1024). Each record records the physical address L3_TPAA of a third-level mapping table. The data management units DBMT1, DBMT2, and DBMT3 of the third-level mapping table each store a fixed number of records (e.g., 1024), each recording the physical address PAA of an allocation unit. When looking up a table, the low-order bits (bits 0-9) of L3_TLAA or LAA are used as the offset to find the corresponding L3_TPAA or PAA in TBMT or DBMT. L3_TLAA is converted from LAA, which is given in the query command.

[0037] Figure 4An example diagram of the L2P bitmap of physical blocks in a three-level mapping table management method is given. As shown in the figure, the logical addresses of the physical pages containing valid data in pages 0 to n of physical block A are LAA0, LAA1, LAA5, LAA20, LAAn, and LAAm, respectively. Based on "L2_TLAA = LAA >> 20", the logical addresses of their respective second-level mapping tables are L2_TLAA0, L2_TLAA1, L2_TLAA5, L2_TLAA20, L2_TLAAAn, and L2_TLAAm, respectively. Then, based on these logical addresses, their respective second-level mapping tables are TBMT0, TBMTx, and TBMTy. Thus, TBMT0, TBMTx, and TBMTy form the TBMT matrix of physical block A. The corresponding DBMT bitmap includes bit sequences corresponding to the three elements TBMT0, TBMTx, and TBMTy: each bit in the bit sequence corresponding to TBMT0 indicates whether the third-level mapping table pointed to by the corresponding record in TBMT0 contains a valid L2P mapping to physical block A; each bit in the bit sequence corresponding to TBMTx indicates whether TBMTx... Does the third-level mapping table (DBMT) pointed to by the corresponding record in TBMTy contain a valid L2P mapping pointing to physical block A? Each bit in the bit sequence corresponding to TBMTy indicates whether the third-level mapping table (DBMT) pointed to by the corresponding record in TBMTy contains a valid L2P mapping pointing to physical block A.

[0038] based on Figure 4 Given the TBMT matrix and DBMT bitmap, garbage collection first selects source physical blocks, then checks if the source physical block has a corresponding L2P bitmap. If not, a valid data bitmap is constructed by scanning the P2L bitmap. If it does, the physical block is considered to meet the characteristics of VFC (Virtual Collective Clustering), and a valid data bitmap is constructed using the L2P bitmap method. Figure 5 A schematic diagram of constructing a valid data bitmap in garbage collection according to an embodiment of this disclosure is provided.

[0039] exist Figure 5 In step S1, the TBMT matrix is ​​scanned, and in step S2, the second-level mapping table (L2_Table) corresponding to each TBMT element is read from the flash memory medium 130 into the L2 cache of the controller 120.

[0040] Step S3 iterates through each DBMT element in each DBMT bitmap. Each DBMT element corresponds to a record in the second-level mapping table that has been read. If the corresponding bit is set to 1, the physical address of the corresponding L3_Table is obtained in the L2 cache based on the record, and the corresponding L3_Table is moved to the L3 cache in step S4.

[0041] Step S5 iterates through the read L3_Table, determines whether the FAA in L2P belongs to the source physical block, and if so, constructs a valid data bitmap using that FAA. This process is repeated until the valid data bitmap is fully constructed, at which point the process ends.

[0042] It should be noted that although L2P bitmaps can be built and maintained when updating L2P, this method is suitable for cases where the TBMT matrix in the L2P bitmap is relatively simple. If the TBMT matrix exceeds the preset complexity, for example, if the number of second-level mapping tables involved in the TBMT matrix exceeds the preset threshold, then the above method will no longer be used to build a valid data bitmap, and the existing L2P bitmap can be destroyed.

[0043] In some embodiments, after constructing the valid data bitmap of the source physical block, the number of valid data pages in the source physical block can be counted. If the number exceeds a preset threshold and the size of the TBMT matrix also exceeds a preset threshold, other physical blocks can be selected for garbage collection.

[0044] In some embodiments, to facilitate determining whether a source physical block to be garbage collected is associated with an L2P bitmap, the L2P bitmap can be resident in SRAM. Alternatively, a tag array of the L2P bitmap can be maintained in SRAM, where each element of the tag array is used to mark whether the corresponding physical block is associated with an L2P bitmap. To avoid the tag array becoming too large, a two-dimensional tag array can also be constructed according to the dimensions of the plane and the physical block.

[0045] Corresponding to the above method, this disclosure also provides a controller for a solid-state drive and a solid-state drive. The cache unit of the controller or the storage medium of the solid-state drive stores readable computer instructions. When these instructions are executed by a processor, they can implement the garbage collection method provided in the above embodiments.

[0046] Corresponding to the above methods, embodiments of this disclosure also provide a computer-readable storage medium for storing readable computer instructions of a software program constructed based on the above methods.

[0047] As used herein, the term "module" may refer to, be part of, or include the following: application-specific integrated circuits (ASICs), electronic circuits, processors (shared, dedicated, or grouped) and / or memories (shared, dedicated, or grouped) that execute one or more software or firmware programs, combinational logic circuits, and / or other suitable components that provide the described functionality.

[0048] Those skilled in the art will understand that the various modules or units of the data processing system according to the present invention can be implemented by hardware, firmware, or software. Software includes, for example, coded programs written in various programming languages ​​such as JAVA, C / C++ / C#, and SQL. Although the steps and their order are given in the methods and method diagrams of embodiments of the present invention, the executable instructions that implement the specified logical functions of the steps can be recombined to generate new steps. The order of the steps should not be limited to the order shown in the methods and method diagrams, and can be adjusted at any time according to functional needs. For example, some steps can be executed in parallel or in reverse order.

[0049] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. For those skilled in the art, the present invention can be modified and varied in various ways. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principle of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for optimizing garbage collection efficiency, applied to solid-state drives, characterized in that, The solid-state drive uses a three-level mapping table to manage L2P mapping, and the method includes: When updating the L2P mapping, the L2P bitmap of each physical block is maintained according to the old and new pointers of the L2P mapping; When garbage collection occurs, it is determined whether the source physical block to be garbage collected is associated with an L2P bitmap; If the L2P bitmap is associated, the L2P bitmap is traversed to locate a third-level mapping table containing a valid L2P mapping pointing to the source physical block. A valid data bitmap is constructed based on the physical address obtained from the third-level mapping table. Garbage collection is performed on the source physical block based on the constructed valid data bitmap. The L2P bitmap includes a TBMT matrix and a DBMT bitmap. The TBMT matrix is ​​used to identify the second-level mapping table to which the mapping relationship of the physical pages with valid data in the source physical block belongs. The DBMT bitmap is used to indicate whether there is a valid L2P mapping pointing to the physical block in the third-level mapping table pointed to by each second-level mapping table to which the TBMT matrix belongs.

2. The method according to claim 1, characterized in that, The method further includes: during the maintenance of the L2P bitmap of the physical block, when the TBMT matrix exceeds a preset complexity, destroying the L2P bitmap.

3. The method according to claim 1, characterized in that, The method further includes: when it is determined that the source physical block is not associated with the L2P bitmap, constructing the valid data bitmap by scanning the P2L table of the source physical block.

4. The method according to any one of claims 1 to 3, characterized in that, The step of traversing the L2P bitmap to locate the third-level mapping table containing valid L2P mappings pointing to the source physical block includes: Traverse the TBMT matrix in the L2P bitmap to determine the second-level mapping table to which the mapping data of the physical page with valid data in the source physical block belongs; The second-level mapping table is determined by traversing the DBMT bitmap corresponding to the second-level mapping table to obtain a valid third-level mapping table; Read the L2P mapping relationship data in the corresponding third-level mapping table in sequence, and determine whether the physical address belongs to the source physical block. If it does, determine that the third-level mapping table where the L2P mapping relationship data is located is a third-level mapping table containing valid L2P mappings pointing to the source physical block.

5. The method according to claim 1, characterized in that, The construction of the effective data bitmap based on the physical address obtained from the third-level mapping table includes: Obtain the physical address one by one from the located third-level mapping table; Determine whether the obtained physical address belongs to the source physical block. If so, set the data page corresponding to the physical address in the valid data bitmap to have valid data.

6. The method according to claim 1, characterized in that, The DBMT bitmap includes multiple bit sequences, and a 1 in the bit sequence indicates that there is a valid L2P mapping pointing to the source physical block in the corresponding DBMT, and a 0 in the bit sequence indicates that there is no valid L2P mapping pointing to the source physical block in the corresponding DBMT.

7. The method according to claim 1, characterized in that, Also includes: Garbage collection is performed on the source physical block only when the effective data amount of the source physical block is less than a preset threshold, as determined by the effective data bitmap.

8. The method according to claim 1, characterized in that, Also includes: Create a tag array to identify whether each physical block is associated with the L2P bitmap.

9. A controller for a solid-state drive, wherein, The controller is coupled to a storage medium composed of flash memory chips, and the controller or the storage medium stores computer instructions that, when executed by a processing unit in the controller, implement the method as described in any one of claims 1 to 8.

10. A solid-state drive, wherein, It includes the controller as described in claim 9 and the storage medium composed of the flash memory chips.