Task management method and device, storage medium and solid state disk
Patent Information
- Application Number
- CN202310322882.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-29
- Publication Date
- 2026-09-25
- Estimated Expiration
- 2043-03-29
AI Technical Summary
[0005]本发明实施例的目的在于提供一种任务管理方法、装置、存储介质及固态硬盘,解决因任务资源竞争产生队列延迟,增加响应时间,影响任务处理的效率的问题,以实现有效可靠的任务管理,具体技术方案如下:
[0060]本发明实施例提供的任务管理方法,通过获取闪存资源及所述闪存资源的每个任务的未完成请求,根据闪存资源和未完成请求,生成每个任务的请求限额,若任务中未完成请求的数量小于请求限额,确定任务有资格发出请求,监控任务完成状态,根据预先配置的任务调度份额,对任务发出请求进行调整。本发明实施例中通过借记调度器仲裁闪存子系统资源的使用,有效地控制任务之间的资源竞争,从而提高系统的整体性能和可靠性,并且利用借记调度器跟踪每个任务的未完成请求的数量,并根据任务的请求限额来决定是否发出请求,共享控制器监控系统状态来确定适当的请求限额和任务调度份额,确保闪存的稳定性和可靠性,防止资源竞争导致的响应时间无限增加和数据丢失的情况发生,从而提高系统的可靠性和稳定性,进一步提升了固态硬盘性能。
Smart Images

Figure CN116339948B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to a task management method, apparatus, storage medium, and solid-state drive. Background Technology
[0002] Solid State Drive (SSD) is a device used to store user data. It consists of modules such as a controller and NAND (NAND flash memory) storage medium, and has the advantages of high performance and low power consumption.
[0003] Currently, SSDs use the FTL (Flash Translation Layer) algorithm to manage data. Since the number of times each storage unit (e.g., a page) in an SSD can be erased and written is limited, FTL can only minimize the erase and write operations on the SSD through techniques such as compression, merging, clearing, and remapping to improve the performance and lifespan of the SSD.
[0004] However, multiple FTL tasks generate a series of flash requests that compete for shared flash subsystem resources. Since all resources in the flash subsystem can be used to serve host requests, and host writes occupy flash blocks, GC (Garbage Collection) needs to reclaim space by compressing valid data distributed on the blocks and erasing unused blocks. Therefore, the host and GC compete for resources, which causes queue latency, increases the response time of requests, and leads to long-tail latency, affecting the efficiency of task processing. Summary of the Invention
[0005] The purpose of this invention is to provide a task management method, apparatus, storage medium, and solid-state drive to solve the problem of queue delays caused by task resource contention, which increases response time and affects task processing efficiency, thereby achieving effective and reliable task management. The specific technical solution is as follows:
[0006] In a first aspect of this invention, a task management method is provided, applied to a solid-state drive, the method comprising:
[0007] Obtain flash memory resources and incomplete requests for each task within those flash memory resources;
[0008] Based on the flash memory resources and the incomplete requests, generate a request limit for each of the tasks;
[0009] If the number of incomplete requests in the task is less than the request limit, the task is deemed eligible to issue a request.
[0010] Monitor the task completion status and, based on the pre-configured task scheduling share, issue a request to adjust the task.
[0011] Optionally, the solid-state drive includes a debit scheduler, wherein generating a request limit for each task based on the flash memory resources and the unfinished requests includes:
[0012] The incomplete requests for each task are sorted according to their priority and timestamp.
[0013] The sorted incomplete requests are processed through a pre-set request window;
[0014] Based on the flash memory resources, the debit scheduler generates a request limit for each task.
[0015] Optionally, after determining that the task is eligible to issue a request if the number of incomplete requests in the task is less than the request limit, the method further includes:
[0016] If the number of incomplete requests in the task is equal to the request limit, the task is determined to be eligible to issue a request after at least the previous request was issued.
[0017] If the number of incomplete requests for multiple tasks is less than the request limit, a target task is determined from among the multiple tasks according to a preset random scheduling algorithm, so that the target task is eligible to issue a request.
[0018] Optionally, if the number of incomplete requests for all of the multiple tasks is less than the request limit, determining any one of the multiple tasks as the target task according to a preset random scheduling algorithm, so that the target task is eligible to issue a request, includes:
[0019] According to a preset random scheduling algorithm, any one of the multiple tasks is determined as the target task, and it is determined whether the first request of the target task is at the head of the request queue.
[0020] If so, then the target task is deemed qualified to issue the first request;
[0021] Otherwise, the request for the target task is scheduled so that the first request reaches the head of the request queue.
[0022] Optionally, the solid-state drive includes a shared controller, and the step of determining any one of the multiple tasks as the target task according to a preset random scheduling algorithm, and determining whether the first request of the target task is after the head of the request queue, further includes:
[0023] Based on the completion status of the target task, the request limit for the target task is adjusted by the shared controller, including:
[0024] If the target task is eligible to issue the first request, the request limit of the target task is increased by 1 by the debit scheduler;
[0025] If the target task completes the first request, the request limit of the target task is reduced by 1 by the debit scheduler.
[0026] Optionally, the monitoring task completion status is adjusted by issuing a request to the task based on a pre-configured task scheduling share, including:
[0027] Monitor the task completion status and determine whether there is any deviation in the task completion status, wherein the task completion status includes the issuance status of host requests and background task requests;
[0028] When the task completion status is balanced, the actual scheduling share of the host request and the background task is determined according to the pre-configured task scheduling share, and the task is adjusted by issuing a request, wherein the actual scheduling share of the background task is less than the actual scheduling share of the host request.
[0029] Optionally, after monitoring the task completion status and determining whether there is a deviation in the task completion status, the method further includes:
[0030] If a deviation is found in the task completion status, a feedback mechanism is adopted to determine the task scheduling share deviation and correct the task scheduling share deviation.
[0031] The task scheduling share is re-determined for the corrected tasks to achieve a balance in task completion status.
[0032] In a second aspect of the invention, a task management device is also provided, applied to a solid-state drive, comprising:
[0033] The acquisition module is used to acquire flash memory resources and the unfinished requests for each task of the flash memory resources;
[0034] A generation module is used to generate a request limit for each of the tasks based on the flash memory resources and the incomplete requests;
[0035] The determination module is used to determine whether the task is eligible to issue a request if the number of incomplete requests in the task is less than the request limit.
[0036] The adjustment module is used to monitor the task completion status and make adjustments to the task according to the pre-configured task scheduling share.
[0037] Optionally, the solid-state drive includes a debit scheduler, and the generation module includes:
[0038] The first processing submodule is used to sort the unfinished requests of each task according to their priority and timestamp.
[0039] The second processing submodule is used to process the sorted incomplete requests through a pre-set request window;
[0040] A generation submodule is used to generate a request limit for each task based on the flash memory resources through the debit scheduler.
[0041] Optionally, the device further includes:
[0042] The second determining module is used to determine that the task is eligible to issue a request after at least the previous request was issued if the number of incomplete requests in the task is equal to the request limit.
[0043] The third determining module is used to determine any one of the multiple tasks as the target task according to a preset random scheduling algorithm if the number of uncompleted requests of the multiple tasks is less than the request limit, so that the target task is eligible to issue a request.
[0044] Optionally, the third determining module includes:
[0045] The judgment submodule determines any one of the multiple tasks as the target task according to a preset random scheduling algorithm, and determines whether the first request of the target task is at the head of the request queue.
[0046] A determining submodule is used to determine, if yes, that the target task is qualified to issue the first request;
[0047] The scheduling submodule is used to otherwise schedule the request for the target task so that the first request reaches the head of the request queue.
[0048] Optionally, the solid-state drive includes a shared controller, and the third determining module further includes:
[0049] The adjustment submodule is used to adjust the request limit of the target task according to the completion status of the target task through the shared controller, specifically including:
[0050] The first adjustment unit is configured to increase the request limit of the target task by 1 through the debit scheduler if the target task is qualified to issue the first request.
[0051] The second adjustment unit is used to reduce the request limit of the target task by 1 through the debit scheduler when the target task completes the first request.
[0052] Optionally, the adjustment module includes:
[0053] The monitoring submodule is used to monitor the task completion status and determine whether there is any deviation in the task completion status. The task completion status includes the issuance of host requests and background task requests.
[0054] The first adjustment submodule is used to determine the actual scheduling share of the host request and the background task based on the pre-configured task scheduling share when the task completion status is balanced, and to issue a request to adjust the task, wherein the actual scheduling share of the background task is less than the actual scheduling share of the host request.
[0055] Optionally, the device further includes:
[0056] The first feedback module is used to determine the task scheduling share deviation of the task and correct the task scheduling share deviation when it is determined that there is a deviation in the task completion status.
[0057] The second feedback module is used to redetermine the task scheduling share for the corrected task so that the task completion status reaches a balance.
[0058] In another aspect of the present invention, a computer-readable storage medium is also provided, wherein instructions are stored therein, which, when executed on a computer, cause the computer to perform any of the task management methods described above.
[0059] In another aspect of the present invention, a solid-state drive is also provided, comprising: a control unit, and at least one flash memory medium communicatively connected to the control unit, wherein the control unit executes any of the task management methods described above.
[0060] The task management method provided in this invention obtains flash memory resources and the unfinished requests for each task within those resources. Based on the flash memory resources and the unfinished requests, a request limit is generated for each task. If the number of unfinished requests in a task is less than the request limit, the task is deemed eligible to issue a request. The method monitors the task completion status and adjusts the task request issuance according to a pre-configured task scheduling share. This invention effectively controls resource contention between tasks by arbitrating the use of flash memory subsystem resources through a debit scheduler, thereby improving the overall system performance and reliability. Furthermore, the debit scheduler tracks the number of unfinished requests for each task and determines whether to issue a request based on the task's request limit. The shared controller monitors the system status to determine appropriate request limits and task scheduling shares, ensuring the stability and reliability of the flash memory and preventing resource contention from causing unlimited increases in response time and data loss. This improves system reliability and stability, further enhancing solid-state drive performance. Attached Figure Description
[0061] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below.
[0062] Figure 1 This is one of the flowcharts of a task management method provided in an embodiment of the present invention;
[0063] Figure 2 yes Figure 1 A flowchart of step 102 of a task management method provided in this embodiment of the invention;
[0064] Figure 3 This is the second step flowchart of a task management method provided in an embodiment of the present invention;
[0065] Figure 4 yes Figure 1 A flowchart of step 104 of a task management method provided in this embodiment of the invention;
[0066] Figure 5 This is one of the schematic diagrams of a task management method provided in an embodiment of this application;
[0067] Figure 6 This is a second schematic diagram of a task management method provided in an embodiment of this application;
[0068] Figure 7 This is a schematic diagram illustrating an application scenario of a task management method provided in an embodiment of this application;
[0069] Figure 8 This is a schematic diagram of the structure of a task management device provided in an embodiment of the present invention;
[0070] Figure 9 This is a schematic diagram of the structure of a solid-state drive provided in an embodiment of the present invention. Detailed Implementation
[0071] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the various embodiments of the present invention will be described in detail below with reference to the accompanying drawings. However, those skilled in the art will understand that many technical details are presented in the various embodiments of the present invention to facilitate a better understanding of this application. However, the technical solutions claimed in this application can be implemented even without these technical details and various changes and modifications based on the following embodiments. The division of the various embodiments below is for ease of description and should not constitute any limitation on the specific implementation of the present invention. The various embodiments can be combined with and referenced by each other without contradiction.
[0072] Reference Figure 1 This illustrates one of the step flowcharts of a task management method provided in an embodiment of the present invention, applied to... Figure 7 The solid-state drive shown, the method may include:
[0073] Step 101: Obtain flash memory resources and the incomplete requests for each task of the flash memory resources.
[0074] In this embodiment of the invention, in order to address the issue of resource contention between the host and GC tasks, where all resources of the flash subsystem can be used to serve host requests, but host writes occupy flash blocks, and GC garbage collection needs to reclaim space by compressing valid data distributed on the blocks and erasing unused blocks, this embodiment uses a debit scheduler within the SSD to arbitrate flash subsystem resources. The debit scheduler tracks and limits the number of incomplete requests for each task across all resources, further controlling scheduling to achieve reasonable resource allocation and efficient task management.
[0075] It should be noted that the solid-state drive (SSD) in this embodiment includes a debit scheduler and a shared controller. These are crucial components of the SSD. The debit scheduler is responsible for optimizing the order and timing of flash memory operations to maximize SSD performance. It needs to consider resource contention and queue latency issues between flash memory requests generated by multiple FTL tasks, and dynamically adjust task priorities based on flash memory status and load to maximize system performance. The shared controller is a mechanism for coordinating resource allocation and task scheduling among multiple FTL tasks. It is responsible for coordinating resource allocation between flash memory requests, controlling the concurrency of flash memory operations, avoiding and reducing resource contention and queue latency, and dynamically adjusting task priorities based on flash memory status and load to maximize system performance. Therefore, in this embodiment, the debit scheduler and shared controller work together within the SSD to collaboratively achieve efficient operation and optimized performance.
[0076] Specifically, the system acquires flash memory resources and the incomplete requests for each task related to those resources. These requests can be I / O requests, typically sent from the host to the solid-state drive (SSD). The host communicates with the SSD via the CPU and input / output devices on the motherboard (such as network cards and graphics cards) to read / write data or perform other operations. When the host needs to access data on the SSD, it issues an I / O request containing the required data and commands, such as reading a file or writing a data block. The request is parsed and executed in the SSD's controller. Therefore, in this embodiment, the system monitors and tracks the progress of requests to acquire flash memory resources and the incomplete requests for each task related to those resources, in order to further execute the scheduled tasks.
[0077] Step 102: Generate a request limit for each task based on flash memory resources and incomplete requests.
[0078] In this embodiment of the invention, the debit scheduler, based on flash memory resources and incomplete requests, employs a priority queue-based algorithm to sort incomplete requests in tasks according to request priority and timestamp. Each task has a debit balance, representing the number of incomplete requests currently in progress. When a task's debit balance is below a limit, its requests can be issued. When the debit balance reaches the request limit, it must wait for previous requests to be completed before issuing further requests. The request limit set in this embodiment is used to restrict the number of incomplete requests for each task and is proportional to the task scheduling share set by the share controller. The share controller is responsible for setting the task scheduling share, allowing tasks with higher shares to potentially utilize more resources simultaneously. This embodiment ensures that the sum of request limits covers incomplete requests by generating a request limit for each task, and the sum of request limits for all tasks cannot exceed the total task share.
[0079] It should be noted that in this embodiment, the request limit for each task is generated using a debit scheduler. A request window technique can be employed, which uses a sliding window method. Each task has a request window of size N. When a request is issued, if the window is not full, the request can be accepted; if the window is full, it must wait for the requests in the window to complete before another request can be issued. The window size N can be adjusted according to task requirements and system status to achieve optimal performance and resource utilization efficiency; no specific limitation is made here.
[0080] In this embodiment, a priority queue and a sliding window are used to implement request scheduling. Request limits are dynamically generated based on the demand for unfinished task requests and the system status. The debit scheduler function is implemented in hardware or software, which can optimize the performance and resource utilization efficiency of SSDs and improve the reliability and stability of the system.
[0081] Step 103: If the number of incomplete requests in the task is less than the request limit, the task is deemed eligible to issue a request.
[0082] In this embodiment of the invention, the debit scheduler tracks and limits the number of incomplete requests for each task across all resources, generates a request limit, and determines that the task is eligible to issue a request if the number of incomplete requests in a task is less than the request limit; otherwise, a request cannot be issued until one or more of the previous requests for that task have been completed.
[0083] For example, this embodiment needs to maintain a request limit for each task. This request limit indicates how many more requests the task can make to the resource. When a task makes a request to the resource, it first checks if the task's request limit is 0. If it is 0, it means that the task has reached its request limit and cannot make any more requests. If it is not 0, and the number of uncompleted requests in the task is less than the request limit, the task is determined to be eligible to make a request. Preferably, when multiple tasks compete for the same resource, a task can be selected for scheduling according to a certain probability. For example, to avoid task starvation, tasks with smaller request limits can be preferred.
[0084] In this embodiment, the use of flash memory resources is arbitrated by a debit scheduler, which effectively controls resource competition between tasks. The debit scheduler tracks the number of incomplete requests for each task and decides whether to issue a request based on the task's request limit, preventing the response time from increasing indefinitely and data loss caused by resource competition.
[0085] Step 104: Monitor the task completion status and adjust the task according to the pre-configured task scheduling share.
[0086] In this embodiment of the invention, the shared controller monitors the task completion status and adjusts the task requests based on a pre-configured task scheduling share. Specifically, it determines the appropriate share of scheduled tasks by monitoring the task completion status of critical systems. The pre-configured task scheduling share is the share of available resources for a task pre-determined by the shared controller based on the task completion status. The task completion status may include parameters such as the number of free blocks and the maximum read count, reflecting the stability of the flash memory. This is crucial for the overall performance and reliability of the system, because if these task states cannot be kept at a balanced level, it may lead to an indefinite increase in response time or even data loss.
[0087] It's important to note that, for example, if the flash memory runs out of available blocks, not only will host writes stop, but all other tasks using flash memory will also cease, relying solely on garbage collection to reclaim free space. Worse still, if the GC cannot acquire a free block to write valid data, it can lead to a deadlock in a poorly constructed FTL. Furthermore, if the read count of a block exceeds the NAND limit, and the number of errors exceeds error correction capabilities, accumulated read disturbances can result in data loss. To prevent these adverse system conditions, task completion status is monitored, and task requests are adjusted based on pre-configured task scheduling shares to ensure system stability.
[0088] The task management method provided in this invention obtains flash memory resources and the unfinished requests for each task within those resources. Based on the flash memory resources and the unfinished requests, a request limit is generated for each task. If the number of unfinished requests in a task is less than the request limit, the task is deemed eligible to issue a request. The method monitors the task completion status and adjusts the task request issuance according to a pre-configured task scheduling share. This invention effectively controls resource contention between tasks by arbitrating the use of flash memory subsystem resources through a debit scheduler, thereby improving the overall system performance and reliability. Furthermore, the debit scheduler tracks the number of unfinished requests for each task and determines whether to issue a request based on the task's request limit. The shared controller monitors the system status to determine appropriate request limits and task scheduling shares, ensuring the stability and reliability of the flash memory and preventing resource contention from causing unlimited increases in response time and data loss. This improves system reliability and stability, further enhancing solid-state drive performance.
[0089] Reference Figure 2 ,yes Figure 1 The flowchart of step 102 of the task management method provided in this embodiment of the invention is disclosed in this embodiment. Figure 1 One feasible implementation of step 102 in the illustrated embodiment specifically includes:
[0090] Step 1021: Sort the incomplete requests for each task according to their priority and timestamp.
[0091] Specifically, in this embodiment, the debit scheduler uses a priority queue algorithm to sort the incomplete requests for each task according to request priority and timestamp. Each task has a debit side, representing the number of currently incomplete requests. For higher-priority tasks, higher request limits can be set to prioritize their response time and reliability. For different task types, different request limits and quotas can be set based on timestamps to maximize resource utilization and optimize system performance.
[0092] Step 1022: Process the sorted incomplete requests through a pre-set request window.
[0093] In this embodiment of the invention, a request window is used to implement resource management. Each task corresponds to a request window, which represents the maximum number of incomplete requests that can be initiated within the window. When a task initiates a request, the debit scheduler checks whether the task's request window allows the initiation of a new request. If the window is full, the request will be delayed until the task completes enough requests to free up space. If the window is still available, the request will be accepted and executed immediately.
[0094] In this implementation, incomplete requests are processed through a pre-set request window, so that the debit scheduler can balance the resource usage among various tasks, thereby improving the system's performance and reliability.
[0095] Step 1023: Based on the flash memory resources, generate the request limit for each task through the debit scheduler.
[0096] In this embodiment, the debit scheduler tracks the number of incomplete requests for each task and limits the rate at which it initiates new requests based on flash memory resources, generating a request limit for each task to prevent some tasks from consuming too many resources, thereby preventing other tasks from being completed in a timely manner.
[0097] In this embodiment of the invention, compared with the prior art, task requests are arbitrated by a debit scheduler. The unfinished requests of each task are sorted according to their priority and timestamp. The sorted unfinished requests are processed through a pre-set request window. A request limit for each task is generated based on flash memory resources. The number of executable tasks is controlled within a controllable range to avoid excessive task competition for resources, which could affect the stability and performance of the system.
[0098] The second embodiment of the present invention relates to a task management method, which is basically the same as the task management method provided in the first embodiment of the present invention, except that, with reference to Figure 3 , Figure 3 This is the second flowchart of the task management method provided in this embodiment of the invention, including:
[0099] Step 101: Obtain the flash memory resources and the incomplete requests for each task of the flash memory resources.
[0100] Step 102: Generate a request limit for each task based on flash memory resources and incomplete requests.
[0101] Step 103: If the number of incomplete requests in the task is less than the request limit, the task is determined to be eligible to issue a request.
[0102] Steps 101-103 above will not be repeated here again, referring to the previous discussion.
[0103] Step 105: If the number of incomplete requests in the task is equal to the request limit, determine that the task is eligible to issue a request after at least the previous request was issued.
[0104] In this embodiment, the debit scheduler tracks and limits the number of incomplete requests for each task across all resources, generates a request limit, and determines that the task is eligible to issue a request after at least one previous request has been issued, i.e., it cannot issue a request before one or more previous requests of the task have been completed.
[0105] For example, in this embodiment, a request limit needs to be maintained for each task. The request limit indicates how many more requests the task can make to the resource. When a task makes a request to the resource, it first checks whether the task's request limit is 0. If it is 0, it means that the task has reached the request limit and cannot make any more requests. If the number of incomplete requests in the task equals the request limit, it is determined that the task is eligible to make requests after at least one previous request has been made, and a task can be selected for scheduling according to a certain probability.
[0106] Step 106: If the number of incomplete requests for multiple tasks is less than the request limit, determine any one of the multiple tasks as the target task according to the preset random scheduling algorithm so that the target task is eligible to issue a request.
[0107] In this embodiment, the debit scheduler tracks and limits the number of incomplete requests for each task across all resources. If the number of incomplete requests for multiple tasks is less than the request limit, a target task is determined from among the multiple tasks according to a preset random scheduling algorithm so that the target task is eligible to issue a request.
[0108] Step 104: Monitor the task completion status and adjust the task according to the pre-configured task scheduling share.
[0109] Step 104 above will not be repeated here, referring to the previous discussion.
[0110] It should be noted that this embodiment does not limit the specific execution location of steps 105 and 106. In this embodiment, for ease of understanding, steps 105 and 106 are described as being executed after step 103 and before step 104. In actual use, steps 105 and 106 can also be performed before step 103; each case will not be described in detail here.
[0111] Specifically, step 106, if the number of incomplete requests for multiple tasks is less than the request limit, determines any one of the multiple tasks as the target task according to a preset random scheduling algorithm, so that the target task is eligible to issue a request. This may include the following steps:
[0112] First, according to the preset random scheduling algorithm, any one of the multiple tasks is determined as the target task, and it is determined whether the first request of the target task is at the head of the request queue.
[0113] Secondly, if so, then the target task is deemed qualified to issue the first request;
[0114] Secondly, otherwise, the requests for the target task are scheduled so that the first request reaches the head of the request queue.
[0115] It should be noted that in the above steps, the preset random scheduling algorithm selects a task with skewed randomness when multiple tasks under the request limit compete for the same resource, favoring tasks with a smaller number of requests compared to the request limit. According to the preset random scheduling algorithm, any one of the multiple tasks is identified as the target task, and it is determined whether the target task's first request is at the head of the request queue. If so, the target task is deemed eligible to issue the first request, where the first request can be any request at the head of the request queue (this is not specifically limited). Otherwise, the target task's request is scheduled so that the first request reaches the head of the request queue. In this embodiment, the preset random scheduling algorithm with added randomness is used to avoid task starvation and ensure system stability.
[0116] To enable those skilled in the art to more clearly understand the task management method disclosed in the embodiments of the present invention, please refer to Figures 4 to 5 The diagram below is a schematic representation of task management provided in an embodiment of the present invention, and will be used for illustration.
[0117] Specifically, the above steps, based on a preset random scheduling algorithm, determine any one of the multiple tasks as the target task and determine whether the first request of the target task is after the head of the request queue, also include:
[0118] Based on the completion status of the target task, the request limit for the target task is adjusted through the shared controller, including:
[0119] If the target task is eligible to make the first request, increase the target task's request limit by 1 via the debit scheduler;
[0120] If the target task completes its first request, the request limit for the target task is reduced by 1 via the debit scheduler.
[0121] For example, refer to Figure 4 In a flash memory subsystem, multiple tasks may simultaneously send requests to different chips. A debit scheduler controls the scheduling and resource allocation of these requests. When a task sends a request, the debit scheduler checks the number of incomplete requests and the amount of resources currently available to that task to decide whether to accept the request. For example, Figure 4 In the scenario, Task 1 and Task 2 send requests to Chip 3, Chip 2, Chip 1, and Chip 0 respectively, each with a corresponding request value representing the amount of resources currently available. Assuming Chip 0's queue is full and can no longer accept new requests, Task 1 uses the debit scheduler to find other available resources and selects the most suitable task for scheduling. Since Chip 2's request window still has space, Task 1's request is scheduled, and its request debit value increases from 1 to 2. At this point, Task 1 can continue to send requests to Chip 2 and use more resources to complete its task.
[0122] For example, refer to Figure 5 Tasks 1 and 2 send requests to different chips. Task 1's request is blocked because its debit value is below the request limit, and Chip 0 has not yet completed its queuing operation. At this point, the debit scheduler selects the next task to schedule based on each task's debit value and request limit. If multiple tasks compete for the same resource, such as Chip 1, the debit scheduler will select one task for scheduling with skewed randomness. This randomness is to avoid task starvation, where some tasks cannot obtain enough resources to complete their work. In the above scenario, since Task 2 has completed its activity on Chip 3, its request to Chip 1 can begin scheduling. Although its request is not at the head of the queue, because it has no dependency on other tasks, the debit scheduler can randomly select it for execution. When Task 2's request is successfully scheduled, its debit value will increase accordingly to reflect the increased resource usage.
[0123] In this embodiment, when a chip's queue is full or a task's request has reached its request limit, the debit scheduler will search for other available resources. If the debit values and request windows of other tasks allow them to continue sending requests, the debit scheduler will schedule the task. After scheduling, the task's debit value will increase accordingly. If the target task is eligible to issue a first request, the debit scheduler increases the target task's request limit; if the target task completes its first request, the debit scheduler decreases the target task's request limit to reflect its increased resource usage. This process can continue until all tasks are completed, thereby balancing resource usage among tasks and improving the performance and reliability of the flash memory subsystem.
[0124] Compared with the prior art, the embodiments of the present invention, based on achieving the beneficial effects of the first embodiment, effectively control the resource competition between tasks by arbitrating the use of flash memory subsystem resources through a debit scheduler, thereby improving the performance and reliability of the flash memory subsystem. Furthermore, by employing a preset random scheduling algorithm, the resource usage among various tasks can be balanced, improving the scalability of the task management method of the present invention and enabling its widespread application in various scenarios such as computers and mobile devices.
[0125] Reference Figure 4 ,yes Figure 1 The flowchart of step 104 of the task management method provided in this embodiment of the invention is disclosed in this embodiment. Figure 1 One feasible implementation of step 104 in the illustrated embodiment specifically includes:
[0126] Step 1041: Monitor the task completion status and determine if there are any deviations in the task completion status. The task completion status includes the issuance of host requests and background task requests.
[0127] Step 1042: When the task completion status is balanced, determine the actual scheduling share of host requests and background tasks according to the pre-configured task scheduling share, and issue a request to adjust the task, wherein the actual scheduling share of background tasks is less than the actual scheduling share of host requests.
[0128] It should be noted that monitoring task completion status determines whether there is a discrepancy between the task scheduling share and the task completion status. Specifically, the number of free blocks and the maximum read count reflect the stability of the flash memory, which is crucial for the overall system performance and reliability. Failure to maintain these states at a balanced level may lead to an indefinite increase in response time or even data loss. Therefore, in this embodiment, when task completion status is balanced, the actual scheduling share of background tasks is less than the actual scheduling share requested by the host, ensuring that task completion status is balanced.
[0129] In this embodiment, when the task completion status is balanced, the actual scheduling share of host requests and background tasks is determined according to the pre-configured task scheduling share, and the requests issued to the tasks are adjusted accordingly.
[0130] Specifically, after step 1041 monitors the task completion status and determines whether there are any deviations in the task completion status, it also includes:
[0131] If a deviation is found in the task completion status, a feedback mechanism is adopted to determine the task scheduling share deviation and correct the task scheduling share deviation.
[0132] The task scheduling share is reassigned for the corrected tasks to achieve a balance in task completion status.
[0133] Specifically, this embodiment employs a feedback mechanism to dynamically adjust the share of FTL subtasks, as follows:
[0134] SA[t] = PA·eA[t]+ IA·SA[t - 1] (1)
[0135] Where SA[t] is the scheduling share of task A at time t, SA[t-1] is the scheduling share of task A at the previous time t-1, PA and IA are two non-negative coefficients of task A at time t, and eA[t] is the error value of task A at time t.
[0136] Preferably, the error value function for GC subtask management is defined as follows:
[0137] egc[t] = max(0, target-freeblk -num-freeblk[t]) (2)
[0138] It should be noted that egc[t] is the error value at time t, target-freeblk is the GC enabling threshold, and num-freeblk[t] is the number of free blocks at time t. When the number of free blocks is much lower than the GC enabling threshold, the error value will increase the share of the GC subtask. When the number of free blocks exceeds the GC enabling threshold, the share of the GC subtask will decrease.
[0139] Preferably, the error value function for GC subtask management caused by read interference is defined as follows:
[0140] erd[t] = max(0, max-readcnt[t]–target-readcnt) (3)
[0141] Where erd[t] is the error value at time t, max-readcnt[t] is the maximum read count at time t, and target-readcnt is the GC read interference threshold.
[0142] The FTL subtask management scheme in this embodiment, when task completion status is balanced, determines the actual scheduling share of host requests and background tasks based on pre-configured task scheduling shares, and adjusts task requests accordingly. If a deviation in task completion status is detected, a feedback mechanism is used to determine and correct the task scheduling share deviation, and the task scheduling share of the corrected tasks is re-determined to achieve task completion status balance. The task management method in this embodiment can be quickly expanded to meet other task requirements, exhibiting strong system scalability and elasticity.
[0143] Reference Figure 8 This diagram illustrates the structure of a task management device according to an embodiment of the present invention, which is applied to... Figure 7 The solid-state drive, the device may include:
[0144] The acquisition module 201 is used to acquire flash memory resources and unfinished requests for each task of the flash memory resources;
[0145] The generation module 202 is used to generate a request limit for each of the tasks based on the flash memory resources and the incomplete requests;
[0146] The determining module 203 is used to determine that the task is eligible to issue a request if the number of incomplete requests in the task is less than the request limit;
[0147] The adjustment module 204 is used to monitor the task completion status and make adjustments to the task according to the pre-configured task scheduling share.
[0148] Furthermore, the generation module 202 includes:
[0149] The first processing submodule is used to sort the unfinished requests of each task according to their priority and timestamp.
[0150] The second processing submodule is used to process the sorted incomplete requests through a pre-set request window;
[0151] A generation submodule is used to generate a request limit for each task based on the flash memory resources through the debit scheduler.
[0152] Furthermore, the device also includes:
[0153] The second determining module is used to determine that the task is eligible to issue a request after at least the previous request was issued if the number of incomplete requests in the task is equal to the request limit.
[0154] The third determining module is used to determine any one of the multiple tasks as the target task according to a preset random scheduling algorithm if the number of uncompleted requests of the multiple tasks is less than the request limit, so that the target task is eligible to issue a request.
[0155] Furthermore, the third determining module includes:
[0156] The judgment submodule determines any one of the multiple tasks as the target task according to a preset random scheduling algorithm, and determines whether the first request of the target task is at the head of the request queue.
[0157] A determining submodule is used to determine, if yes, that the target task is qualified to issue the first request;
[0158] The scheduling submodule is used to otherwise schedule the request for the target task so that the first request reaches the head of the request queue.
[0159] Furthermore, the third determining module also includes:
[0160] The adjustment submodule is used to adjust the request limit of the target task according to the completion status of the target task through the shared controller, specifically including:
[0161] The first adjustment unit is configured to increase the request limit of the target task by 1 through the debit scheduler if the target task is qualified to issue the first request.
[0162] The second adjustment unit is used to reduce the request limit of the target task by 1 through the debit scheduler when the target task completes the first request.
[0163] Furthermore, the adjustment module 204 includes:
[0164] The monitoring submodule is used to monitor the task completion status and determine whether there is any deviation in the task completion status. The task completion status includes the issuance of host requests and background task requests.
[0165] The first adjustment submodule is used to determine the actual scheduling share of the host request and the background task based on the pre-configured task scheduling share when the task completion status is balanced, and to issue a request to adjust the task, wherein the actual scheduling share of the background task is less than the actual scheduling share of the host request.
[0166] Furthermore, the device also includes:
[0167] The first feedback module is used to determine the task scheduling share deviation of the task and correct the task scheduling share deviation when it is determined that there is a deviation in the task completion status.
[0168] The second feedback module is used to redetermine the task scheduling share for the corrected task so that the task completion status reaches a balance.
[0169] The task management device provided in this embodiment of the invention acquires flash memory resources and the unfinished requests for each task within those flash memory resources. Based on the flash memory resources and the unfinished requests, it generates a request limit for each task. If the number of unfinished requests in a task is less than the request limit, the task is deemed eligible to issue a request. The device monitors the task completion status and adjusts the task request issuance according to a pre-configured task scheduling share. In this embodiment, the use of flash memory subsystem resources is arbitrated by a debit scheduler, effectively controlling resource competition between tasks, thereby improving the overall system performance and reliability. Furthermore, the debit scheduler tracks the number of unfinished requests for each task and determines whether to issue a request based on the task's request limit. The shared controller monitors the system status to determine appropriate request limits and task scheduling shares, ensuring the stability and reliability of the flash memory and preventing resource competition from causing unlimited increases in response time and data loss, thus improving system reliability and stability and further enhancing solid-state drive performance.
[0170] This invention also provides a solid-state drive, such as... Figure 9 As shown, it includes: a control unit, and at least one flash memory medium communicatively connected to the control unit, wherein the control unit, when executed, implements the steps in the task management method of the above embodiments.
[0171] The communication bus mentioned above can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.
[0172] The communication interface is used for communication between the aforementioned terminal and other devices.
[0173] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means.
[0174] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, 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. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0175] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0176] The above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention are included within the scope of protection of the present invention.
Claims
1. A task management method, characterized in that, Applied to a solid-state drive (SSD), the SSD including a debit scheduler and a shared controller, the method includes: Obtain flash memory resources and incomplete requests for each task within those flash memory resources; Based on the flash memory resources and the unfinished requests, a request limit is generated for each task, including: sorting the unfinished requests for each task according to their priority and timestamp; processing the sorted unfinished requests through a pre-set request window; and generating a request limit for each task based on the flash memory resources through the debit scheduler. If the number of incomplete requests in the task is less than the request limit, the task is deemed eligible to issue a request. Monitor the task completion status and, based on the pre-configured task scheduling share, issue a request to adjust the task. The pre-configured task scheduling share is the share of available resources for the task that the shared controller pre-determines based on the task completion status. The monitoring of task completion status involves adjusting the task based on a pre-configured task scheduling share. This includes: if a deviation in task completion status is determined, employing a feedback mechanism to re-determine the task scheduling share to balance the task completion status. The re-determination of the task scheduling share using the feedback mechanism is achieved through the following formula: SA[t]=PA ·eA[t]+IA ·SA[t -1] Where SA[t] is the scheduling share of task A at time t, SA[t-1] is the scheduling share of task A at the previous time t-1, PA and IA are two non-negative coefficients of task A at time t, and eA[t] is the error value of task A at time t.
2. The method according to claim 1, characterized in that, If the number of incomplete requests in the task is less than the request limit, after determining that the task is eligible to issue a request, the method further includes: If the number of incomplete requests in the task is equal to the request limit, the task is determined to be eligible to issue a request after at least the previous request was issued. If the number of incomplete requests for multiple tasks is less than the request limit, a target task is determined from among the multiple tasks according to a preset random scheduling algorithm, so that the target task is eligible to issue a request.
3. The method according to claim 2, characterized in that, If the number of incomplete requests for all of the multiple tasks is less than the request limit, a target task is determined from among the multiple tasks according to a preset random scheduling algorithm, so that the target task is eligible to issue a request, including: According to a preset random scheduling algorithm, any one of the multiple tasks is determined as the target task, and it is determined whether the first request of the target task is at the head of the request queue. If so, then the target task is deemed qualified to issue the first request; Otherwise, the request for the target task is scheduled so that the first request reaches the head of the request queue.
4. The method according to claim 3, characterized in that, The solid-state drive includes a shared controller. The step of determining any one of the multiple tasks as the target task according to a preset random scheduling algorithm, and determining whether the first request of the target task is after the head of the request queue, further includes: Based on the completion status of the target task, the request limit for the target task is adjusted by the shared controller, including: If the target task is eligible to issue the first request, the request limit of the target task is increased by 1 by the debit scheduler; If the target task completes the first request, the request limit of the target task is reduced by 1 by the debit scheduler.
5. The method according to claim 1, characterized in that, The monitoring task completion status is adjusted by issuing a request based on the pre-configured task scheduling share, including: Monitor the task completion status and determine whether there is any deviation in the task completion status, wherein the task completion status includes the issuance status of host requests and background task requests; When the task completion status is balanced, the actual scheduling share of the host request and the background task is determined according to the pre-configured task scheduling share, and the task is adjusted by issuing a request, wherein the actual scheduling share of the background task is less than the actual scheduling share of the host request.
6. The method according to claim 5, characterized in that, After determining whether there is a deviation in the monitoring task completion status, the method further includes: If a deviation is found in the task completion status, a feedback mechanism is adopted to determine the task scheduling share deviation and correct the task scheduling share deviation. The task scheduling share is re-determined for the corrected tasks to achieve a balance in task completion status.
7. A task management device, characterized in that, Applied to a solid-state drive, the solid-state drive including a debit scheduler and a shared controller, the device includes: The acquisition module is used to acquire flash memory resources and the unfinished requests for each task of the flash memory resources; A generation module is used to generate a request limit for each task based on the flash memory resources and the unfinished requests. The generation module includes: a first processing submodule, used to sort the unfinished requests of each task according to the priority and timestamp of the unfinished requests; a second processing submodule, used to process the sorted unfinished requests through a pre-set request window; and a generation submodule, used to generate a request limit for each task based on the flash memory resources through the debit scheduler. The determination module is used to determine whether the task is eligible to issue a request if the number of incomplete requests in the task is less than the request limit. The adjustment module is used to monitor the task completion status and issue a request to adjust the task according to the pre-configured task scheduling share. The pre-configured task scheduling share is the share of available resources for the task determined in advance by the shared controller based on the task completion status. The monitoring of task completion status involves adjusting the task based on a pre-configured task scheduling share. This includes: if a deviation in task completion status is determined, employing a feedback mechanism to re-determine the task scheduling share to balance the task completion status. The re-determination of the task scheduling share using the feedback mechanism is achieved through the following formula: SA[t]=PA ·eA[t]+IA ·SA[t -1] Where SA[t] is the scheduling share of task A at time t, SA[t-1] is the scheduling share of task A at the previous time t-1, PA and IA are two non-negative coefficients of task A at time t, and eA[t] is the error value of task A at time t.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the task management method as described in any one of claims 1-6.
9. A solid-state drive, characterized in that, include: A control unit, and at least one flash memory medium communicatively connected to the control unit, wherein the control unit, when executed, implements the steps of the task management method as described in any one of claims 1-6.
Citation Information
Patent Citations
Read request control device and method and memory controller
CN112597080A
System, method and device for adaptive current limiting
CN113315718A
Managing backlogged tasks
US9465645B1