A Zone Reset Optimization Method Based on ZNS SSD
Patent Information
- Application Number
- CN202311425365.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-30
- Publication Date
- 2026-09-25
- Estimated Expiration
- 2043-10-30
AI Technical Summary
[0004]将区域操作交给主机,使得ZNS SSD的数据放置更具有灵活性,可以更好地应用数据的生命特征信息进行数据的放置,以减小写放大;然而为了提高ZNS SSD的数据吞吐量,在某些时候,Zone内部尚未被完全使用就会面临重置擦除操作;在Zone重置时,Zone内部存在部分未使用的Block,但是这部分Block也将被擦除,造成严重的空间浪费;Zone经过重置之后,写指针会被重置到Zone的起始位置,数据从空闲的Zone内部的起始位置向后顺序放置,造成Zone内部Block的分配出现差异;进而产生Zone内部的磨损不均问题,严重影响ZNSSSD的使用寿命;如果没有适当的Zone内部Block管理方式,会降低Zone内部的空间利用率,缩短ZNS SSD的寿命
[0009]本发明针对Zone内部不必要的Block擦除问题,提出了一种Zone中部分Block重置策略,避免了Zone内部不必要的Block擦除,使得Zone的空间利用率更高。
Smart Images

Figure CN117453129B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of computer storage, specifically relating to a Zone reset optimization method based on ZNS SSD. Background Technology
[0002] ZNS is a new solid-state drive interface that offers higher storage capacity, better performance, and more flexible data processing compared to traditional block interfaces. ZNS SSDs abstract away the complexities of flash memory hardware, managing data through partitions. Logical blocks are divided into regions rather than individual arrays. Each region has specific restrictions, allowing random or sequential reads but requiring sequential writes, and the region must be erased before being reset. Simultaneously, it can reduce or even eliminate the Flash Translation Layer (FTL) function, offloading these functions to host software, thus reducing DRAM consumption and over-provisioning in the SSD. Ideally, the host can categorize application-specific data by lifetime based on access patterns and allocate data with similar lifetimes to a single region. This allows all data in a region to fail simultaneously, further eliminating write amplification issues caused by data migration.
[0003] Compared to traditional block interface SSDs, ZNS SSDs exhibit several significant advantages. First, they reduce DRAM consumption for mapping tables within the device; only coarse-grained mapping tables between regions and blocks are pre-configured within the device. Second, they avoid in-device garbage collection and over-provisioning; the host directly handles data allocation and garbage collection on blocks, simplifying FTL functionality. Furthermore, region-aware file systems such as F2FS, ZenFS, and Btrfs have added modules to support region management. Fourth, they reduce write amplification; by avoiding in-device garbage collection, write amplification on the device side is directly eliminated. Additionally, the host can leverage application access patterns to perform efficient data allocation on regions, further reducing the impact of write amplification during data migration. Therefore, based on application access patterns, several data placement techniques have been proposed to minimize write amplification on ZNS SSDs.
[0004] Delegating zone operations to the host makes data placement on ZNS SSDs more flexible, allowing for better application of data lifecycle information to reduce write amplification. However, to improve the data throughput of ZNS SSDs, sometimes a zone may face a reset and erase operation before it is fully utilized. During a zone reset, some unused blocks within the zone are erased, resulting in significant space waste. After a zone reset, the write pointer is reset to the beginning of the zone, and data is placed sequentially from the beginning of the free zone, causing differences in the allocation of blocks within the zone. This leads to uneven wear within the zone, severely impacting the lifespan of the ZNS SSD. Without proper block management within the zone, the space utilization within the zone will be reduced, shortening the lifespan of the ZNS SSD. Summary of the Invention
[0005] To address the aforementioned technical problems, this invention proposes a Zone reset optimization method based on ZNS SSD, comprising:
[0006] S1: When resetting the Zone of ZNS SSD, a partial reset strategy based on Zone is adopted, which only erases the used blocks within the Zone to avoid erasing the unused blocks within the Zone;
[0007] S2: Records the internal offset position and logical write pointer of the Zone each time it is reset. When the Zone is reopened, the wear-aware Block Allocator allocates Blocks starting from the recorded offset position, so that the Blocks inside the Zone can be used in a cyclical manner, balancing the wear between Blocks inside the Zone.
[0008] The beneficial effects of this invention are:
[0009] This invention addresses the problem of unnecessary block erasure within a Zone by proposing a partial block reset strategy, which avoids unnecessary block erasure within the Zone and improves the space utilization of the Zone.
[0010] This invention addresses the problem of finding the least worn block in a zone by calculating the write position offset during zone erasure, thus efficiently and quickly locating the least worn block within the zone.
[0011] Based on the sequential write characteristics within a Zone and the mapping rules between logical and physical addresses, this invention proposes a wear-aware block allocator, which makes the placement of data within a Zone more rational. Attached Figure Description
[0012] Figure 1 This is a schematic diagram illustrating the resetting of the partially erased area according to the present invention;
[0013] Figure 2 This is a schematic diagram of the operation of the wear sensing block distributor of the present invention;
[0014] Figure 3 This is a flowchart of the partial block reset process in the Zone of this invention;
[0015] Figure 4 This is a flowchart of the wear-sensing block allocation process of the present invention. Detailed Implementation
[0016] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0017] A Zone reset optimization method based on ZNS SSD includes:
[0018] S1: When resetting the Zone of ZNS SSD, a partial reset strategy based on Zone is adopted, which only erases the used blocks within the Zone to avoid erasing the unused blocks within the Zone;
[0019] S2: Records the internal offset position and logical write pointer of the Zone each time it is reset. When the Zone is reopened, the wear-aware Block Allocator allocates Blocks starting from the recorded offset position, so that the Blocks inside the Zone can be used in a cyclical manner, balancing the wear between Blocks inside the Zone.
[0020] The Zone-based partial reset strategy includes:
[0021] S11: Based on the logical write pointer and starting position of the Zone, subtract the starting position from the logical position pointed to by the logical write pointer to obtain the logical area of the used Block inside the Zone;
[0022] S12: Based on the physical block to logical block mapping table, convert the logical area of the Zone that has been used into the physical area of the Zone that has been used.
[0023] S13: Call the Zone erase interface to erase the physical area within the Zone that has been blocked.
[0024] The wear-sensing block allocator includes:
[0025] S21: Using an offset pointer Calculate the last position of the physical region that used the Block in the previous erase, i.e., the offset of the physical block address;
[0026] S22: When the Zone is reopened, the logical address is changed from the offset pointer. Location mapping begins; the physical block to logical block mapping table is updated.
[0027] S23: If the maximum physical address allowed by the Zone is exceeded, the mapping is performed from the starting physical address of the Zone to reuse the physical address space of the Zone, so that the Blocks inside the Zone can be reused in a cyclical manner, balancing the wear and tear between Blocks inside the Zone, and updating the mapping table between physical Blocks and logical Blocks.
[0028] S24: For each data request from Zone, the correct physical address is calculated through a single-mode operation.
[0029] Calculate the offset during Zone erasure, including:
[0030]
[0031] in, This represents the offset of the physical block address. This represents the distance between the Zone write pointer and the starting logical address. Indicates the logical starting position of the Zone. Indicates the offset pointer. This indicates the total capacity of a single Zone.
[0032] For each data request, a new PBA is calculated through a single-module operation, including:
[0033] S241: When new data needs to be written to the Zone, the physical address of the new data write operation is calculated through a single-mode operation. :
[0034]
[0035] in, Indicates the logical starting position of the Zone. This represents the distance between the write pointer and the starting LBA. Indicates the offset pointer. This represents the total capacity of a single Zone;
[0036] S243: When it is necessary to read data within a Zone, calculate the physical address of the data read operation through a single-mode operation. :
[0037]
[0038] in, It is the position of the logical read pointer.
[0039] In this embodiment of the invention, when the Zone calls the erase interface, some Blocks within the Zone may be in an unused state. To avoid unnecessary erasure of these Blocks, the Zone's internal data storage information and the mapping rules from the Zone's logical address to its physical address are utilized. For example... Figure 1 As shown: A write pointer records the current write position in the LBA, which is used to calculate the physical region length of the used block within the Zone. Then, the Zone's erase interface is called to erase the used block; for example... Figure 3 As shown, the process begins at step 101, where a Zone to be reclaimed is input, along with its starting position S, offset L, logical write pointer position P, and total capacity ZC.
[0040] In step 102, the length of the used region UC is calculated based on the write pointer P and the starting position S;
[0041] In step 103, compare whether the write pointer P plus the offset L exceeds the total capacity ZC. If it does not exceed ZC, proceed to step 104; otherwise, proceed to step 106.
[0042] In step 104, if P+L does not exceed ZC in 103, the region from S+L to P+L is directly erased.
[0043] In step 105, calculate the offset L of the Zone and reset the entire Zone;
[0044] In step 106, if ZC is exceeded in 103, the area from S+L to ZC is erased first.
[0045] In step 107, the size of the remaining used Block region is calculated and the offset L of the Zone is updated simultaneously;
[0046] In step 108, erase the area from S to S+L and reset the entire Zone;
[0047] In step 109, the process ends;
[0048] In this embodiment of the invention, the partial block reset method in a Zone, while avoiding unnecessary block erasure within the Zone, can lead to wear differences between blocks within the Zone, causing uneven wear within the Zone. Therefore, a wear-aware block allocation method is proposed; such as... Figure 2 As shown, the starting position of the region's LBA is associated with the PBA of the most recently written block in the region, treating the region as a circular queue. This involves using modulo operations to link physical and logical addresses, avoiding any invalid addresses exceeding the region's capacity. This wear-aware block allocator places data sequentially within a zone, starting from the block with the least wear, balancing wear within the zone while ensuring data integrity. An offset pointer is used to maintain the currently written PBA during the last reset. For each data request, a new PBA is calculated using a single modulo operation; as shown... Figure 4 As shown, by dynamically adjusting the data writing position of the Zone, each data is placed sequentially from the Block position with the least wear in the Zone; the offset pointer position and logical write address calculated during Zone erasure are used to ensure the correctness of data placement in the Zone; the process begins at step 201, inputting a Zone to be written and the write data size SI;
[0049] In step 202, obtain the starting position S, offset L, logical write pointer position P, and total capacity ZC of the Zone;
[0050] In step 203, the actual physical write address Q is calculated using the logical write pointer and the offset;
[0051] In step 204, data is stored starting from the actual physical address Q.
[0052] In step 205, the logical write pointer moves forward, and the data size decreases;
[0053] In step 206, determine whether the data has been completely stored. If the data size is greater than 0, proceed to step 203; otherwise, proceed to step 207.
[0054] In step 207, the process ends.
[0055] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A Zone reset optimization method based on ZNS SSD, characterized in that, include: S1: When resetting the Zone of ZNS SSD, a partial reset strategy based on Zone is adopted, which only erases the used blocks within the Zone to avoid erasing the unused blocks within the Zone; The Zone-based partial reset strategy includes: S11: Based on the logical write pointer and starting position of the Zone, subtract the starting position from the logical position pointed to by the logical write pointer to obtain the logical area of the used Block inside the Zone; S12: Based on the physical block to logical block mapping table, convert the logical area of the Zone that has been used into the physical area of the Zone that has been used. S13: Call the Zone erase interface to erase the physical area within the Zone that has been blocked; S2: Record the internal offset position and logical write pointer of the Zone each time it is reset. When the Zone is reopened, the wear-aware Block Allocator allocates Blocks starting from the recorded offset position, so that the Blocks inside the Zone can be used in a cyclical manner, balancing the wear between Blocks inside the Zone. The wear-sensing block allocator includes: S21: Using an offset pointer Calculate the last position of the physical region that used the Block in the previous erase to obtain the offset of the physical block address; S22: When the Zone is reopened, the logical address is changed from the offset pointer. Location mapping begins; the physical block to logical block mapping table is updated. S23: If the maximum physical address allowed by the Zone is exceeded, the mapping is performed from the starting physical address of the Zone to reuse the physical address space of the Zone, so that the Blocks inside the Zone can be reused in a cyclical manner, balancing the wear and tear between Blocks inside the Zone, and updating the mapping table between physical Blocks and logical Blocks. S24: For each data request from Zone, the correct physical address is calculated through a single-mode operation.
2. The Zone reset optimization method based on ZNS SSD according to claim 1, characterized in that, Calculate the last position of the physical region of the Zone that was used in the last erase, i.e., the offset of the physical block address, including: ; in, This represents the offset of the physical block address. This represents the distance between the Zone write pointer and the starting logical address. Indicates the logical starting position of the Zone. Indicates the offset pointer. This represents the total capacity of a single Zone.
3. The Zone reset optimization method based on ZNS SSD according to claim 1, characterized in that, For each data request, the correct physical address is calculated through a single-mode operation, including: S241: When new data needs to be written to the Zone, the physical address of the new data write operation is calculated through a single-mode operation. : ; in, Indicates the logical starting position of the Zone. This represents the distance between the write pointer and the starting LBA. Indicates the offset pointer. This represents the total capacity of a single Zone; S243: When it is necessary to read data within a Zone, calculate the physical address of the data read operation through a single-mode operation. : ; in, It is the position of the logical read pointer.
Citation Information
Patent Citations
ZNS SSD wear leveling method based on LSM tree
CN116107513A
Methods and systems for raid protection in zoned solid-state drives
US11340987B1