Reading interference processing method and electronic device

By dynamically adjusting the GC strategy, the impact of garbage collection operations on system performance under read interference in solid-state drives was resolved, achieving stable read performance in read interference scenarios and avoiding the execution of large-scale garbage collection operations.

CN121029099BActive Publication Date: 2026-01-23INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511553431.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-28
Publication Date
2026-01-23
Estimated Expiration
2045-10-28

AI Technical Summary

Technical Problem

In existing technologies, the large number of garbage collection operations of solid-state drives (SSDs) under the background of read interference seriously affects system performance, especially when the read counts of multiple physical blocks exceed the threshold at the same time, resulting in excessive consumption of read and write bandwidth resources and affecting host read performance.

Method used

By introducing a feedback control loop based on the number of GC tasks waiting to be executed in the system, the GC strategy under read interference scenarios is dynamically adjusted. An intelligent strategy switching mechanism is adopted to pause garbage collection operations under read interference background and rewrite data exceeding the threshold into new physical blocks to avoid large-scale garbage collection operations.

Benefits of technology

This effectively reduces the probability of the cumulative number of physical block reads triggering garbage collection, avoiding the impact of large-scale garbage collection on system performance and maintaining stable read performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121029099B_ABST
    Figure CN121029099B_ABST
Patent Text Reader

Abstract

The application discloses a read interference processing method and electronic equipment, and relates to the technical field of solid state disks. The method comprises triggering a first processing strategy when the number of to-be-processed garbage collection tasks is greater than a first task number threshold value, achieving timely switching of the processing strategy to the first processing strategy when the to-be-processed garbage collection tasks are relatively large. Under the first processing strategy, the number of read operations on each physical block is accumulated every time data is read from the physical block. When the accumulated number of read operations on a first physical block is greater than or equal to a first read number threshold value, target data read from the first physical block is migrated to a second physical block, achieving re-writing of the read data into a new physical block for the physical block satisfying the first read number threshold value, changing the data storage location, and solving the technical problem that a large number of garbage collection operations under read interference seriously affect the performance of the solid state disk, and achieving the technical effect of maintaining stable system read performance.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of solid state disks, and particularly relates to a read interference processing method and electronic equipment. BACKGROUND

[0002] Read interference is a phenomenon inherent in NAND flash memory due to its physical structure and working mechanism, which is specifically manifested as that frequent reading of a certain storage area will cause data bit errors in adjacent storage units.

[0003] At present, in the related art, a solution commonly used to solve the read interference problem is that when the read count of a physical block (Block) exceeds a preset threshold, the solid state disk (Solid State Drive, SSD) firmware actively triggers a garbage collection (Garbage Collection, GC) mechanism to perform a garbage collection operation. However, if the read counts of a plurality of Blocks simultaneously exceed the above-mentioned preset threshold, the SSD firmware needs to perform a large number of garbage collection operations in a short time, and the GC process will occupy too much read-write bandwidth resources, seriously affecting the system performance of the SSD. SUMMARY

[0004] The present application provides a read interference processing method and electronic equipment to at least solve the problem that a large number of garbage collection operations under the background of read interference seriously affect the performance of the solid state disk in the related art.

[0005] The present application provides a read interference processing method, comprising:

[0006] When reading target data from a first physical block, obtaining the cumulative read count of the first physical block;

[0007] In a case where the current processing strategy is a first processing strategy, obtaining a first read count threshold corresponding to the first processing strategy, the first processing strategy being triggered when the number of garbage collection tasks to be processed is greater than a first task number threshold;

[0008] If the cumulative read count of the first physical block is greater than or equal to the first read count threshold, migrating the target data to a second physical block.

[0009] The present application also provides a read interference processing apparatus, comprising:

[0010] A first obtaining module is configured to obtain the cumulative read count of the first physical block when reading target data from a first physical block;

[0011] The second obtaining module is configured to, in a case where the current processing strategy is a first processing strategy, obtain a first read frequency threshold corresponding to the first processing strategy, the first processing strategy being triggered when a task quantity of the garbage collection tasks to be processed is greater than a first task quantity threshold.

[0012] The data migration module is configured to, if the accumulated read frequency of the first physical block is greater than or equal to the first read frequency threshold, migrate the target data to a second physical block.

[0013] The present application also provides an electronic device, comprising: a memory configured to store a computer program; and a processor configured to execute the computer program to implement the steps of any one of the read interference processing methods.

[0014] The present application also provides a computer-readable storage medium, which stores a computer program, wherein the computer program is executed by a processor to implement the steps of any one of the read interference processing methods.

[0015] The present application also provides a computer program product, comprising a computer program, wherein the computer program is executed by a processor to implement the steps of any one of the read interference processing methods.

[0016] According to the present application, the first processing strategy is triggered when the task quantity of the garbage collection tasks to be processed is greater than the first task quantity threshold, so that the processing strategy is switched to the first processing strategy in time when the garbage collection tasks to be processed are large. In the first processing strategy, the read frequency of a physical block is accumulated each time data is read from the physical block. When the accumulated read frequency of the first physical block is greater than or equal to the first read frequency threshold corresponding to the first processing strategy, the target data read from the first physical block is migrated to a second physical block. Thus, the data read from the physical block satisfying the first read frequency threshold is written to a new physical block, so that the data storage location is changed, and the data is read from the new location subsequently, thereby reducing the read frequency of the original physical block and the accumulated read frequency of the physical block reaching the threshold for triggering the garbage collection task, avoiding the execution of large-scale garbage collection operations, and ensuring the performance of the system. Therefore, the technical problem that a large number of garbage collection operations under the read interference background seriously affect the performance of the solid state disk can be solved, and the technical effect of maintaining stable system read performance can be achieved. BRIEF DESCRIPTION OF DRAWINGS

[0017] In order to more clearly illustrate the embodiments of the present application, the drawings needed in the embodiments will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0018] Figure 1 This is a schematic diagram of the application architecture of a read interference processing method as an exemplary embodiment of this application;

[0019] Figure 2 A schematic flowchart of a reading interference processing method provided for an exemplary embodiment of this application;

[0020] Figure 3 A flowchart illustrating a reading interference processing method provided as another exemplary embodiment of this application;

[0021] Figure 4 This is a schematic diagram of the structure of a reading interference processing device provided in an embodiment of this application. Detailed Implementation

[0022] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.

[0023] It should be noted that, in the description of this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. The terms "first," "second," etc., in this application are used to distinguish similar objects and are not used to describe a specific order or sequence.

[0024] Before explaining the specific implementation methods of this application, the following is a brief explanation of the Chinese and English terms that may be involved in this application:

[0025] FW: SSD firmware, a software system that runs on the SSD controller to handle input / output (IO), admin, and other commands.

[0026] FTL: Flash Translation Layer. The FTL is mainly responsible for mapping from host logical addresses to flash physical addresses and implementing the core algorithms of SSD firmware. Garbage collection within the SSD is initiated by the FTL module.

[0027] LUN: The smallest unit in flash memory where read / write / erase commands are executed.

[0028] Super LUN: Composed of multiple LUNs, the specific number depends on the Redundant Array of Independent Disks (RAID) configuration within the disk, typically 32 or 64.

[0029] Block: The smallest unit of erasure on a solid-state drive.

[0030] Super Block: Composed of multiple blocks, typically 32 or 64.

[0031] GC: SSD garbage collection, reclaims flash memory space containing invalid data in a specified block.

[0032] Read interference: When repeatedly reading a certain (or a group of) memory cells (pages) in NAND flash memory, it can cause bit flips in the data of other unread pages that share the same word line, which may result in errors.

[0033] To address read interference issues in NAND flash memory, SSD products typically record the number of reads for each physical block or virtual block in Dynamic Random Access Memory (DRAM). When the number of reads for a particular block exceeds a preset threshold (which is significantly lower than the actual threshold that triggers read interference), the firmware (FW) actively triggers garbage collection (GC) to perform garbage collection on the entire Super Block containing that block. This ensures that subsequent read requests for that logical address are redirected to other physical locations, thus preventing read interference. However, if large address ranges of data are frequently and repeatedly read after random writes, the read counts of many blocks may simultaneously exceed the read interference threshold. This scenario requires the firmware to perform a large number of garbage collection operations in a short period of time. Such GC processes consume excessive read / write bandwidth resources, inevitably significantly impacting host read performance. In extreme cases, delayed GC may even cause read interference errors.

[0034] To mitigate the impact of garbage collection operations on host read performance under read interference, this application proposes a scheme for dynamically adjusting GC strategies in read interference scenarios. The core technology of this scheme lies in introducing a feedback control loop based on the number of GC tasks waiting to be executed, which serves as the decision-making basis for strategy switching, thereby achieving intelligent strategy degradation and recovery. Specifically, when the system faces high GC pressure under read interference, subsequent garbage collection operations based on read interference identification will be paused, and only data exceeding the read interference threshold will be rewritten to the NAND. This method ensures that data is protected from read interference and avoids consuming host read bandwidth due to large-scale garbage collection, thus maintaining stable read performance.

[0035] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0036] The specific application environment architecture or specific hardware architecture on which the execution of the reading interference processing method depends is described here.

[0037] Figure 1 This is a schematic diagram of the application architecture of a read interference processing method as an exemplary embodiment of this application, such as... Figure 1As shown, the read interference handling method in this application is completed collaboratively by the read module, write module, and management module of the FTL layer. When the FW processes host read commands located on NAND, it records and manages global variables used to map the read flash memory counts of all physical blocks in the read module. Whenever a NAND read command is completed, the count of the corresponding block (denoted as blk_cnt) is incremented by 1. The SSD triggers the first-level strategy by default. When it detects that the number of reads of a single physical block exceeds the second read count threshold (e.g., 200,000 times), it passes the identifier of the block to the management module. The management module increments the count of the garbage collection task to be processed and initiates a garbage collection (GC) task for the entire superblock to which the physical block belongs. Whenever a garbage collection task is completed, the management module also needs to decrement the count of the garbage collection task. Under the first-level strategy, when the count of the garbage collection task is less than a certain value (e.g., 5), the management module performs garbage collection on the entire superblock to which the block whose read count exceeds the first threshold belongs; when the count of the garbage collection task reaches a certain value, it automatically switches to the second-level strategy. Under the second-level strategy, the write module will rewrite the data read from blocks whose blk_cnt count reaches the second threshold (e.g., 90% of the first threshold) to a new location in the NAND. When the count of pending garbage collection tasks falls below a certain value (e.g., 3), it will automatically revert to the first-level strategy. This solution automatically adjusts the protection strategy against read interference by monitoring the real-time GC pressure of the system, thereby reducing the adverse impact of a large number of garbage collections triggered under read interference protection scenarios on the IO processing performance and functionality of the SSD controller.

[0038] This application provides a method for handling reading interference. This method can be executed by the reading interference handling device provided in this application. The device can be implemented in software and / or hardware and can be integrated into an electronic device. The method is described in detail below with reference to the execution flow of the text generation method.

[0039] Figure 2 A flowchart illustrating a reading interference processing method provided for an exemplary embodiment of this application is shown below. Figure 2 As shown, the reading interference processing method may include the following steps:

[0040] Step 101: When reading target data from the first physical block, obtain the cumulative number of reads of the first physical block.

[0041] In this embodiment, when the SSD receives a read request from the host, if the requested read location is located in the first physical block of the NAND flash memory, the cumulative read count for the first physical block is updated after reading the target data from the first physical block. It is understood that if only one read request indicates reading the target data from the first physical block, the cumulative read count for the first physical block is incremented by 1 after the read is completed. If multiple read requests simultaneously indicate reading the target data from the first physical block, the cumulative read count for the first physical block is incremented by 1 for each read request that completes reading the target data from the first physical block. Multiple read requests will increment the cumulative read count for the first physical block multiple times. After updating the cumulative read count of the first physical block, the latest cumulative read count for the first physical block at the current moment is obtained.

[0042] The first physical block can be any physical block on the NAND.

[0043] Step 102: If the current processing strategy is the first processing strategy, obtain the first reading count threshold corresponding to the first processing strategy. The first processing strategy is triggered when the number of garbage collection tasks to be processed is greater than the first task count threshold.

[0044] The specific value of the first read count threshold can be set according to actual needs. The first read count threshold is less than the second read count threshold, which is the threshold for the number of times garbage collection is triggered. For example, the second read count threshold can be set to 200,000 times, and the first read count threshold can be set to 90% of the second read count threshold. The specific value of the first task count threshold can also be set according to actual needs, for example, the first task count threshold can be set to 5.

[0045] In this embodiment, the SSD is configured by default with the second processing strategy (i.e., the aforementioned first-level strategy). Under the second processing strategy, garbage collection is performed on the superblock containing blocks whose cumulative read counts have reached the second read count threshold. When the number of pending garbage collection tasks exceeds the first task count threshold, the first processing strategy (i.e., the aforementioned second-level strategy) is triggered, and the SSD switches from the second processing strategy to the first processing strategy. When the current processing strategy is the first processing strategy, the first read count threshold corresponding to the first processing strategy is obtained and compared with the latest obtained cumulative read count of the first physical block to determine whether the first physical block meets the conditions for rewriting the read target data.

[0046] Step 103: If the cumulative number of reads of the first physical block is greater than or equal to the first read count threshold, then the target data is migrated to the second physical block.

[0047] In this embodiment, the cumulative number of reads of the newly acquired first physical block is compared with a first read count threshold. If the cumulative number of reads of the first physical block reaches (i.e., is greater than or equal to) the first read count threshold, the target data is migrated to the second physical block. The second physical block can be any physical block on the NAND flash memory other than the first physical block.

[0048] For example, the second physical block can be the physical block to which the data write command is currently being executed, that is, the second physical block is the open block that is currently being written.

[0049] For example, the second physical block can be a physical block on the NAND where the cumulative number of reads is less than the first read count threshold.

[0050] It is understood that in this embodiment, when the target data is migrated to the second physical block, the target data is rewritten into the second physical block, and the target data in the first physical block is deleted. Therefore, when the application reads the target data again, it reads from the second physical block. This prevents the first physical block, whose cumulative read count has already reached the first read count threshold, from increasing due to reading target data from it. When reading other data from the first physical block, since the first physical block's cumulative read count has reached the first read count threshold, the read data is also migrated to other physical blocks. This significantly reduces the probability that the first physical block's cumulative read count will reach the second read count threshold, thus decreasing the likelihood of triggering garbage collection. Therefore, with the activation of the first processing strategy, the management module may still receive some garbage collection tasks for blocks triggered by the cumulative read count reaching the second read count threshold (this is because during the change from the second processing strategy to the first processing strategy, the identifiers of some blocks whose cumulative read count has reached the second read count threshold may not have been passed to the management module), but the number of garbage collection tasks will not ultimately increase.

[0051] The read interference handling method in this application embodiment triggers a first processing strategy when the number of pending garbage collection tasks exceeds a first task number threshold. This enables timely switching of the processing strategy to the first processing strategy when there are many pending garbage collection tasks. Under the first processing strategy, the number of reads of a physical block is accumulated each time data is read from it. When the accumulated number of reads of the first physical block is greater than or equal to the first read count threshold corresponding to the first processing strategy, the target data read from the first physical block is migrated to the second physical block. Thus, for physical blocks that meet the first read count threshold, the read data is rewritten to a new physical block, realizing a change in data storage location. Subsequently, data can be read from the new location, reducing the number of reads of the original physical block. This reduces the probability that the accumulated number of reads of the physical block will reach the threshold for triggering a garbage collection task, avoiding the execution of large-scale garbage collection operations and ensuring system performance. Therefore, it can solve the technical problem that a large number of garbage collection operations seriously affect the performance of solid-state drives under read interference, and achieve the technical effect of maintaining stable system read performance.

[0052] In one optional embodiment of this application, before migrating the target data to the second physical block, the number of tasks of the current pending garbage collection tasks and the second task number threshold corresponding to the first processing strategy can be obtained. The second task number threshold is less than the first task number threshold. The specific value of the second task number threshold can be set according to actual needs, and this application does not limit it. Then, the number of tasks of the current pending garbage collection tasks is compared with the second task number threshold. If it is determined that the number of tasks of the current pending garbage collection tasks is greater than or equal to the second task number threshold, the operation of migrating the target data to the second physical block is performed.

[0053] For example, with Figure 1 Taking the architecture diagram shown as an example, the management module can count the number of garbage collection tasks currently waiting and executing in real time, and obtain the number of garbage collection tasks currently pending.

[0054] In this embodiment, if the number of garbage collection tasks to be processed is greater than or equal to the second task number threshold, it indicates that the garbage collection pressure of the system is still relatively high. In this case, the first processing strategy is still guaranteed, and the target data read is migrated to the second physical block to avoid adding more garbage collection tasks.

[0055] Furthermore, the number of garbage collection tasks currently pending is compared with the second task number threshold. If the number of garbage collection tasks currently pending is less than the second task number threshold, the current processing strategy is changed from the first processing strategy to the second processing strategy. The second processing strategy is a garbage collection strategy for the physical block group to which the physical block to which the accumulated read count reaches the second read count threshold belongs. The second read count threshold is greater than the first read count threshold.

[0056] For example, the management module continuously monitors the number of garbage collection tasks waiting to be executed. Whenever a garbage collection task is completed and a queued garbage collection task is executed, the number of remaining garbage collection tasks is updated. When the number of pending garbage collection tasks drops below the second task count threshold, it indicates that the system pressure has been sufficiently relieved. At this time, the policy identifier of the second processing strategy is synchronized to the read module. The read module will then cancel the first processing strategy and restore the second processing strategy, thereby triggering the complete garbage collection process again for the superblock (i.e., physical block group) to which the physical block to which the accumulated read count has reached the second read count threshold, so as to ensure the long-term integrity of the data.

[0057] In this embodiment, by monitoring the number of pending garbage collection tasks in real time, when the number of pending garbage collection tasks is greater than or equal to the second task number threshold corresponding to the first processing strategy, the step of migrating the target data to the second physical block is executed. Conversely, when the number of pending garbage collection tasks is less than the second task number threshold, the current processing strategy is changed from the first to the second processing strategy. This achieves dynamic adjustment of the processing strategy based on the system's real-time garbage collection pressure. When the system's garbage collection pressure is low, the most reliable overall garbage collection strategy is used to avoid read interference; when the system's garbage collection pressure is high, a local data rewriting strategy with minimal performance impact is used to reduce the number of garbage collections. This optimizes the overall system performance, balancing reliability and system performance. Furthermore, the entire process requires no manual intervention; the system can automatically select the optimal processing strategy based on its real-time load status, achieving intelligent management of the processing strategy and improving the autonomous management level of the SSD controller.

[0058] Figure 3 A flowchart illustrating a reading interference processing method provided for another exemplary embodiment of this application is shown below. Figure 3 As shown, the reading interference processing method may include the following steps:

[0059] Step 201: When reading target data from the first physical block, obtain the cumulative number of reads of the first physical block.

[0060] Step 202: If the current processing strategy is the first processing strategy, obtain the first reading count threshold corresponding to the first processing strategy. The first processing strategy is triggered when the number of garbage collection tasks to be processed is greater than the first task count threshold.

[0061] Step 203: If the cumulative number of reads of the first physical block is greater than or equal to the first read count threshold, then the target data is migrated to the second physical block.

[0062] It should be noted that, in this embodiment, the relevant explanations and descriptions of steps 201-203 can be found in the descriptions of steps 101-103 in the previous embodiments, and will not be repeated here.

[0063] Step 204: If the current processing strategy is the second processing strategy, obtain the second reading count threshold corresponding to the second processing strategy.

[0064] The second read count threshold is greater than the first read count threshold. The specific value of the second read count threshold can be set according to actual needs, and this application does not impose any restrictions on it. For example, the second read count threshold can be set to 200,000 times, and this threshold can be adjusted according to different NAND flash memory characteristics.

[0065] In this embodiment, if the current processing strategy is the second processing strategy, then the second read count threshold corresponding to the second processing strategy is obtained. It is understood that different processing strategies correspond to different read count thresholds.

[0066] Step 205: If the cumulative number of reads of the first physical block is greater than or equal to the second read count threshold, determine the target physical block group corresponding to the first physical block.

[0067] In this embodiment, after obtaining the cumulative number of reads of the first physical block, it is compared with the second read count threshold. If the cumulative number of reads of the first physical block is greater than or equal to the second read count threshold, the target physical block group corresponding to the first physical block is further determined.

[0068] In this embodiment, a physical block group (i.e., a Super Block) includes multiple physical blocks. Based on the first physical block, the super block to which it belongs can be determined, that is, the corresponding target physical block group can be determined.

[0069] Step 206: Generate a target garbage collection task to perform garbage collection on the target physical block group, and set the target garbage collection task as the current pending garbage collection task for processing.

[0070] In this embodiment, after determining the target physical block group corresponding to the first physical block, a new garbage collection task (called the target garbage collection task) can be generated based on the target physical block group. The target garbage collection task is used to instruct garbage collection to be performed on the target physical block group. After the target garbage collection task is generated, it is set as the currently pending garbage collection task to be processed, so that garbage collection can be performed on the target physical block group after the target garbage collection task is processed, and the flash memory space of invalid data on the target physical block group can be reclaimed.

[0071] In this embodiment, under the second processing strategy, the cumulative number of reads of the first physical block is compared with the second read count threshold corresponding to the second processing strategy. When the cumulative number of reads of the first physical block is greater than or equal to the second read count threshold, a target garbage collection task for garbage collection of the target physical block group where the first physical block is located is generated and awaits processing. Thus, when the garbage collection pressure of the system is not high, the entire superblock is garbage collected for physical blocks whose read count exceeds the second read count threshold. This achieves overall garbage collection of the superblock when the load is low, ensuring the reliability of the processing strategy used to prevent read interference.

[0072] It is understandable that when different applications request to read data from different physical blocks on the same superblock, the read operations corresponding to these requests may cause the cumulative read count of the corresponding physical block to reach the second read count threshold, thereby triggering a garbage collection task for the same superblock. In this case, to avoid host read bandwidth occupation caused by multiple garbage collections of the same superblock, before generating a new garbage collection task, it can be determined whether a garbage collection task for the same superblock already exists in the queue of garbage collection tasks to be processed, based on the identifier of the superblock corresponding to the garbage collection task. If it exists, there is no need to generate a new garbage collection task for that superblock. Therefore, in an optional embodiment of this application, before generating a target garbage collection task for garbage collection of the target physical block group, it can be determined whether a garbage collection task for garbage collection of the target physical block group already exists in the queue of garbage collection tasks to be processed, based on the identifier of the target physical block group. If it exists, no new garbage collection task is generated for the target physical block group; if it does not exist, a target garbage collection task for garbage collection of the target physical block group is generated. This avoids performing multiple garbage collection operations on the same superblock in a short period of time, reduces unnecessary garbage collection, and helps to further reduce the impact of garbage collection on system performance.

[0073] Step 207: If the cumulative number of reads of the first physical block is greater than or equal to the second read count threshold, obtain the number of tasks of the current pending garbage collection task and the first task count threshold corresponding to the second processing strategy.

[0074] The specific value of the first task number threshold can be set according to actual needs. For example, the first task number threshold can be set to 5.

[0075] In this embodiment, after obtaining the cumulative number of reads of the first physical block, it is compared with the second read count threshold. If the cumulative number of reads of the first physical block is greater than or equal to the second read count threshold, the number of garbage collection tasks to be processed is obtained, as well as the first task count threshold corresponding to the second processing strategy is obtained.

[0076] In one optional embodiment of this application, if it is determined that the cumulative number of reads of the first physical block is greater than or equal to a second read count threshold, the remaining garbage collection task count is incremented by one. The remaining garbage collection task count represents the number of garbage collection tasks currently awaiting processing. This count is updated in real-time as the cumulative number of reads of a physical block reaches the second read count threshold and as garbage collection tasks are completed. When the cumulative number of reads of a new physical block reaches the second read count threshold, the remaining garbage collection task count is incremented by one. Then, the updated remaining garbage collection task count is determined as the number of garbage collection tasks currently awaiting processing. In other words, the number of garbage collection tasks currently awaiting processing is the latest number of audio garbage collection tasks.

[0077] by Figure 1 Taking the architecture diagram shown as an example, after the read module updates the cumulative number of reads of the first physical block, it compares the current cumulative number of reads of the first physical block with the second read count threshold. If the second read count threshold is reached, the read module sends the identifier of the first physical block to the management module. The management module will increment the number of remaining garbage collection tasks to obtain the number of garbage collection tasks to be processed. Based on the identifier of the first physical block, it determines the superblock to which it belongs and initiates a garbage collection task for that superblock to wait for processing.

[0078] Step 208: If the number of pending garbage collection tasks is greater than the first task number threshold, change the current processing strategy from the second processing strategy to the first processing strategy.

[0079] In this embodiment, after obtaining the number of currently pending garbage collection tasks and the first task count threshold, the number of currently pending garbage collection tasks is compared with the first task count threshold. If the number of currently pending garbage collection tasks is greater than the first task count threshold, it indicates that the current garbage collection pressure is too high. In this case, the current processing strategy is changed from the second processing strategy to the first processing strategy, and the first processing strategy is subsequently enabled. For newly triggered read interference protection events (i.e., blocks whose cumulative read count reaches the first read count threshold), they will no longer be added to the GC processing queue. Instead, only the data units obtained by the read operation that triggered the event will be rewritten, rearranged, and written to a new physical location. If the number of currently pending garbage collection tasks is not greater than the first task count threshold, the second processing strategy is maintained, and the superblock containing the physical block whose cumulative read count reaches the second read count threshold is subjected to overall garbage collection.

[0080] The read interference handling method in this embodiment, under the second processing strategy, generates a garbage collection task for the target physical block group to which the first physical block belongs, if the cumulative number of reads of the first physical block is greater than or equal to the second read count threshold, and waits for processing. This achieves overall garbage collection of the superblock when the garbage collection pressure is low, ensuring the reliability of read interference handling. Furthermore, when the cumulative number of reads of the first physical block is greater than or equal to the second read count threshold, it also obtains the number of currently pending garbage collection tasks and the first task count threshold corresponding to the second processing strategy. If the number of currently pending garbage collection tasks is greater than the first task count threshold, the current processing strategy is changed from the second processing strategy to the first processing strategy. Thus, it achieves switching the processing strategy to the first processing strategy with less impact on performance when the garbage collection pressure is high, and realizes automatic switching of the processing strategy according to its own real-time load, so that the switched processing strategy matches the current load, realizing intelligent management of the processing strategy, and effectively preventing the sudden drop in SSD performance or system lag caused by continuous large-scale GC operations under high load, ensuring the consistency of user experience.

[0081] Regardless of whether the first or second processing strategy is applied, the FTL layer will handle garbage collection tasks when unprocessed garbage collection tasks exist. Typically, a Super LUN selects only one superblock for garbage collection at a time; that is, only one garbage collection task is executed at a time. Other GC tasks within a single Super LUN need to queue and wait because garbage collection of a single superblock can fully utilize the maximum bandwidth for NAND writes. Therefore, in one optional implementation of this application, in response to the completion of any garbage collection task currently pending, the number of pending garbage collection tasks is decremented by one. Figure 1 Taking the architecture diagram shown as an example, whenever a garbage collection task is completed, the management module needs to decrement the garbage collection task count by 1. This enables real-time updates of the remaining garbage collection tasks, providing accurate data support for dynamically adjusting processing strategies based on the number of currently pending garbage collection tasks.

[0082] In summary, the read interference handling scheme of this application, when the number of reads of a single physical block exceeds the second read count threshold, the firewall (FW) will perform garbage collection on the entire superblock to which it belongs. If the number of such garbage collection tasks waiting to be executed exceeds the first task count threshold (e.g., 5), the system automatically switches to a degradation strategy. Subsequently, for physical blocks whose read count exceeds the first read count threshold (e.g., 90% of the second read count threshold), only the read data is rewritten without further garbage collection, thus alleviating system IO pressure. When the number of waiting garbage collection tasks drops below the second task count threshold (e.g., 3), the system exits the degradation strategy and resumes the process of triggering full garbage collection. This scheme automatically adjusts the protection strategy for read interference by monitoring the real-time GC pressure of the system, which can avoid adverse effects on the IO processing performance and functionality of the SSD controller under scenarios with a large number of read interference protection triggers.

[0083] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method.

[0084] Embodiments of this application also provide a read interference processing device, which can be implemented in software and / or hardware and can be integrated into an electronic device.

[0085] Figure 4 This is a schematic diagram of the structure of a read interference processing device provided in an embodiment of this application, as shown below. Figure 4As shown, the reading interference processing device 30 includes: a first acquisition module 310, a second acquisition module 320, and a data migration module 330.

[0086] The first acquisition module 310 is used to acquire the cumulative number of reads of the first physical block when reading target data from the first physical block;

[0087] The second acquisition module 320 is used to acquire the first reading count threshold corresponding to the first processing strategy when the current processing strategy is the first processing strategy. The first processing strategy is triggered when the number of garbage collection tasks to be processed is greater than the first task count threshold.

[0088] The data migration module 330 is used to migrate the target data to the second physical block if the cumulative number of reads of the first physical block is greater than or equal to the first read count threshold.

[0089] Optionally, the read interference processing device 30 further includes:

[0090] The third acquisition module is used to acquire the number of garbage collection tasks currently pending and the second task number threshold corresponding to the first processing strategy, wherein the second task number threshold is less than the first task number threshold.

[0091] The first determining module is used to determine whether the number of current pending garbage collection tasks is greater than or equal to the second task number threshold.

[0092] Optionally, the read interference processing device 30 further includes:

[0093] The first modification module is used to change the current processing strategy from the first processing strategy to the second processing strategy when the number of current pending garbage collection tasks is less than the second task number threshold.

[0094] The second processing strategy is to perform garbage collection on the physical block group to which the physical block to which the accumulated number of reads reaches the second read count threshold.

[0095] Optionally, the read interference processing device 30 further includes:

[0096] The fourth acquisition module is used to acquire the second reading count threshold corresponding to the second processing strategy when the current processing strategy is the second processing strategy.

[0097] The second determining module is used to determine the target physical block group corresponding to the first physical block if the cumulative number of reads of the first physical block is greater than or equal to the second read count threshold.

[0098] The task generation module is used to generate target garbage collection tasks that perform garbage collection on target physical block groups, and to set the target garbage collection tasks as currently pending garbage collection tasks for processing.

[0099] Optionally, the read interference processing device 30 further includes:

[0100] The fifth acquisition module is used to acquire the number of garbage collection tasks to be processed and the first task number threshold corresponding to the second processing strategy if the cumulative number of reads of the first physical block is greater than or equal to the second read count threshold.

[0101] The second modification module is used to change the current processing strategy from the second processing strategy to the first processing strategy when the number of current pending garbage collection tasks is greater than the first task number threshold.

[0102] Further optionally, the fifth acquisition module is also used for:

[0103] If the cumulative number of reads of the first physical block is greater than or equal to the second read count threshold, the remaining garbage collection task count is incremented by one to obtain the updated remaining garbage collection task count;

[0104] The updated remaining number of garbage collection tasks is determined as the number of garbage collection tasks currently pending.

[0105] Optionally, the second read count threshold is greater than the first read count threshold.

[0106] Optionally, the read interference processing device 30 further includes:

[0107] The third change module is used to decrease the number of currently pending garbage collection tasks by one in response to the completion of any garbage collection task in the current pending garbage collection tasks.

[0108] Optionally, the second physical block is the physical block of the currently executed data write command.

[0109] For a description of the features in the embodiment corresponding to the interference processing device, please refer to the relevant description of the embodiment corresponding to the interference processing method, which will not be repeated here.

[0110] Embodiments of this application also provide an electronic device, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above-described read interference processing method embodiments.

[0111] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above-described embodiments of the read interference processing method when running.

[0112] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.

[0113] Embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above-described embodiments of the read interference processing method.

[0114] Embodiments of this application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in any of the above-described read interference processing method embodiments.

[0115] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0116] The foregoing has provided a detailed description of the interference processing method and electronic device provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only intended to help understand the method and core ideas of this application. It should be noted that those skilled in the art can make various improvements and modifications to this application without departing from its principles, and these improvements and modifications also fall within the protection scope of the claims of this application.

Claims

1. A method for handling reading interference, characterized in that, include: When reading target data from the first physical block, obtain the cumulative number of reads of the first physical block; When the current processing strategy is the first processing strategy, the first read count threshold corresponding to the first processing strategy is obtained. The first processing strategy is triggered when the number of garbage collection tasks to be processed is greater than the first task count threshold. SSD is configured with the second processing strategy by default. Under the second processing strategy, garbage collection is performed on the superblock where the physical block whose cumulative read count reaches the second read count threshold is located. If the cumulative number of reads of the first physical block is greater than or equal to the first read count threshold, then the target data is migrated to the second physical block.

2. The reading interference processing method according to claim 1, characterized in that, Prior to migrating the target data to the second physical block, the method further includes: Obtain the number of garbage collection tasks currently pending and the second task number threshold corresponding to the first processing strategy, wherein the second task number threshold is less than the first task number threshold; The number of currently pending garbage collection tasks is determined to be greater than or equal to the second task number threshold.

3. The reading interference processing method according to claim 2, characterized in that, The method further includes: If the number of currently pending garbage collection tasks is less than the second task number threshold, the current processing strategy will be changed from the first processing strategy to the second processing strategy. The second processing strategy is a garbage collection strategy for the physical block group to which the physical block to which the accumulated number of reads reaches the second read count threshold belongs.

4. The reading interference processing method according to claim 1, characterized in that, The method further includes: When the current processing strategy is the second processing strategy, obtain the second reading count threshold corresponding to the second processing strategy; If the cumulative number of reads of the first physical block is greater than or equal to the second read count threshold, the target physical block group corresponding to the first physical block is determined; Generate a target garbage collection task to perform garbage collection on the target physical block group, and set the target garbage collection task as the current pending garbage collection task for processing.

5. The reading interference processing method according to claim 4, characterized in that, The method further includes: If the cumulative number of reads of the first physical block is greater than or equal to the second read count threshold, obtain the number of garbage collection tasks to be processed and the first task count threshold corresponding to the second processing strategy; If the number of currently pending garbage collection tasks exceeds the first task number threshold, the current processing strategy will be changed from the second processing strategy to the first processing strategy.

6. The reading interference processing method according to claim 5, characterized in that, If the cumulative number of reads of the first physical block is greater than or equal to the second read count threshold, the number of tasks for the current pending garbage collection task is obtained, including: If the cumulative number of reads of the first physical block is greater than or equal to the second read count threshold, the number of remaining garbage collection tasks is incremented by one to obtain the updated number of remaining garbage collection tasks. The updated number of remaining garbage collection tasks is determined as the number of garbage collection tasks currently pending processing.

7. The reading interference processing method according to claim 4, characterized in that, The second read count threshold is greater than the first read count threshold.

8. The reading interference processing method according to any one of claims 1-7, characterized in that, The method further includes: In response to the completion of any garbage collection task in the currently pending garbage collection tasks, the number of tasks in the currently pending garbage collection tasks is reduced by one.

9. The reading interference processing method according to any one of claims 1-7, characterized in that, The second physical block is the physical block for which the data write command is currently being executed.

10. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the read interference processing method as described in any one of claims 1 to 9 when executing the computer program.

Citation Information

Patent Citations

  • Processing method for data operation and related device

    CN108984131A

  • Method, device and equipment for read interference processing and readable storage medium

    CN109976671A