A cache management method to ensure fairness of ZNS-SSD access
By dividing the onboard DRAM of the ZNS-SSD into a normal area and a privileged area and dynamically adjusting the capacity, the problem of unfair access when multiple applications share the same memory is solved, and the fairness of cache management and the improvement of system performance are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHONGQING UNIV OF POSTS & TELECOMM
- Filing Date
- 2022-11-07
- Publication Date
- 2026-05-26
AI Technical Summary
When multiple applications share a ZNS-SSD, access unfairness issues lead to low cache hit rates, impacting response times and computer system service levels.
The onboard DRAM is divided into a normal area and a privileged area, which cache different types of application data respectively. Unfair applications are identified by recording I/O request characteristics, and the capacity of the privileged area is dynamically adjusted to achieve fair allocation.
It ensures fair access for multiple applications, avoids cache misses, extends the lifespan of ZNS-SSD, and has the advantages of low cost and easy implementation.
Smart Images

Figure CN115729466B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of computer storage technology, specifically relating to a cache management method that ensures the fairness of ZNS-SSD access. Background Technology
[0002] ZNS-SSDs are typically used in high-performance computer systems. With advancements in semiconductor technology and computing capabilities, a single ZNS-SSD is often shared by multiple applications, such as in multi-tenant cloud computing platforms and multi-application desktop systems. When multiple applications simultaneously access the same ZNS-SSD, unfair access can severely impact application response time and degrade the overall service level of the computer system.
[0003] Currently, most mainstream ZNS-SSDs contain an internal DRAM-based cache. The primary purpose of the onboard DRAM is to cache storage data sent from the host. Typically, the host only needs to send the data to be stored to the ZNS-SSD's onboard DRAM and then return the write operation. Because DRAM's write speed is much higher than that of flash memory, onboard DRAM can significantly improve data storage speed. However, in actual testing, we found that multiple applications compete for onboard DRAM resources, leading to serious access unfairness issues.
[0004] Furthermore, ZNS-SSD's data storage method differs from traditional block-interface-based SSDs. ZNS-SSD divides the logical address space into fixed-size partitions. Within each partition, the ZNS interface mandates sequential writes to reduce garbage collection overhead and cache usage. However, when multiple applications access ZNS-SSD simultaneously, this sequential write characteristic can further exacerbate the problem of unfair access by resulting in low cache hit rates for unfair applications. Summary of the Invention
[0005] To address the aforementioned technical problems, this invention proposes a cache management method to ensure fairness in ZNS-SSD access, comprising:
[0006] S1: Divide the carrier DRAM into two categories: ordinary area and privileged area, and assign different permissions to different types of areas;
[0007] S2: Record I / O request characteristics to identify unfair and fair applications;
[0008] S3: Allocate and manage I / O request data from unfair and fair applications in a reasonable manner, storing them in the normal area and the privileged area with adjusted capacity of the carrier DRAM.
[0009] Preferably, different permissions are assigned to different types of areas, including:
[0010] The normal zone is used to cache data from all applications, while the privileged zone can only cache data from unfair applications.
[0011] Preferred I / O request characteristics include:
[0012] The size of the I / O request and the number of I / O requests.
[0013] Preferred unfair applications include:
[0014] The application with the smallest product of I / O request size and number of I / O requests across multiple request queues is considered the unfair application.
[0015] Preferably, I / O request data is rationally allocated and managed, stored in the general area and privileged area of the carrier DRAM, including:
[0016] If the normal area is not full and the privileged area is not full, all application I / O request data is placed in the normal area;
[0017] If the normal zone is full but the privileged zone is not full, only unfair applications are allowed to put data into the privileged zone. I / O requests from other applications will be blocked and they must wait until the data in the normal zone is flushed back before they can put data into the normal zone.
[0018] If both the normal area and the privileged area are full, all I / O requests from programs will be blocked. When both areas are full, all data in the privileged area will be written back, and only a portion of the data in the normal area will be written back. After the data is written back, the blocked data will be stored, and the capacity of the privileged area will be expanded or contracted.
[0019] Furthermore, the capacity of the privileged zone is expanded / contracted, including:
[0020] If the privileged zone's capacity is insufficient to satisfy the data caching of unfair applications, an expansion operation is performed to increase the privileged zone's capacity.
[0021] If the privileged zone's capacity is sufficient to satisfy the data caching needs of unfair applications, then a shrink operation is performed to reduce the privileged zone's capacity.
[0022] Furthermore, determining whether the privileged zone's capacity is sufficient for the unfair application's data caching includes:
[0023] Set a threshold T. Based on the resource usage of the onboard DRAM in the previous period, calculate the ratio R of the time the privileged area was not full to the time the ordinary area was not full in the previous period. If the ratio R is greater than the threshold T, it means that the privileged area has been in a state of not full for a long time and the capacity of the privileged area needs to be reduced; otherwise, the capacity of the privileged area needs to be expanded.
[0024] The beneficial effects of this invention are as follows: For I / O requests from unfair applications, ZNS-SSD places the requested data into the privileged area of the onboard DRAM, avoiding cache misses in the onboard DRAM and thus ensuring fair access for multiple applications. In addition, the capacity of the privileged area is dynamically adjusted according to its usage, alleviating resource idleness caused by an excessively large privileged area. This invention has advantages such as low cost and ease of implementation, and also has good scalability and practicality. Attached Figure Description
[0025] Figure 1 This is a diagram showing the overall architecture and implementation principle of the present invention;
[0026] Figure 2 This is a schematic diagram illustrating the expansion / contraction of the privileged region according to the present invention;
[0027] Figure 3 This is a flowchart of the cache management strategy of the present invention. Detailed Implementation
[0028] 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.
[0029] This invention targets ZNS-SSDs and extends the lifespan of ZNS-SSDs by reconstructing partitions at runtime and writing data differentially into different types of reconstructed partitions.
[0030] A cache management method to ensure fairness in ZNS-SSD access, such as Figure 1 As shown, it includes:
[0031] S1: Divide the carrier DRAM into two categories: ordinary area and privileged area, and assign different permissions to different types of areas;
[0032] S2: Record I / O request characteristics to identify unfair and fair applications;
[0033] S3: Allocate and manage I / O request data from unfair and fair applications in a reasonable manner, storing them in the normal area and the privileged area with adjusted capacity of the carrier DRAM.
[0034] The NVMe protocol allows multiple applications to request multiple request queues on the host, including a Submission Queue (SQ) and a Completion Queue (CQ). ZNS-SSD devices retrieve I / O requests from these queues via the PCIe interface, parse the requests in units of flash pages, and finally place the parsed sub-requests into the device-level request queue. The Zone FTL retrieves sub-requests from the device-level request queue and performs operations such as request scheduling, cache management, and data allocation. Therefore, this invention involves a piece of firmware code residing in the Zone FTL to manage the onboard DRAM cache data. Specifically, this invention divides the onboard DRAM into two regions: a normal region and a privileged region.
[0035] Preferably, different permissions are assigned to different types of areas, including:
[0036] The normal zone is used to cache data from all applications, while the privileged zone can only cache data from unfair applications.
[0037] Preferred I / O request characteristics include:
[0038] The size of the I / O request and the number of I / O requests.
[0039] Preferred unfair applications include:
[0040] The application with the smallest product of I / O request size and number of I / O requests across multiple request queues is considered the unfair application.
[0041] Preferably, I / O request data is rationally allocated and managed, stored in the general area and privileged area of the carrier DRAM, including:
[0042] If the normal area is not full and the privileged area is not full, all application I / O request data is placed in the normal area;
[0043] If the normal zone is full but the privileged zone is not full, only unfair applications are allowed to put data into the privileged zone. I / O requests from other applications will be blocked and they must wait until the data in the normal zone is flushed back before they can put data into the normal zone.
[0044] If both the normal area and the privileged area are full, all I / O requests from programs will be blocked. When both areas are full, all data in the privileged area will be written back, and only a portion of the data in the normal area will be written back. After the data is written back, the blocked data will be stored, and the capacity of the privileged area will be expanded or contracted.
[0045] Figure 2 This is a schematic diagram of the privileged zone expansion / contraction of the present invention. Whenever both the normal zone and the privileged zone are full, the privileged zone capacity is readjusted, including: privileged zone capacity expansion and privileged zone capacity contraction; ① Expansion principle: If the privileged zone capacity cannot meet the data caching needs of unfair applications, then the privileged zone capacity is increased; ② Contraction principle: If the privileged zone capacity can meet the data caching needs of unfair applications, then the privileged zone capacity is reduced; The capacity of a single privileged zone expansion / contraction is specified by the firmware developer or manufacturer.
[0046] Furthermore, the capacity of the privileged zone is expanded / contracted, including:
[0047] If the privileged zone's capacity is insufficient to satisfy the data caching of unfair applications, an expansion operation is performed to increase the privileged zone's capacity.
[0048] If the privileged zone's capacity is sufficient to satisfy the data caching needs of unfair applications, then a shrink operation is performed to reduce the privileged zone's capacity.
[0049] Furthermore, determining whether the privileged zone's capacity is sufficient for the unfair application's data caching includes:
[0050] Based on the resource usage of the onboard DRAM in the previous period, calculate the ratio R of the time the privileged area was not full to the time the ordinary area was not full in the previous period. If the ratio R is greater than the threshold T, it means that the privileged area has been in a state of not full for a long time and the capacity of the privileged area needs to be reduced; otherwise, the capacity of the privileged area needs to be expanded.
[0051] After an expansion / contraction operation is completed, it is determined whether the capacity of the privileged area is sufficient for the data cache of the unfair application. At this time, neither the normal area nor the privileged area is full (this is time T1). Then, data begins to fill the normal area (writing to the normal area first), so the normal area is filled first (this is time T2). Therefore, the time during which the normal area is not full = T2 - T1. Next, the unfair application has the privilege to write to the privileged area. After a period of time (T3), the privileged area is filled. Therefore, the time during which the privileged area is not full = T3 - T1.
[0052] Calculate the ratio R of the time the privileged zone's time was not yet full to the time the ordinary zone's time was not yet full within a certain period:
[0053]
[0054] If R is too large, exceeding the user-defined threshold T, it means that T3-T1 is too large, which means the privileged area is too large and will take a long time to fill, requiring a reduction in the privileged area's capacity.
[0055] Figure 3 The flowchart below illustrates the cache management strategy of this invention. When multiple applications access the ZNS-SSD simultaneously, to ensure access fairness, cache management will be implemented on the onboard DRAM. Starting from step 101, the specific steps are as follows:
[0056] In step 102, the ZNS-SSD onboard DRAM is divided into a normal area and a privileged area, with the division ratio defined by the user;
[0057] In step 103, after ZNS-SSD runs, it records the characteristics of all application I / O requests and identifies unfair applications.
[0058] In step 104, when an I / O request arrives, determine whether the normal area of the onboard DRAM is full; if so, proceed to step 105; otherwise, proceed to step 109.
[0059] In step 105, the normal area of the onboard DRAM is full. It is determined whether the request comes from an unfair application. If so, proceed to step 106; otherwise, proceed to step 108.
[0060] In step 106, determine whether the privileged area of the onboard DRAM is full. If it is, proceed to step 107; otherwise, proceed to step 110.
[0061] In step 107, the privileged region of the onboard DRAM is full, and the expansion / contraction of the privileged region is performed;
[0062] In step 108, I / O requests are blocked, and data is waited for to be written back from the onboard DRAM to the Flash.
[0063] In step 109, the data is written to the normal area;
[0064] In step 110, the data is written to the privileged area;
[0065] Step 111, End.
[0066] 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 cache management method for ensuring fairness in ZNS-SSD access, characterized in that, include: S1: Divide the carrier DRAM into two categories: ordinary area and privileged area, and assign different permissions to different types of areas; The normal zone is used to cache data from all applications, while the privileged zone can only cache data from unfair applications. S2: Record I / O request characteristics to identify unfair and fair applications; I / O request features include: The size of the I / O request and the number of I / O requests; Unfair applications include: The application with the smallest product of I / O request size and number of I / O requests across multiple request queues is considered the unfair application. S3: Allocate and manage the I / O request data of unfair and fair applications reasonably, and store them in the normal area and privileged area of the carrier DRAM; I / O request data is allocated and managed appropriately, stored in the general area and privileged area of the carrier DRAM, including: If the normal area is not full, all application I / O request data is placed in the normal area; If the normal area is full but the privileged area is not full, only unfair applications are allowed to put data into the privileged area. I / O requests from other applications will be blocked and must wait until the data in the normal area is written back before they can put data into the normal area. If both the normal area and the privileged area are full, all I / O requests from programs will be blocked. When both areas are full, all data in the privileged area will be written back, and part of the data in the normal area will be written back. After the data is written back, the blocked data will be stored, and the capacity of the privileged area will be expanded or shrunk. Determining whether the privileged zone's capacity is sufficient for the unfair application's data caching includes: Set a threshold T. Based on the resource usage of the onboard DRAM in the previous period, calculate the ratio R of the time the privileged area was not full to the time the ordinary area was not full in the previous period. If the ratio R is greater than the threshold T, it means that the privileged area has been in a state of not full for a long time and the capacity of the privileged area needs to be reduced; otherwise, the capacity of the privileged area needs to be expanded.