A ZNS SSD data partial update method based on patch
By using the patch-based data part update method in ZNS SSD, identifying and only updating the data modification part, the write amplification and performance degradation caused by application-level garbage collection is solved, and the effects of reducing invalid data, reducing garbage collection frequency and improving system performance are achieved.
Patent Information
- Application Number
- CN202411362469.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-27
- Publication Date
- 2025-04-18
- Estimated Expiration
- 2044-09-27
AI Technical Summary
In ZNS SSD, application-level garbage collection leads to write amplification, I/O blocking, and reduces system performance.
The patch-based data part update method is adopted to identify the data modification parts through XOR operation, and only these parts are updated, new data is added and written into the free area, the data is divided into multiple parts and stored, and the address information of each part is linked using a binary tree structure.
Reduces the amount of invalid data, reduces the number and time of garbage collection, reduces write amplification, improves system performance, and extends disk life.
Smart Images

Figure CN119376620B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computer storage, and in particular to a patch-based ZNS SSD data partial update method. Background Art
[0002] With the rapid development of the big data era, traditional block interfaces are gradually unable to meet the performance requirements of big data storage. The Zoned Namespace storage interface has the advantages of fast sequential write speed, low DRAM cost, and no device-side garbage collection, avoiding the performance overhead caused by traditional block interfaces and becoming a more promising alternative. Zoned Namespace (ZNS) SSD is a solid-state drive (SSD) that uses partition management technology to optimize the performance, life, and space utilization of storage devices. ZNS technology divides the storage space of the SSD into multiple zones and manages these zones in an orderly sequential write manner. In traditional SSDs, data can be written randomly to any location. Although this is flexible, it will cause write amplification and frequent garbage collection operations, affecting the performance and life of the SSD. ZNS reduces the write amplification effect by stipulating that data writing in each zone must be performed in sequence. This sequential writing method allows data to be stored continuously in the physical medium, which can reduce the number of data migration and erasures, simplify the garbage collection process, and reduce the degree of wear on the flash memory. However, there is still application-level garbage collection in ZNS SSDs, which will cause write amplification and I / O blocking, resulting in a decrease in overall system performance. One way to reduce the write amplification caused by this type of garbage collection is to reduce the amount of invalid data.
[0003] Invalid data is generated by data update operations. After the data update is completed, the entire old data will be marked as invalid data, waiting for garbage collection processing triggered by the subsequent system. However, in fact, in applications (such as F2FS file systems), only a part of the data is modified. Marking the entire data as invalid data wastes storage space and write performance and increases garbage collection. Therefore, the present invention discloses a ZNS SSD data partial update method based on patches. Summary of the invention
[0004] In order to solve the problems existing in the prior art, the present invention provides a patch-based ZNS SSD data partial update method, which only updates the data modification part, identifies the data modification part by XOR operation of new and old data, and selects the data update segment by minimization principle. At this time, the data is divided into two parts, one is the data update segment, and the other is the data non-update segment. The new data of the data update segment is appended to the free area by the append write mode of ZNS SSD, and the data update segment is marked as invalid data, and the content of the address mapping table is modified at the same time. In this way, a complete data will be split into multiple parts and stored in the device in a scattered manner. In order to ensure the integrity of the data, the address information of each part can be linked by a binary tree structure. When reading the data, the binary tree is traversed in pre-order to connect the data parts into complete data in sequence. This method of marking only the modified part of the data as invalid data can reduce the amount of invalid data existing in the system and solve the problems mentioned in the above background technology.
[0005] To achieve the above object, the present invention provides the following technical solution: a patch-based ZNS SSD data partial update method, comprising the following steps:
[0006] S1, initialize the storage system and divide the data into N segments;
[0007] S2, when the i-th data update request arrives, analyze whether the preset threshold N is reached, if so, execute step S4; otherwise, calculate the data patch P;
[0008] S3, identifying and analyzing the distribution of the data patch. If the patch only exists in a certain continuous data segment, select the smallest data segment to be updated, write the data segment into the free area by remote update, mark the old data segment as invalid, and then execute step S5; if the patch exists in multiple discontinuous data segments, execute step S4;
[0009] S4, update the entire data, and mark all data segments related to the data as invalid, and i is 0 at this time;
[0010] S5. Change the corresponding address mapping table information, execute i++ to prepare for processing the next update, and return to step S2 to wait for the next update request.
[0011] Preferably, in step S3, when updating for the first time, the data is divided into three segments based on the patch P, namely the patch front segment A, the patch segment B, and the patch back segment C, and the smallest data segment is selected. As the updated data segment, the corresponding updated data segment is written to the disk, and the updated data segment corresponding to the original data / old data is marked as invalid data.
[0012] Preferably, in step S3, for the i-th (i < N) update, if P exists in multiple discontinuous data segments, the entire data is directly updated to reduce data fragmentation; if P only exists in one continuous data segment, then is selected as the updated data segment, and the corresponding updated data segment is written to the disk, and the updated data segment corresponding to the original data is marked as invalid data.
[0013] Preferably, in step S5, the specific change of the corresponding address mapping table information is as follows: two fields are added to the address mapping table, namely the previous segment pointer and the next segment pointer, which respectively point to the mapping information of the previous segment of data and the next segment of data;
[0014] If the data update adopts a partial update method, and each time a part of the data in the front or the back is updated, an address table entry will be added to store the address information of the updated data segment, and the previous segment pointer or the next segment pointer of the original address mapping table entry will point to the corresponding updated data segment address table entry;
[0015] If the data update adopts the method of directly updating the entire data, at this time, the address information binary tree has more than one node, both the previous segment pointer and the next segment pointer are set to NULL, and the region number, start address, and end address information are modified.
[0016] The beneficial effects of the present invention are:
[0017] 1) Reducing the write amplification caused by GC: Compared with the full update of the entire data, the partial data update reduces the amount of data updated, thereby reducing the amount of invalid data caused by data updates, reducing the number and time of garbage collection, reducing the write amplification caused by garbage collection, and improving system performance.
[0018] 2) Improving the write performance: From the perspective of the application program, when updating the same amount of data, the partial data update updates the entire data with a smaller write amount, and the update speed is faster.
[0019] 3) Extending the disk life: The more times the system performs garbage collection, the more serious the disk aging is. Since the partial data update can reduce the number of garbage collections, it can also extend the system disk life. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 It is a schematic flow chart of the steps of the method for partial data update of ZNS SSD based on patches in the embodiment of the present invention;
[0021] Figure 2 It is a schematic diagram for identifying data patches in the embodiment of the present invention;
[0022] Figure 3 It is a schematic diagram for updating data segments in the embodiment of the present invention;
[0023] Figure 4 This is a schematic diagram of changing the address mapping relationship in the embodiment of the present invention. Detailed implementation manners
[0024] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0025] Please refer to Figure 1-Figure 4 , the present invention provides a technical solution: a method for partially updating ZNS SSD data based on patches, which is divided into three steps: identifying data patches, updating data segments, and changing the address mapping relationship. The specific implementation is as follows:
[0026] Identifying data patches: Perform an exclusive OR operation on the original data and the new data to find the data patch P (the actual modified part of the data);
[0027] Updating data segments: First, it is necessary to determine the data part that needs to be updated. To balance between high-performance optimization and data fragmentation, there are at most N segments of data in the storage space. When the data reaches N segments, the next update directly updates the entire data in a different location. When updating for the first time, based on the patch P, the data is divided into three segments, namely the pre-patch segment A, the patch segment B, and the post-patch segment C. Select as the updated data segment, and write the corresponding updated data segment to the disk, and mark the updated data segment corresponding to the original data as invalid data. At this time, the data is divided into two parts in the storage; for the i-th (i < N) update, if P exists in multiple data segments, the entire data is directly updated to reduce data fragmentation; if P only exists in one continuous data segment, repeat the above steps of selecting the updated data segment.
[0028] Changing the address mapping relationship: Add two fields to the address mapping table, namely the pre-segment pointer and the post-segment pointer, which respectively point to the mapping information of the previous segment of data and the next segment of data, as shown in Table 1 below:
[0029] Table 1 Address mapping table entry
[0030] Front pointer Logical address Area Code Starting address End Address Back pointer
[0031] If the data update adopts the partial update method, each time the previous part of the data or the next part of the data is updated, an address table entry will be added to store the updated data segment address information, and the front pointer or the back pointer of the original address mapping table entry will point to the corresponding updated data segment address table entry. If the data update adopts the direct update of the entire data method, the address information binary tree at this time has more than one node, and the front pointer and the back pointer are set to NULL, and the area number, start address and end address information can be modified.
[0032] like Figure 1 As shown, the partial data update method of the ZNS SSD of the present invention includes the following implementation steps:
[0033] (1) Initialize the storage system. The data layout of zone 0 and zone 1 in the system is as follows: Figure 3 (a) shows that the data can only be divided into N segments;
[0034] (2) When the i-th data update request arrives, analyze whether it reaches the preset threshold N. Assume that N = 3. If so, execute step (4). Figure 3 (e); otherwise, the data patch is calculated, such as Figure 2 As shown;
[0035] (3) Analyze the distribution of data patches. If the patch only exists in a certain continuous data segment, such as Figure 3 (b) and Figure 3 As shown in (d), the smallest data segment to be updated is selected, the data segment is written into the free area through the off-site update method, and the old data segment is marked as invalid, and then step (5) is executed; if the patch exists in multiple discontinuous data segments, such as Figure 3 (c), then execute step (4);
[0036] (4) Update the entire data and mark all data segments related to the data as invalid. At this time, i is 0;
[0037] (5) Change the corresponding address mapping table information, such as Figure 4 Execute i++ to prepare for processing the next update, and return to step (2) to wait for the next update request.
[0038] There are two ways to read data: one is the traditional reading method, where the entire data is stored in continuous addresses and its address mapping information is only stored in one address mapping table entry, such as Figure 4(I), (III), and (V) in the figure. The second method is to use in-order traversal to read. Since the entire data is stored in a scattered manner, there are multiple address mapping table entries, and these address mapping table entries are connected through a binary tree. In-order traversal is used to read the data content corresponding to each node, such as Figure 4 As shown in (II) and (IV) in Figure 4 In (IV), partial data in the offset ranges 512-612 and 862-1112 in region 1 and partial data in the offset range 1374-1642 in region 0 are read in an in-order traversal, and then the data contents are connected into a complete data in the reading order. At this point, the implementation steps of the partial data update method of the ZNS SSD of the present invention are all completed. Compared with the full update of the entire data, the partial data update of the present invention reduces the amount of data update, thereby reducing the amount of invalid data caused by data update, reducing the number and time of garbage collection, reducing the write amplification caused by garbage collection, and improving system performance.
[0039] In the embodiments provided in the embodiments of the present invention, it should be noted that, in this article, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0040] The terms used in the embodiments of the present invention are only for the purpose of describing specific embodiments, and are not intended to limit the present invention. The singular forms "a", "said" and "the" used in the embodiments of the present invention and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings.
[0041] It should be understood that the term "and / or" used in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0042] The word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrases "if it is determined" or "if (stated condition or event) is detected" may be interpreted as "when it is determined" or "in response to determining" or "when detecting (stated condition or event)" or "in response to detecting (stated condition or event)", depending on the context.
[0043] The "first\second" mentioned in the embodiments is only to distinguish similar objects, and does not represent a specific order for the objects. It is understandable that the "first\second" can be interchanged with the specific order or sequence where permitted. It should be understood that the objects distinguished by "first\second" can be interchanged where appropriate, so that the embodiments described herein can be implemented in an order other than those illustrated or described herein.
[0044] Although the present invention has been described in detail with reference to the aforementioned embodiments, it is still possible for those skilled in the art to modify the technical solutions described in the aforementioned embodiments, or to make equivalent substitutions for some of the technical features therein. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A patch-based ZNS SSD data partial update method, characterized in that: It includes the following steps: S1. Initialize the storage system and divide the data into N segments; S2. When the i-th data update request arrives, analyze whether the preset threshold N is reached. If so, execute step S4; otherwise, calculate the data patch P; S3. Identify and analyze the distribution of the data patch. If the patch only exists in a certain continuous data segment, select the smallest data segment to be updated, write the data segment into the idle area through off-site update, mark the old data segment as invalid, and then execute step S5; If the patch exists in multiple discontinuous data segments, execute step S4; S4. Update the entire data and mark all data segments related to this data as invalid. At this time, i is 0; S5. Modify the corresponding address mapping table information, execute i++ to prepare for processing the next update, and return to step S2 to wait for the next update request.
2. The patch-based ZNS SSD data partial update method according to claim 1, characterized in that: In step S3, during the first update, the data is divided into three segments based on patch P, namely, the pre-patch segment A, the patch segment B, and the post-patch segment C. The smallest data segment is selected. As the updated data segment, the corresponding updated data segment is written to the disk, and the updated data segment corresponding to the original data / old data is marked as invalid data.
3. The patch-based ZNS SSD data partial update method according to claim 1, characterized in that: In step S3, for the i-th (i < N) update, if P exists in multiple discontinuous data segments, directly update the entire data to reduce data fragmentation; If P only exists in one continuous data segment, select As the updated data segment, the corresponding updated data segment is written to the disk, and the updated data segment corresponding to the original data is marked as invalid data.
4. The patch-based ZNS SSD data partial update method according to claim 1, characterized in that: In step S5, the specific modification of the corresponding address mapping table information is: add two fields in the address mapping table, namely the previous segment pointer and the next segment pointer, which respectively point to the mapping information of the previous data segment and the next data segment; If the data update adopts the partial update method, each time a part of the data in the front or the back is updated, an address table entry will be added to store the address information of the updated data segment, and the previous segment pointer or the next segment pointer of the original address mapping table entry will point to the corresponding updated data segment address table entry; If the data update adopts the method of directly updating the entire data, at this time, the address information binary tree has more than one node. Set both the previous segment pointer and the next segment pointer to NULL, and modify the area number, start address, and end address information.
Citation Information
Patent Citations
Multi-thread software dynamic upgrading method based on asynchronous check points
CN104111848A
Data storage method and device, electronic equipment and storage medium
CN114879909A