Solid state disk garbage collection and host write address repetition detection method
By designing a hardware acceleration module in SSD, the comparison process between the physical address and the host write address during garbage collection is simplified, and the problems of large CPU computing volume and affected reading and writing speed in the prior art are solved, and the effect of improving data transmission efficiency and reducing power consumption is achieved.
Patent Information
- Application Number
- CN202411536566.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-31
- Publication Date
- 2025-03-18
AI Technical Summary
When garbage collection, existing SSDs need to compare all garbage collection physical blocks with host write addresses, resulting in large CPU computing volume, affecting read and write speed and increasing power consumption.
Design a hardware acceleration module to simplify the comparison process and reduce the CPU computing volume by comparing the physical address read by garbage collected with the address covered by the host.
The hardware acceleration module simplifies the comparison process, improves the speed of garbage collection and data writing, reduces power consumption, and improves data transmission efficiency.
Smart Images

Figure CN119645888A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of solid state hard disk storage, and more specifically to a solid state hard disk garbage collection and host write address duplication detection method. Background Art
[0002] When existing SSDs perform garbage collection, they read all valid data in the original physical block, clean up the unavailable physical location data, and write the available data into the new physical block, so as to achieve the purpose of garbage collection to clean up the unavailable data in the SSD. During this period, if the host overwrites the original physical block read during garbage collection, the garbage collection needs to mark the original physical block as unavailable, and no new physical block needs to be written.
[0003] The main solution to the above problem is that when the host writes a command, the CPU needs to compare all garbage collection physical blocks. When the same location is overwritten, the physical location of the garbage collection is marked as unavailable. However, this method requires processing a large amount of data each time it is compared, which affects the read and write speed, increases the computing power of the SSD master CPU, and also increases the power consumption of the SSD.
[0004] As the transmission speed of SSD increases, there are increasingly higher requirements for the efficiency of garbage collection. During garbage collection, the comparison algorithm and calculation time of overwriting the same physical location as the host need to be streamlined. Therefore, it is necessary to improve the efficiency of garbage collection through hardware acceleration and optimization algorithm during garbage collection, thereby minimizing the impact on the host write speed. Summary of the invention
[0005] The object of the present invention is to provide a solid state hard disk garbage collection and host write address duplication detection method which can effectively improve the efficiency of data transmission.
[0006] According to one aspect of the present invention, a method for solid state drive garbage collection and host write address duplication detection is provided.
[0007] The host overwrites the data of the logical address, finds the first physical address to be overwritten, and writes it into the hardware acceleration module;
[0008] Garbage collection starts batch reading of continuous physical address data, and writes the second physical address currently read into the hardware acceleration module;
[0009] The hardware acceleration module compares the first physical address with the second physical address;
[0010] After garbage collection reads the data, the comparison result of the hardware acceleration module is obtained. If the comparison is consistent, the current second physical address is skipped and the continuous physical address data is continued to be read. If the comparison is inconsistent, the second physical address data is written into the new physical address;
[0011] Repeat the above steps until garbage collection is complete.
[0012] In some implementations, after garbage collection reads the data, the comparison result of the hardware acceleration module is obtained. If the comparison is consistent, the second physical address data is marked as unavailable, and the second physical address data cache is released.
[0013] In some implementations, when the host overwrites data at a logical address, the first physical address to be overwritten is queried through the L2P table.
[0014] In some implementations, the second physical address is identified by a bit, and the bit of the second physical location is written into a hardware acceleration module.
[0015] In some implementations, the hardware acceleration module compares the second physical location identified by the application bit with the first physical address overwritten by the host.
[0016] The beneficial effect is as follows: the present invention combines software and hardware, and through a hardware-specific circuit, namely a hardware acceleration module, can effectively simplify the process of comparing the physical address read during SSD garbage collection with the host overwrite write address, thereby reducing the CPU's computational workload while speeding up garbage collection and data writing, thereby achieving the purpose of improving data transmission efficiency and reducing power consumption. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 The present invention is a flowchart of a solid state drive garbage collection and host write address duplication detection method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0018] The present invention will be further described below in conjunction with the accompanying drawings.
[0019] The present invention provides a method for detecting duplicate write addresses of solid-state hard disk garbage collection and host. By designing a hardware acceleration module as a garbage collection verification area, the hardware acceleration module is used to compare the second physical address read by the current garbage collection with the first physical address overwritten by the host during garbage collection. When the two addresses conflict, that is, when the second physical address read during the garbage collection process is the same as the first physical address that the host attempts to write, the second physical block address read during garbage collection is marked as unavailable, the second physical address data cache is released, and garbage collection continues for subsequent physical addresses. When the host has a new physical address written, it is updated and compared in this way until the garbage collection of the current physical block is completed.
[0020] Specifically, when the solid-state drive (SSD) starts garbage collection, it will read data from multiple physical addresses at one time, such as reading data from four physical addresses PA001, PA002, PA003, and PA004 at one time, and then write the data from these four physical addresses into the physical addresses of PA101, PA102, PA103, and PA104. If the host overwrites the PA104 address during the garbage collection process, that is, the hardware acceleration module compares the physical addresses PA001, PA002, PA003, and PA004 read during garbage collection with the physical addresses PA101, PA102, PA103, and PA104 overwritten by the host, and the physical address PA004 read during garbage collection conflicts with the physical address PA104 overwritten by the host, then garbage collection only needs to write data from PA101, PA102, and PA103. Since PA104 is overwritten by the host to another physical address, the data at this physical address can be directly discarded during the garbage collection process, and the firmware can continue to process the next round of commands.
[0021] Figure 1 The process of a solid state drive garbage collection and host write address duplication detection method of the present invention is schematically shown. Figure 1 As shown, the host sends a write command and data, and the SSD obtains the host's overwrite command. When the host overwrites the data of the logical address, the first physical address corresponding to the overwritten logical address is found by searching the L2P table, and the obtained first physical address is written into the hardware acceleration module, and the data is written into the SSD, and then the next write command of the host is processed.
[0022] When garbage collection starts to read physical block data, the continuous physical address data in the physical block is read in batches, and the physical address list currently being garbage collected is marked with a bit, and the bit marking the second physical position currently being garbage collected is written into the hardware acceleration module. The hardware acceleration module provides multiple comparison positions, and the current maximum comparison position is 32768. The hardware acceleration module compares the second physical position marked by the corresponding bit with the first physical address overwritten by the host. When the garbage collection reads the data and needs to move the data to a new physical address, the result calculated by the hardware acceleration module is obtained. If the comparison is consistent and there is a conflict, the current second physical address is skipped, and the current second physical address data is marked as unavailable, and the current second physical address data cache is released; the next recovery reads the continuous physical address data until the read second physical address is inconsistent with the first physical address without conflict. If there is no conflict, the current data is written to the new physical address. After processing the physical address data read in the current garbage collection batch, the priority of the host read and write and garbage collection tasks is recalculated according to the remaining space of the SSD, and the next round of host command processing or garbage collection behavior is continued.
[0023] The above are only some embodiments of the present invention, which are only used to illustrate the technical solutions of the present invention, but not to limit them. For those skilled in the art, without departing from the creative concept of the present invention, the technical solutions recorded in the above embodiments are modified, or some or all of the technical features are replaced by equivalents, which all belong to the protection scope of the present invention.
Claims
1. A solid state drive garbage collection and host write address duplication detection method, characterized in that: The host overwrites the data of the logical address, finds the first physical address to be overwritten, and writes it into the hardware acceleration module; Garbage collection starts batch reading of continuous physical address data, and writes the second physical address currently read into the hardware acceleration module; The hardware acceleration module compares the first physical address with the second physical address; After garbage collection reads the data, the comparison result of the hardware acceleration module is obtained. If the comparison is consistent, the current second physical address is skipped and continuous physical address data is continued to be read. If the comparison is inconsistent, the second physical address data is written into a new physical address. Repeat the above steps until garbage collection is complete.
2. The solid state drive garbage collection and host write address duplication detection method according to claim 1, characterized in that: After garbage collection reads the data, the comparison result of the hardware acceleration module is obtained. If the comparison is consistent, the second physical address data is marked as unavailable and the second physical address data cache is released.
3. The solid state drive garbage collection and host write address duplication detection method according to claim 1, characterized in that: When the host overwrites the data of the logical address, the first physical address to be overwritten is queried through the L2P table.
4. The solid state drive garbage collection and host write address duplication detection method according to claim 1, characterized in that: The second physical address is identified by a bit, and the bit of the second physical location is written into the hardware acceleration module.
5. The solid state drive garbage collection and host write address duplication detection method according to claim 4, characterized in that: The hardware acceleration module compares the second physical location identified by the application bit with the first physical address overwritten by the host.
Citation Information
Cited By
Junk data recovery processing method, electronic equipment, storage medium and program product
CN120743800A