Garbage recycling method and device for solid state disk, computer equipment and storage medium
By introducing a section list of recycling units into the host file system, the host can actively control the garbage collection of solid-state hard disks, solving the problem that the host in the existing technology is difficult to control garbage collection and improving the service quality of the system.
Patent Information
- Application Number
- CN202411932369.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-25
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2044-12-25
AI Technical Summary
The garbage collection of existing solid-state drives is controlled by the hard disk, and it is difficult for the host to actively control it, affecting the system's QoS.
By introducing a section link list of recycling units into the host file system, the host can determine the recycling unit that needs to be garbage collected, obtain its section link list, judge the validity of the section, and rewrite data or release storage space.
It realizes garbage collection of solid-state drives on the host side, improves the system's QoS, and ensures that the data in the effective section is correctly read and written.
Smart Images

Figure CN119759288A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of garbage collection, and in particular to a garbage collection method, device, computer equipment and storage medium for a solid state drive. Background Art
[0002] The Nand (Notand) flash memory of a solid-state drive (SSD) only allows sequential writing, while the upper-layer software can write in a variety of ways, so SSDs generally use the FTL (Flash Translation Layer) table to convert various write behaviors into sequential writing within a Super Block. In this case, some data in a Super Block may be valid, while some data may be invalid; if the SSD needs to reclaim valid space, garbage collection (CG) must be performed.
[0003] In the current design, when using SSD, the garbage collection of SSD is controlled by the hard disk, and the upper-layer Host has no control over it. The garbage collection that is not controlled by the upper layer often occurs in the SSD, which affects the QoS (Quality of Service) of the system. Summary of the invention
[0004] In view of this, the present disclosure provides a garbage collection method, apparatus, computer equipment and storage medium for a solid state drive to solve the problem that it is difficult for a host to actively control garbage collection.
[0005] In a first aspect, the present disclosure provides a garbage collection method for a solid state drive, which is applied to a host file system, comprising:
[0006] In the case where garbage collection needs to be performed on the solid state drive, determining a first recycling unit that needs to perform garbage collection;
[0007] Acquire a first recycling unit segment linked list of the first recycling unit from the host file system; the first recycling unit segment linked list is used to record segments belonging to the first recycling unit;
[0008] Determine whether each segment in the first recycling unit segment linked list is valid;
[0009] If there is a valid segment in the first recycling unit segment linked list, rewrite the data corresponding to the valid segment to the second recycling unit, and write the valid segment to the second recycling unit segment linked list of the second recycling unit;
[0010] When there is an invalid segment in the first recovery unit segment linked list, the storage space corresponding to the invalid segment is released.
[0011] In a second aspect, the present disclosure provides a garbage collection device for a solid state drive, which is applied to a host file system, comprising:
[0012] A recycling unit determination module, used to determine a first recycling unit that needs to perform garbage collection when garbage collection is required for the solid state drive;
[0013] a linked list acquisition module, used to acquire a first recycling unit segment linked list of the first recycling unit from the host file system; the first recycling unit segment linked list is used to record segments belonging to the first recycling unit;
[0014] A judgment module, used to judge whether each segment in the first recycling unit segment chain list is valid;
[0015] A garbage collection module is used to rewrite the data corresponding to the valid segment to the second recycling unit and write the valid segment to the second recycling unit segment list of the second recycling unit when there is a valid segment in the first recycling unit segment list; and to release the storage space corresponding to the invalid segment when there is an invalid segment in the first recycling unit segment list.
[0016] In a third aspect, the present disclosure provides a computer device, comprising: a memory and a processor, the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the garbage collection method for a solid-state hard disk of the first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0017] In a fourth aspect, the present disclosure provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the garbage collection method for a solid-state hard disk of the first aspect or any corresponding embodiment thereof.
[0018] In a fifth aspect, the present disclosure provides a computer program product, including computer instructions, which are used to enable a computer to execute the garbage collection method for a solid-state hard disk of the above-mentioned first aspect or any corresponding embodiment thereof.
[0019] The present disclosure is based on setting a recycling unit segment linked list for the segment corresponding to the recycling unit, and the host file system records and maintains the recycling unit segment linked list of each recycling unit; when garbage collection is required for the first recycling unit, the host file system can realize garbage collection based on the first recycling unit segment linked list of the first recycling unit, and in the process of garbage collection, corresponding processing can be performed on the valid segment and the invalid segment respectively, which can ensure that the data of the valid segment can be correctly read and written. This solution can realize garbage collection of SSD on the host side, that is, garbage collection can be performed at the host file system level, which can help the system improve QoS. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the specific embodiments of the present disclosure or the technical solutions in the related technologies, the drawings required for use in the specific embodiments or the related technical descriptions will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0021] Figure 1 is a flow chart of a garbage collection method for a solid state drive according to an embodiment of the present disclosure;
[0022] Figure 2 is a flow chart of another garbage collection method for a solid state drive according to an embodiment of the present disclosure;
[0023] Figure 3 is a flow chart of a garbage collection method for a solid state drive according to another embodiment of the present disclosure;
[0024] Figure 4 It is a schematic diagram when two RUs store two files according to an embodiment of the present disclosure;
[0025] Figure 5 is a schematic diagram of garbage collection for RU2 according to an embodiment of the present disclosure;
[0026] Figure 6 is a structural block diagram of a garbage collection device for a solid state hard disk according to an embodiment of the present disclosure;
[0027] Figure 7 It is a schematic diagram of the hardware structure of the computer device of the embodiment of the present disclosure. DETAILED DESCRIPTION
[0028] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present disclosure.
[0029] In recent years, a new technology has been developed under the NVMe protocol framework: FDP, which is used to optimize data storage and management. FDP technology introduces the concepts of RU (Reclaim Unit), RG (Reclaim Group) and RUH (Reclaim Unit Handle). RU is a physical unit that can be erased and written independently. Multiple RUs form an RG, and the performance and reliability of RGs do not affect each other. RUH is the write pointer of RU. When one RU is full, it will switch to another RU. The host can use IO (input and output) commands to write data from different applications into RU through different RUHs to achieve data isolation.
[0030] For example, users can use multiple data streams for writing. The ID of the data stream is marked as RUH. At the same time, a SuperBlock can correspond to one RU, and one RU corresponds to only one RUH at the same time. Therefore, whether the data is distributed on the same Super Block can be perceived based on whether the RU is replaced.
[0031] In the garbage collection method for a solid-state hard disk provided by the embodiment of the present disclosure, the file system on the host side maintains a segment linked list of each recovery unit, that is, a recovery unit segment linked list. By using the recovery unit segment linked list, the host side can implement garbage collection for the SSD based on the recovery unit, that is, the host can control the garbage collection process of the SSD, which is beneficial to improving the QoS of the system.
[0032] According to an embodiment of the present disclosure, an embodiment of a garbage collection method for a solid-state hard disk is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0033] In this embodiment, a garbage collection method for a solid-state hard disk is provided, which can be applied to a host that can connect to a solid-state hard disk, and the host can be, for example, a mobile terminal, a server, etc.; the method is specifically applied to the host file system, and garbage collection of the solid-state hard disk is implemented based on the host file system. Figure 1 is a flow chart of a garbage collection method for a solid state drive according to an embodiment of the present disclosure. Figure 1 As shown, the process includes the following steps.
[0034] Step S101, when garbage collection needs to be performed on a solid state drive, determining a first collection unit that needs to perform garbage collection.
[0035] In this embodiment, the PDF technology can enable the host to perceive the data written into the solid state drive to assist in determining the data writing and recycling strategy. For example, the host obtains the remaining capacity of the RU through a related interface.
[0036] When the host determines that the solid-state drive needs to perform garbage collection, for example, when the solid-state drive is insufficient in space, or when a garbage collection instruction initiated by the user is received, it can be determined that garbage collection is currently required for the solid-state drive. At this time, the host determines the recovery unit (RU) in the solid-state drive that needs to perform garbage collection, that is, the first recovery unit, which can also be called the first RU.
[0037] Among them, garbage collection can be performed preferentially on RUs storing older data; alternatively, the amount of valid data in each RU can be determined, and the RU with the least valid data can be used as the first RU that needs to be garbage collected, so that write amplification can be reduced when garbage collecting the first RU.
[0038] Step S102, obtaining a first recycling unit segment linked list of a first recycling unit from a host file system; the first recycling unit segment linked list is used to record segments belonging to the first recycling unit.
[0039] In this embodiment, the host file system uses extents as logical units for allocating and managing storage space, where an extent is a continuous data block that can be allocated to files in sequence. In addition, a recycling unit generally corresponds to multiple extents. In this embodiment, the extents corresponding to the recycling unit are represented in a linked list to form a recycling unit extent linked list, that is, the recycling unit extent linked list can record the extents belonging to the corresponding recycling unit.
[0040] For ease of description, the recovery unit segment linked list of the first recovery unit is referred to as the first recovery unit segment linked list; wherein, the recovery unit segment linked list can also be referred to as the RU segment linked list, and accordingly, the first recovery unit segment linked list can also be referred to as the first RU segment linked list.
[0041] In this embodiment, the host file system records and maintains the RU segment linked list of each RU. After the first RU is determined, the corresponding first RU segment linked list can be obtained from the host file system, so that each segment corresponding to the first RU can be determined.
[0042] Step S103, determining whether each segment in the first recycling unit segment linked list is valid.
[0043] In this embodiment, each entry in the first RU segment linked list corresponds to a segment belonging to the first RU, and by judging whether the data stored in each segment is valid, it can be determined whether the corresponding segment is valid. For example, if a segment belonging to the first RU segment linked list stores invalid data, the segment is also invalid.
[0044] As mentioned above, an extent is a continuous block of data. Generally, the start address and length can be used to represent the data block corresponding to the extent. After data is stored in an extent, the extent is initially valid; if the data in the extent is no longer used, for example, the data in the extent is deleted, the extent becomes invalid.
[0045] Step S104, when there is a valid segment in the first recycling unit segment linked list, rewrite the data corresponding to the valid segment to the second recycling unit, and write the valid segment to the second recycling unit segment linked list of the second recycling unit.
[0046] In this embodiment, RU can correspond to multiple segments, that is, multiple segments can belong to the same RU. For the first RU, if it corresponds to a segment that stores valid data, it can be determined that there is a valid segment in the first RU segment list; when garbage collection is performed on the first RU, the valid segment needs to be rewritten to rewrite the data corresponding to the valid segment to other recovery units, that is, the second recovery unit (that is, the second RU).
[0047] Similar to the first RU, the host file system also records the RU segment linked list of the second RU, namely the second RU segment linked list; when the valid segment is rewritten, the valid segment is written into the second RU segment linked list, so that based on the second RU segment linked list, it can be determined that the valid segment belongs to the second RU, and when the second RU is subsequently garbage collected, the segment corresponding to the second RU can also be correctly located.
[0048] Step S105 , when there is an invalid segment in the first recycling unit segment linked list, release the storage space corresponding to the invalid segment.
[0049] In this embodiment, for the first RU, if it corresponds to a segment storing invalid data, it can be determined that there is an invalid segment in the first RU segment linked list; for example, if the data in a segment is deleted, the segment is an invalid segment. For the invalid segment of the first RU, when garbage collection is performed on the first RU, it is not necessary to rewrite the invalid segment, and the storage space corresponding to the invalid segment can be directly released. For example, based on the logical address corresponding to the invalid segment, the logical address space occupied by the invalid segment can be released, thereby erasing the data block corresponding to the invalid segment.
[0050] In addition, if the first RU corresponds to multiple valid segments or multiple invalid segments, each valid segment or each invalid segment can be processed according to step S104 and step S105 respectively, so that all segments corresponding to the first RU can be processed accordingly, and finally the garbage collection operation of the first RU can be realized.
[0051] It can be understood that if the first RU segment linked list of the first RU is empty, it means that there is no valid data in the first RU, which is equivalent to that the segments of the first RU are all invalid segments; when garbage collection is performed on the first RU, the Super Block corresponding to the first RU can be directly erased. At this time, there is no write amplification caused by data movement due to the need for space recovery.
[0052] The garbage collection method for a solid state drive provided in this embodiment sets a recycling unit segment linked list based on the segments corresponding to the recycling units, and the host file system records and maintains the recycling unit segment linked list of each recycling unit; when it is necessary to perform garbage collection on the first recycling unit, the host file system can implement garbage collection based on the first recycling unit segment linked list of the first recycling unit, and in the process of garbage collection, corresponding processing can be performed on the valid segments and invalid segments respectively, which can ensure that the data in the valid segments can be correctly read and written. This method can realize garbage collection of the SSD on the host side, that is, garbage collection can be performed at the host file system level, which can help the system improve QoS.
[0053] In this embodiment, a garbage collection method for a solid-state hard disk is provided, which can be applied to a host that can connect to a solid-state hard disk, and the host can be, for example, a mobile terminal, a server, etc.; the method is specifically applied to the host file system, and garbage collection of the solid-state hard disk is implemented based on the host file system. Figure 2 is a flow chart of a garbage collection method for a solid state drive according to an embodiment of the present disclosure. Figure 2 As shown, the process includes the following steps.
[0054] Step S201, when garbage collection needs to be performed on the solid state drive, determine a first collection unit that needs to perform garbage collection.
[0055] For details, please see Figure 1 Step S101 of the illustrated embodiment will not be described in detail here.
[0056] Step S202, obtaining a first recycling unit segment linked list of a first recycling unit from a host file system; the first recycling unit segment linked list is used to record segments belonging to the first recycling unit.
[0057] For details, please see Figure 1 Step S102 of the illustrated embodiment will not be described in detail here.
[0058] Step S203, determining whether each segment in the first recycling unit segment linked list is valid.
[0059] Specifically, the above step S203 "determines whether each segment in the first recycling unit segment linked list is valid" includes the following steps S2031 to S2035.
[0060] Step S2031, determining the target file corresponding to the target segment in the first recycling unit segment linked list.
[0061] In this embodiment, for each segment in the first RU segment list, it is necessary to determine whether it is valid. For the convenience of description, the segments in the first RU segment list are called target segments to determine whether the target segments are valid. For each segment in the first RU segment list, its validity can be determined according to the processing method of the target segments.
[0062] Each segment is used to store part or all of the data of the corresponding file. The file corresponding to the target segment is called the target file, that is, the target segment corresponding to the first RU stores part or all of the data of the target file.
[0063] In some optional implementations, the host file system records and maintains metadata of each segment, i.e., segment metadata, based on which the correspondence between the segment and the file can be represented. Specifically, the above step S2031 "determine the target file corresponding to the target segment in the first recycling unit segment linked list" may include steps a1 to a2.
[0064] Step a1, obtaining the segment metadata of the target segment; the segment metadata includes a file identifier.
[0065] Step a2: determining the corresponding target file according to the file identifier in the segment metadata of the target segment.
[0066] In this embodiment, for each segment, segment metadata is provided, and the segment metadata can record the storage space corresponding to the segment, for example, the segment metadata can record the starting address and length of the corresponding segment storage space. In addition, the segment metadata also includes a file identifier. After storing part or all of the data of a file in a segment, the segment metadata records the corresponding file identifier, for example, the file identifier can be a file ID, etc.
[0067] For the target segment of the first RU, its segment metadata also includes a corresponding file identifier, which is the identifier of the target file. Therefore, according to the file identifier in the segment metadata of the target segment, the target file corresponding to the target segment can be determined.
[0068] Step S2032, obtaining a file segment linked list of the target file from the host file system; the file segment linked list of the target file is used to record the segments belonging to the target file.
[0069] In this embodiment, the host file system also records a segment linked list of each file, i.e., a file segment linked list. Specifically, based on the size of the file, it can be stored in one or more segments, i.e., the file corresponds to one or more segments, or in other words, one or more segments also belong to the file; these segments can form a corresponding linked list, i.e., a file segment linked list.
[0070] For example, if a file is divided into three discontinuous segments, the file segment list can record the relevant information of the three segments, and each segment can point to the starting address and length of the corresponding storage space. When the file needs to be read or written, the host file system will traverse the file segment list and access each segment in sequence to complete the read and write operations.
[0071] After determining the target linked list corresponding to the target segment, the file segment linked list of the target file can be determined, thereby determining each segment corresponding to the target file, that is, in which segment or segments the target file is stored.
[0072] Optionally, the above step S2032 "obtaining a file segment linked list of the target file from the host file system" includes steps b1 to b2.
[0073] Step b1, determining the index node metadata of the target file according to the file identifier of the target file; the index node metadata includes the file identifier and the file segment linked list.
[0074] Step b2, obtaining the file segment linked list of the target file from the index node metadata of the target file.
[0075] In this embodiment, the metadata of the index node (inode), that is, the index node metadata, is set for each file, and the corresponding file segment linked list is set in the index node metadata, so that after determining the index node metadata of the target file, the file segment linked list of the target file can be further obtained.
[0076] For example, the index node metadata records the link list header of the file segment link list, and the corresponding file segment link list can be obtained based on the link list header.
[0077] Step S2033, determining whether the segment corresponding to the target segment in the file segment linked list of the target file is valid.
[0078] In this embodiment, the file segment linked list can indicate whether each segment is valid. When writing a target file, each segment in the file segment linked list of the target file is initially valid; when the data in the target file is no longer used, the segment corresponding to the no longer used data in the file segment linked list of the target file is set to invalid. For example, if the entire target file is deleted, each segment of the target file is set to invalid.
[0079] Step S2034: When the segment corresponding to the target segment is valid, determine that the target segment is valid.
[0080] Step S2035: when the segment corresponding to the target segment is invalid, determine that the target segment is invalid.
[0081] In this embodiment, if the same segment exists in both the first RU segment list and the target file's file segment list, it means that the segment belongs to the corresponding first RU and stores part or all of the target file's data. If a segment is invalid in the target file's file segment list, it can be determined that the corresponding segment in the first RU segment list is also invalid, for example, the target segment is invalid; therefore, it can be determined whether the corresponding segment in the first RU segment list is valid.
[0082] Among them, a flag bit can be set for each entry in the file segment linked list to indicate whether it is valid; or, when some data in a file is set to invalid (for example, deleted), the segment corresponding to the invalidated data can be directly deleted from the file segment linked list of the file, and then by judging whether the target segment is in the file segment linked list of the target file, it can be determined whether the target segment is valid.
[0083] Step S204, when there is a valid segment in the first recycling unit segment linked list, rewrite the data corresponding to the valid segment to the second recycling unit, and write the valid segment to the second recycling unit segment linked list of the second recycling unit.
[0084] For details, please see Figure 1 Step S104 of the illustrated embodiment will not be described in detail here.
[0085] Step S205 , when there is an invalid segment in the first recycling unit segment linked list, release the storage space corresponding to the invalid segment.
[0086] For details, please see Figure 1 Step S105 of the illustrated embodiment will not be described in detail here.
[0087] The garbage collection method for a solid state drive provided in this embodiment can realize garbage collection of an SSD on the host side, and can help the system improve QoS. In addition, by using the segment metadata to record the corresponding file identifier, the file corresponding to each segment can be simply and quickly determined, and then the file segment linked list can be used to determine whether the corresponding segment is currently valid, so as to realize different processing for different segments and ensure that garbage collection can be correctly completed based on the host file system.
[0088] In this embodiment, another garbage collection method for a solid-state hard disk is provided, which can be applied to a host that can connect to a solid-state hard disk, and the host can be, for example, a mobile terminal, a server, etc.; the method is specifically applied to the host file system, and garbage collection of the solid-state hard disk is implemented based on the host file system.
[0089] Among them, multiple structures (Struct) are set for the host file system, corresponding metadata are recorded based on different structures, and these metadata are used to record and maintain relevant information of each RU and segment, so as to realize reading and writing of files and garbage collection based on the host file system.
[0090] In this embodiment, a structure of a recycling unit, namely a recycling unit structure (struct ru), is provided; the recycling unit structure includes: a recycling unit identification field (ru_id), a recycling unit handle identification field (ru_h_id) and a recycling unit extent list field (ru_extents); and, it may also include a field (reclaim_group) of the recycling group to which the recycling unit belongs.
[0091] For example, one representation of a recycling unit structure might look like this:
[0092]
[0093] Based on the recycling unit structure, the recycling unit metadata of each recycling unit, namely, RU metadata, can be recorded. Accordingly, the RU metadata includes: a recycling unit identifier, a recycling unit handle identifier, and a recycling unit segment linked list; and can also include the recycling group to which the recycling unit belongs.
[0094] Moreover, in the present embodiment, the structure of the extent is used to record the metadata of each extent. In the present embodiment, in addition to the starting address field (start) and the length field (length) of the storage space, the extent structure (struct extent) also adds: a file identification field (file_id), a first link pointer field (file_link) for linking to the file extent list (file_extents), and a second link pointer field (ru_link) for linking to the recovery unit extent list (ru_extents).
[0095] For example, one representation of a section structure might look like this:
[0096]
[0097] Based on the segment structure, the segment metadata of each segment can be recorded. Accordingly, the segment metadata includes: a file identifier, a first link pointer for linking to a file segment linked list, a second link pointer for linking to a recycling unit segment linked list, etc.
[0098] In addition, the present embodiment also provides an index node structure (struct file_inode) of the file, and the index node structure includes: a file identification field (file_id) and a file extent list field (file_extents).
[0099] For example, one representation of an index node structure might look like this:
[0100]
[0101]
[0102] Based on the index node structure, the index node metadata of each file can be recorded. Accordingly, the index node metadata includes: a file identifier and a file segment linked list.
[0103] In this embodiment, by introducing the above three kinds of metadata into the host file system and maintaining and updating each metadata, file reading and writing and garbage collection can be realized. Figure 3 is a flow chart of a garbage collection method for a solid state drive according to an embodiment of the present disclosure. Figure 3 As shown, the process includes the following steps.
[0104] Step S301, when writing the current file to the solid state drive, determining the current recycling unit and the current recycling unit handle to which the current file needs to be written.
[0105] In this embodiment, when a file needs to be written to the solid state drive, the file is made the current file, and the recycling unit and recycling unit handle that need to be written to the current file can be determined, that is, the current recycling unit and the current recycling unit handle, that is, the current RU and the current RUH.
[0106] When the host writes data, it can obtain the remaining capacity of the RU according to the FDP technology. If the amount of data to be written can be written into the RU (that is, the amount of data to be written is less than the remaining capacity), the RU can be kept unchanged and data can continue to be written to the RU, that is, the RU is used as a current RU for writing the current file; if the remaining capacity of the RU is insufficient, the RU needs to be replaced and the next RU is used as the current RU.
[0107] Furthermore, when writing a file, the host can specify a corresponding RUH, and after the RU pointed to by the RUH is used up, it can point to the next RU.
[0108] Step S302, record the recycling unit metadata of the current recycling unit and record the index node metadata of the current file; the recycling unit metadata includes: recycling unit identification, recycling unit handle identification and recycling unit segment linked list; the index node metadata includes file identification and file segment linked list.
[0109] Step S303, determine at least one segment corresponding to the current file, and record segment metadata of each segment; the segment metadata includes: a file identifier, a first link pointer for linking to a file segment linked list, and a second link pointer for linking to a recycling unit segment linked list.
[0110] Step S304: link the segment of the current file to the file segment linked list of the current file according to the first link pointer; and link the segment of the current file to the recycling unit segment linked list of the current recycling unit according to the second link pointer.
[0111] As described above, in the host file system, RU metadata of each RU and section metadata of each extent (Extent) are recorded; the RU metadata includes: RU identification (for example, RU ID) and RU section list; section metadata includes: file identification, a first link pointer for linking to the file section list and a second link pointer for linking to the RU section list. In addition, each file is recorded with corresponding index node metadata.
[0112] After determining the current RU and current RUH of the current file, in addition to writing part or all of the data of the current file to the current RU, the RU metadata of the current RU can also be recorded, which specifically includes the identifier of the current RU, the identifier of the current RUH, and the RU segment list of the current RU.
[0113] For the current file, the index node metadata of the current file is recorded, which specifically includes the identifier of the current file and the file segment linked list.
[0114] Furthermore, since a file can be divided into multiple segments, the current file may correspond to one segment or multiple segments. For each segment corresponding to the current file, segment metadata of each segment can be recorded based on the segment structure. As described above, the segment metadata includes: a file identifier, a first link pointer for linking to a file segment linked list, and a second link pointer for linking to a recycling unit segment linked list.
[0115] Specifically, the first link pointer is used to link the corresponding segment of the current file to the file segment linked list of the current file. The second link pointer is used to link the corresponding segment of the current file to the RU segment linked list of the current RU. Since the current file may be stored in different RUs, the second link pointer may be used to link to the RU segment linked list of different RUs for different segments of the same file.
[0116] Figure 4 FIG. 2 shows a schematic diagram of two RUs storing two files. Figure 4 As shown, for file 1, the index node metadata including the file segment linked list 1 is recorded for it; since file 1 is relatively large, it is divided into six segments, namely, segments E11 to E16, and the segment metadata of these six segments can be recorded; and based on the first link pointers in the segment metadata of these six segments, these six segments can be linked to the file segment linked list 1 of file 1 in sequence. A schematic diagram of the file segment linked list 1 can be seen in Figure 4 shown.
[0117] Similarly, for file 2, the index node metadata including the file segment linked list 2 is recorded for it; since file 2 is relatively small, it is divided into four segments, namely, segments E21 to E24, and the segment metadata of these four segments can be recorded; and based on the first link pointers in the segment metadata of these four segments, these four segments can be linked to the file segment linked list 2 of file 2 in sequence. A schematic diagram of the file segment linked list 2 can also be seen in Figure 4 shown.
[0118] And, if Figure 4 As shown in the figure, each RU corresponds to five sectors; it is assumed that before writing file 1 and file 2, RU 1 and RU2 are both empty. When writing file 1, most of the data of file 1 can be written to sectors E11 to E15 corresponding to RU 1; after RU 1 is full, the RU is updated and the remaining data of file 1 is written to the next RU, that is, to sector E16 corresponding to RU 2. Afterwards, when writing file 2, the data of file 2 is written to sectors E21 to E24 corresponding to RU 2.
[0119] Among them, corresponding RU metadata is recorded for RU 1 and RU 2, which includes their respective RU segment linked lists, namely RU segment linked list 1 and RU segment linked list 2. By configuring the second link pointer in the segment metadata of segments E11 to E15, segments E11 to E15 can be linked to RU segment linked list 1. Similarly, by configuring the second link pointer in segments E16 and segments E21 to E24, segments E16 and segments E21 to E24 can be linked to RU segment linked list 2. The generated RU segment linked list 1 and RU segment linked list 2 can be seen in Figure 4 .
[0120] Step S305: When garbage collection needs to be performed on the solid state drive, determine a first collection unit that needs to perform garbage collection.
[0121] For details, please see Figure 1 Step S101 of the illustrated embodiment will not be described in detail here.
[0122] Step S306, obtaining a first recycling unit segment linked list of the first recycling unit from the host file system; the first recycling unit segment linked list is used to record the segments belonging to the first recycling unit.
[0123] For details, please see Figure 1 Step S102 of the illustrated embodiment will not be described in detail here.
[0124] Step S307, determining whether each segment in the first recycling unit segment linked list is valid.
[0125] For details, please see Figure 1 Step S103 of the illustrated embodiment will not be described in detail here.
[0126] Step S308, when there is a valid segment in the first recycling unit segment linked list, rewrite the data corresponding to the valid segment to the second recycling unit, and write the valid segment to the second recycling unit segment linked list of the second recycling unit.
[0127] For details, please see Figure 1 Step S104 of the illustrated embodiment will not be described in detail here.
[0128] In some optional embodiments, as described above, in the host file system, recycling unit metadata of each recycling unit and segment metadata of each segment are recorded; the recycling unit metadata includes: a recycling unit identifier and a recycling unit segment linked list; the segment metadata includes: a file identifier, a first link pointer for linking to the file segment linked list, and a second link pointer for linking to the recycling unit segment linked list.
[0129] Furthermore, the above step S308 "writing the valid segment into the second recycling unit segment linked list of the second recycling unit" may specifically include steps c1 to c2.
[0130] Step c1, recording the recycling unit metadata of the second recycling unit; the recycling unit metadata of the second recycling unit includes the recycling unit identifier of the second recycling unit and the second recycling unit segment linked list.
[0131] Step c2, updating the second link pointer in the segment metadata of the valid segment from linking to the first recycling unit segment linked list to linking to the second recycling unit segment linked list;
[0132] In this embodiment, when data needs to be rewritten to the second RU, similar to the first RU, the RU metadata of the second RU needs to be recorded, and the RU metadata of the second RU includes the identifier of the second RU and the second RU segment linked list.
[0133] When rewriting the valid segment, the corresponding data is written to the second RU, and the valid segment needs to be linked from the first RU segment linked list to the second RU segment linked list. Specifically, the valid segment can be linked to the second RU segment linked list by updating the second link pointer of the second segment.
[0134] It can be understood that if the data storage location corresponding to the valid segment changes, the starting address, length and other data in the segment metadata of the valid segment also need to be updated, which is not described in detail here.
[0135] Step S309: when there is an invalid segment in the first recycling unit segment linked list, release the storage space corresponding to the invalid segment.
[0136] For details, please see Figure 1 Step S105 of the illustrated embodiment will not be described in detail here.
[0137] Optionally, the above step S309 “releasing storage space corresponding to the invalid segment” may include step d1.
[0138] Step d1, deleting the first link pointer and the second link pointer in the segment metadata of the invalid segment.
[0139] In this embodiment, after writing the current file and updating various metadata, if part or all of the data in the current file is set as invalid data that is no longer used, the segment corresponding to the invalid data in the file segment linked list of the current file is set to invalid.
[0140] If a segment corresponds to invalid data, for example, the data corresponding to the segment is deleted, the segment metadata of the segment can be updated to delete the first link pointer and the second link pointer therein, that is, the segment is no longer linked to any file segment linked list and RU segment linked list. When the segment is subsequently reallocated to a file, the first link pointer and the second link pointer in the segment metadata are reset.
[0141] In addition, optionally, when there is a valid segment in the first recycling unit segment linked list, the valid segment can also be deleted from the first recycling unit segment linked list; and, when there is an invalid segment in the first recycling unit segment linked list, the invalid segment is also deleted from the first recycling unit segment linked list.
[0142] By deleting the garbage collected segments in the RU segment list, the RU segment list can be updated, and the corresponding segments can be re-linked when storing data subsequently.
[0143] Figure 5 FIG. 4 shows a schematic diagram of garbage collection for RU2. Figure 5 As shown, after writing file 1 and file 2, if file 2 is deleted, all segments in file segment linked list 2 of file 2 are set to invalid, for example, all segments in file segment linked list 2 are deleted. Figure 5 The gray shaded segments in the figure indicate invalid segments.
[0144] Later, if garbage collection is required, the RU with the least number of valid RUs can be determined based on the RU metadata of each RU and the corresponding file segment linked list. Figure 5 Since there is only one valid data in RU 2 (the data corresponding to segment E16), garbage collection can be performed on RU 2.
[0145] During the garbage collection process of RU 2, based on the metadata recorded in the host file system, it can be determined that only segment E16 in RU segment list 2 of RU 2 is valid, and the remaining segments E21~E24 are invalid segments. Therefore, segment E16 is rewritten and the space corresponding to segments E21~E24 is released.
[0146] If the data corresponding to the segment E16 needs to be written to RU 3, that is, RU 3 is the second RU, RU segment linked list 3 (i.e., the second RU segment linked list) of RU 3 can be recorded, and segment E16 can be linked to RU segment linked list 3. The host file system can realize garbage collection of the SSD by updating various metadata.
[0147] In some optional implementations, the host can determine whether to perform garbage collection based on its actual situation. For example, the host can determine its own utilization rate. When the utilization rate is less than a preset threshold, it means that the host is relatively idle, and the host can choose to use the file system to perform garbage collection, such as initiating a garbage collection instruction to the host file system. If the utilization rate of the host is higher than the preset threshold, it means that the host's current resources are tight, and garbage collection can be performed by the solid-state drive.
[0148] In addition, the method can also realize hybrid garbage collection, that is, one part of RU performs garbage collection based on the host file system, and the other part performs garbage collection based on the SSD, that is, garbage collection is processed in the SSD.
[0149] Specifically, the above-mentioned step S305 "determining the first recycling unit that needs to be garbage collected" may include: determining the first recycling unit handle for garbage collection by the host file system, and using the recycling unit corresponding to the first recycling unit handle as the first recycling unit; determining the second recycling unit handle for garbage collection by the solid state drive, and instructing the solid state drive to perform garbage collection on the recycling unit corresponding to the second recycling unit handle.
[0150] In this embodiment, garbage collection can be performed according to different RUHs. The RU that needs to be garbage collected by the host file system is determined based on the first RUH, that is, the first RU; and the RU that is garbage collected by the SSD is determined based on the other second RUH, such as the third RU, so that the host file system performs garbage collection on the first RU, and the SSD performs garbage collection on the third RU.
[0151] The garbage collection method for the solid state drive provided in this embodiment records and maintains the segment metadata of each segment, the RU metadata of each RU, and the index node metadata of each file by the host file system. By maintaining and updating these metadata, based on the PDF technology, the host file system can realize garbage collection of RU, and the host can control the QoS of read and write behavior to a higher degree. In addition, it can be determined whether to perform garbage collection at the file system layer according to the operation status of the file system; and mixed garbage collection can be performed, that is, the file system layer and the SSD layer cooperate to realize the garbage collection of RU.
[0152] In this embodiment, a garbage collection device for a solid state drive is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" may be a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0153] This embodiment provides a garbage collection device for a solid state hard disk, which is applied to a host file system, such as Figure 6 As shown, including:
[0154] A recycling unit determination module 601 is used to determine a first recycling unit that needs to perform garbage collection when garbage collection is required for the solid state drive;
[0155] A linked list acquisition module 602 is used to acquire a first recycling unit segment linked list of the first recycling unit from the host file system; the first recycling unit segment linked list is used to record segments belonging to the first recycling unit;
[0156] A judgment module 603 is used to judge whether each segment in the first recycling unit segment chain list is valid;
[0157] The garbage collection module 604 is used to rewrite the data corresponding to the valid segment to the second recycling unit and write the valid segment to the second recycling unit segment list of the second recycling unit when there is a valid segment in the first recycling unit segment list; and release the storage space corresponding to the invalid segment when there is an invalid segment in the first recycling unit segment list.
[0158] In some optional implementations, the judging module 603 judges whether each segment in the first recycling unit segment linked list is valid, including:
[0159] Determine a target file corresponding to a target segment in the first recycling unit segment linked list;
[0160] Acquire a file segment linked list of the target file from the host file system; the file segment linked list of the target file is used to record the segments belonging to the target file;
[0161] Determine whether the segment corresponding to the target segment in the file segment linked list of the target file is valid;
[0162] If the segment corresponding to the target segment is valid, determining that the target segment is valid;
[0163] In a case where a segment corresponding to the target segment is invalid, it is determined that the target segment is invalid.
[0164] In some optional implementations, the determination module 603 determines the target file corresponding to the target segment in the first recycling unit segment linked list, including:
[0165] Acquire the segment metadata of the target segment; the segment metadata includes a file identifier;
[0166] A corresponding target file is determined according to a file identifier in the segment metadata of the target segment.
[0167] In some optional implementations, the determining module 603 obtains the file segment linked list of the target file from the host file system, including:
[0168] Determine the index node metadata of the target file according to the file identifier of the target file; the index node metadata includes the file identifier and the file segment linked list;
[0169] A file segment linked list of the target file is obtained from the index node metadata of the target file.
[0170] In some optional implementations, in the host file system, recycling unit metadata of each recycling unit and segment metadata of each segment are recorded; the recycling unit metadata includes: a recycling unit identifier and a recycling unit segment linked list; the segment metadata includes: a file identifier, a first link pointer for linking to the file segment linked list, and a second link pointer for linking to the recycling unit segment linked list;
[0171] The garbage collection module 604 writes the valid segment into the second recycling unit segment linked list of the second recycling unit, including:
[0172] Recording the recycling unit metadata of the second recycling unit; the recycling unit metadata of the second recycling unit includes the recycling unit identifier of the second recycling unit and the second recycling unit segment linked list;
[0173] updating the second link pointer in the segment metadata of the valid segment from linking to the first recycling unit segment linked list to linking to the second recycling unit segment linked list;
[0174] The garbage collection module 604 releases the storage space corresponding to the invalid segment, including:
[0175] The first link pointer and the second link pointer in the segment metadata of the invalid segment are deleted.
[0176] In some optional implementations, the garbage collection module 604 is further configured to:
[0177] If there is a valid segment in the first recycling unit segment linked list, deleting the valid segment from the first recycling unit segment linked list;
[0178] When there is an invalid segment in the first recycling unit segment linked list, the invalid segment is deleted from the first recycling unit segment linked list.
[0179] In some optional implementations, the recycling unit determination module 601 determines the first recycling unit that needs to perform garbage collection, including:
[0180] Determine a first recycling unit handle for garbage collection by the host file system, and use the recycling unit corresponding to the first recycling unit handle as the first recycling unit;
[0181] A second recycling unit handle for garbage collection by the solid state drive is determined, and the solid state drive is instructed to perform garbage collection on a recycling unit corresponding to the second recycling unit handle.
[0182] In some optional implementations, the device further includes a writing module, configured to:
[0183] When writing a current file to a solid state drive, determining a current recycling unit and a current recycling unit handle to which the current file needs to be written;
[0184] Recording the recycling unit metadata of the current recycling unit; the recycling unit metadata includes: a recycling unit identifier, a recycling unit handle identifier and a recycling unit segment linked list;
[0185] Recording the index node metadata of the current file; the index node metadata includes a file identifier and a file segment linked list;
[0186] Determine at least one section corresponding to the current file, and record section metadata of each section; the section metadata includes: a file identifier, a first link pointer for linking to a file section chain list, and a second link pointer for linking to a recycling unit section chain list;
[0187] The segments of the current file are linked to the file segment linked list of the current file according to the first link pointer; and the segments of the current file are linked to the recycling unit segment linked list of the current recycling unit according to the second link pointer.
[0188] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0189] The garbage collection device of the solid-state hard disk in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, including a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0190] The present disclosure also provides a computer device having the above Figure 6 The garbage collection device of the solid state drive is shown.
[0191] See also Figure 7 , Figure 7 is a schematic diagram of a computer device provided by an optional embodiment of the present disclosure, such as Figure 7 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 7 A processor 10 is taken as an example.
[0192] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0193] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
[0194] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be linked to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0195] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0196] The computer device also includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means. Figure 7 The example of connecting through bus is taken in the following.
[0197] The input device 30 can receive input digital or character information, and generate key signal input related to the user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display and a plasma display. In some optional embodiments, the display device can be a touch screen.
[0198] The computer device may further include a communication interface for the computer device to communicate with other devices or a communication network.
[0199] The embodiments of the present disclosure also provide a computer-readable storage medium. The above-mentioned method according to the embodiments of the present disclosure can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium and downloaded through a network, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state drive, etc.; further, the storage medium can also include a combination of the above-mentioned types of memory. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0200] A part of the present disclosure may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present disclosure through the operation of the computer. Those skilled in the art should understand that the existence of computer program instructions in computer-readable media includes, but is not limited to, source files, executable files, installation package files, etc., and accordingly, the way in which computer program instructions are executed by a computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to the computer.
[0201] Although the embodiments of the present disclosure are described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present disclosure, and such modifications and variations should all be included in the protection scope of the present disclosure.
Claims
1. A garbage collection method for a solid state hard disk, characterized in that: Applied to a host file system, the method comprises: In the case where garbage collection needs to be performed on the solid state drive, determining a first recycling unit that needs to perform garbage collection; Acquire a first recycling unit segment linked list of the first recycling unit from the host file system; the first recycling unit segment linked list is used to record segments belonging to the first recycling unit; Determine whether each segment in the first recycling unit segment linked list is valid; If there is a valid segment in the first recycling unit segment linked list, rewrite the data corresponding to the valid segment to the second recycling unit, and write the valid segment to the second recycling unit segment linked list of the second recycling unit; When there is an invalid segment in the first recovery unit segment linked list, the storage space corresponding to the invalid segment is released.
2. The method according to claim 1, characterized in that The determining whether each segment in the first recycling unit segment linked list is valid includes: Determine a target file corresponding to a target segment in the first recycling unit segment linked list; Acquire a file segment linked list of the target file from the host file system; the file segment linked list of the target file is used to record the segments belonging to the target file; Determine whether the segment corresponding to the target segment in the file segment linked list of the target file is valid; If the segment corresponding to the target segment is valid, determining that the target segment is valid; In a case where a segment corresponding to the target segment is invalid, it is determined that the target segment is invalid.
3. The method according to claim 2, characterized in that The determining of the target file corresponding to the target segment in the first recycling unit segment linked list includes: Acquire the segment metadata of the target segment; the segment metadata includes a file identifier; A corresponding target file is determined according to a file identifier in the segment metadata of the target segment.
4. The method according to claim 3, characterized in that The step of obtaining the file segment linked list of the target file from the host file system includes: Determine the index node metadata of the target file according to the file identifier of the target file; the index node metadata includes the file identifier and the file segment linked list; A file segment linked list of the target file is obtained from the index node metadata of the target file.
5. The method according to claim 1, characterized in that In the host file system, recycling unit metadata of each recycling unit and segment metadata of each segment are recorded; The recycling unit metadata includes: a recycling unit identifier and a recycling unit segment chain list; the segment metadata includes: a file identifier, a first link pointer for linking to the file segment chain list, and a second link pointer for linking to the recycling unit segment chain list; The step of writing the valid segment into the second recycling unit segment linked list of the second recycling unit comprises: Recording the recycling unit metadata of the second recycling unit; the recycling unit metadata of the second recycling unit includes the recycling unit identifier of the second recycling unit and the second recycling unit segment linked list; updating the second link pointer in the segment metadata of the valid segment from linking to the first recycling unit segment linked list to linking to the second recycling unit segment linked list; The releasing the storage space corresponding to the invalid segment includes: The first link pointer and the second link pointer in the segment metadata of the invalid segment are deleted.
6. The method according to claim 1, characterized in that Also includes: If there is a valid segment in the first recycling unit segment linked list, deleting the valid segment from the first recycling unit segment linked list; When there is an invalid segment in the first recycling unit segment linked list, the invalid segment is deleted from the first recycling unit segment linked list.
7. The method according to any one of claims 1 to 6, characterized in that The step of determining a first recycling unit that needs to perform garbage collection includes: Determine a first recycling unit handle for garbage collection by the host file system, and use the recycling unit corresponding to the first recycling unit handle as the first recycling unit; A second recycling unit handle for garbage collection by the solid state drive is determined, and the solid state drive is instructed to perform garbage collection on a recycling unit corresponding to the second recycling unit handle.
8. The method according to any one of claims 1 to 6, characterized in that Also includes: When writing a current file to a solid state drive, determining a current recycling unit and a current recycling unit handle to which the current file needs to be written; Recording the recycling unit metadata of the current recycling unit; the recycling unit metadata includes: a recycling unit identifier, a recycling unit handle identifier and a recycling unit segment linked list; Recording the index node metadata of the current file; the index node metadata includes a file identifier and a file segment linked list; Determine at least one section corresponding to the current file, and record section metadata of each section; the section metadata includes: a file identifier, a first link pointer for linking to a file section chain list, and a second link pointer for linking to a recycling unit section chain list; The segments of the current file are linked to the file segment linked list of the current file according to the first link pointer; and the segments of the current file are linked to the recycling unit segment linked list of the current recycling unit according to the second link pointer.
9. A garbage collection device for a solid state hard disk, characterized in that: Applied to a host file system, the device comprises: A recycling unit determination module, used to determine a first recycling unit that needs to perform garbage collection when garbage collection is required for the solid state drive; a linked list acquisition module, used to acquire a first recycling unit segment linked list of the first recycling unit from the host file system; the first recycling unit segment linked list is used to record segments belonging to the first recycling unit; A judgment module, used to judge whether each segment in the first recycling unit segment chain list is valid; A garbage collection module is used to rewrite the data corresponding to the valid segment to the second recycling unit and write the valid segment to the second recycling unit segment list of the second recycling unit when there is a valid segment in the first recycling unit segment list; and to release the storage space corresponding to the invalid segment when there is an invalid segment in the first recycling unit segment list.
10. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the garbage collection method for a solid state drive according to any one of claims 1 to 8 by executing the computer instructions.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the garbage collection method for a solid state hard disk according to any one of claims 1 to 8.
Citation Information
Patent Citations
Data deletion and garbage collection method, device and system and storage medium
CN112783420A
Garbage collection method of file system and related device
CN115774515A
Garbage collection method, distributed storage system and computer readable storage medium
CN119105692A
Storage system garbage collection and defragmentation
US10706014B1
Storage system and method
US20230205460A1