CN118012342A - Method and device for optimizing task scheduling of SSD (solid State disk) device and storage device - Google Patents

Method and device for optimizing task scheduling of SSD (solid State disk) device and storage device Download PDF

Info

Publication number
CN118012342A
CN118012342A CN202410113669.5A CN202410113669A CN118012342A CN 118012342 A CN118012342 A CN 118012342A CN 202410113669 A CN202410113669 A CN 202410113669A CN 118012342 A CN118012342 A CN 118012342A
Authority
CN
China
Prior art keywords
task
time
current operation
operation task
threshold
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202410113669.5A
Other languages
Chinese (zh)
Inventor
蒲强
李�昊
卢大成
薛红军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Dera Technology Co Ltd
Original Assignee
Beijing Dera Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Dera Technology Co Ltd filed Critical Beijing Dera Technology Co Ltd
Priority to CN202410113669.5A priority Critical patent/CN118012342A/en
Publication of CN118012342A publication Critical patent/CN118012342A/en
Pending legal-status Critical Current

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The invention provides a method, a device and a storage device for optimizing task scheduling of SSD equipment, wherein the method comprises the following steps: when a target task with a higher priority than the priority level of the current operation task is received in the process of executing the operation task by the SSD device, acquiring the continuous execution time length of the current operation task; acquiring a task holding time threshold interval matched with a current operation task; if the continuous execution duration belongs to the time range corresponding to the task holding time threshold interval, distributing the target task to a waiting queue, and continuously executing the current operation task; if the time length of continuous execution is larger than the time upper limit threshold value of the task holding time threshold value interval or smaller than the time lower limit threshold value of the task holding time threshold value interval, the current operation task is suspended and the execution of the target task is started. According to the method and the device for processing the high-priority operation tasks, the time delay of the high-priority operation tasks is distributed in the expected range by adjusting the strategy of suspending the execution of the current operation tasks, so that the occurrence of ultra-long time delay is avoided, and the user experience is effectively improved.

Description

Method and device for optimizing task scheduling of SSD (solid State disk) device and storage device
Technical Field
The invention relates to the technical field of data storage, in particular to a method and a device for optimizing task scheduling of SSD equipment and storage equipment.
Background
With the continuous development of SSD and the rising of cloud service, enterprise-level SSD is widely used in cloud service. High performance is a large bright spot on enterprise-level SSDs, but this bright spot requires reliable stability as a precondition. QoS is thus becoming an important indicator of how much SSD needs to be measured. Among performance test items concerning SSDs, most require confirmation of test results according to QoS indicators. Consumer grade SSDs pursue the highest performance that can be achieved in a short time, do not necessarily show the optimization effect for QoS metrics, nor do they generally focus on such metrics. Unlike consumer SSDs, which are mainly used in personal business scenarios where pressure is limited, enterprise SSDs generally require 7 x 24 hours of continuous operation, so enterprise SSDs are required to provide stable high performance, especially at high pressures to ensure continuous operation of business.
QoS is particularly important in an environment where SSD is used, and the industry refers to a phenomenon of instantaneous occurrence of large performance jitter as a burr, which causes an ultra-long latency (latency), so QoS needs to be introduced to describe stability of product performance. The QoS of SSD embodies the ability to fulfill all requests with consistent performance. Common QoS quantization indexes mainly include giving the maximum delay with a reliability of 99% -99.999%. For example, a 99.999% QoS index results in 0.1mS, indicating that 99.999% of the total requested latency is within 0.1 mS. The delay of the database server needs to reach a certain level to function effectively, especially for the service provider's environment. When multiple workloads contend with each other, guaranteeing the time delay of a key task is important for user experience.
For this reason, in the prior art, by setting a time point, it is often determined at a time check point whether there is a high priority operation in the request queue, so as to determine whether to suspend the current operation to perform the high priority operation. Although this timing trigger manner can control the time interval for suspending the current operation, the manner of operation control according to the checkpoint time set by the flash memory chip has the following problems: if the set time interval is larger, the operation with high priority can be responded after a longer time, so that the overall time delay is increased to some extent, and the time delay performance is deteriorated; if the set time interval is smaller, the checking judgment is frequently performed, and the CPU resource overhead is increased.
Disclosure of Invention
The present invention has been made in view of the above-mentioned problems, and is directed to providing a method, apparatus, and storage device for optimizing task scheduling for SSD devices that overcomes or at least partially solves the above-mentioned problems.
In one aspect of the present invention, a method for optimizing task scheduling of an SSD device is provided, the method comprising:
When a target task with a higher priority than the priority level of the current operation task is received in the process of executing the operation task by the SSD device, acquiring the continuous execution time length of the current operation task;
acquiring a task holding time threshold interval matched with a current operation task;
If the continuous execution duration belongs to the time range corresponding to the task holding time threshold interval, the target task is distributed to a waiting queue, and the current operation task is continuously executed;
And if the continuous execution time is longer than the time upper limit threshold of the task holding time threshold interval or is smaller than the time lower limit threshold of the task holding time threshold interval, suspending the current operation task and starting to execute the target task.
Optionally, the obtaining the continuous execution duration of the current operation task includes:
Acquiring a first time value when the target task is received;
acquiring a time difference value between a starting time value of a current operation task and the first time value, and taking the time difference value as continuous execution duration of the current operation task;
the starting time value of the current operation task comprises a time value of starting to execute the current operation task for the first time or a time value of resuming to execute the current operation task last time.
Optionally, after the target task is assigned to the waiting queue, the method further comprises:
And monitoring the continuous execution time length of the current operation task in real time, and when the continuous execution time length is longer than the time upper threshold of the task holding time threshold interval, sequentially executing the tasks to be executed in the waiting queue according to the sequence of the enqueue time.
Optionally, the sequentially executing the tasks to be executed in the waiting queue according to the sequence of the enqueuing time includes:
Sequentially executing all tasks in the waiting queue according to the sequence of the enqueue time; or selecting at most a preset number of tasks to be executed from the waiting queue according to the sequence of the enqueuing time, and sequentially executing the tasks to be executed; or sequentially executing the tasks to be executed in the waiting queue according to the sequence of the enqueuing time until the suspension time of the current operation task is greater than a preset time suspension threshold or all the tasks in the waiting queue are executed to be completed.
Optionally, the method further comprises:
The method comprises the steps of pre-configuring priority levels of a read operation task, a write operation task and an erase operation task, wherein the priority levels of the tasks are the read operation task, the write operation task and the erase operation task in sequence from high to low;
the task holding time threshold intervals corresponding to the writing operation task and the erasing operation task are different.
Optionally, the acquiring a task holding time threshold interval matched with the current operation task includes:
Acquiring a preset task holding time threshold interval and the number of times that a current operation task is suspended;
And dynamically adjusting the time upper limit threshold and/or the time lower limit threshold of the task holding time threshold interval according to the times according to a preset adjustment strategy, wherein the adjustment strategy comprises that the time upper limit threshold and the time lower limit threshold are both increased along with the increase of the times of pauses, and the interval range between the time upper limit threshold and the time lower limit threshold is increased along with the increase of the times of pauses.
Optionally, the method further comprises:
Dynamically adjusting the time upper limit threshold and/or the time lower limit threshold of the task holding time threshold interval by adopting the following calculation model, wherein the method comprises the following steps:
tu=n2tl
Wherein t l is a time lower threshold, t u is a time upper threshold, a, b, n 1、n2 are preset coefficients, S is the number of times the current operation task is suspended, Is rounded upward.
In a second aspect, the present invention further provides an apparatus for optimizing task scheduling of an SSD device, the apparatus comprising:
the first acquisition module is used for acquiring continuous execution time length of the current operation task when receiving a target task with higher priority than the priority level of the current operation task in the process of executing the operation task by the SSD device;
the second acquisition module is used for acquiring a task holding time threshold interval matched with the current operation task;
The control module is used for distributing the target task to a waiting queue and continuously executing the current operation task when the continuous execution duration belongs to the time range corresponding to the task holding time threshold interval;
The control module is further configured to suspend a current operation task and start executing the target task when the continuous execution time is longer than a time upper threshold of the task holding time threshold interval or is shorter than a time lower threshold of the task holding time threshold interval.
Optionally, the second obtaining module includes:
The acquisition unit is used for acquiring a preset task holding time threshold interval and the number of times that the current operation task is suspended;
The adjusting unit is used for dynamically adjusting the time upper limit threshold and/or the time lower limit threshold of the task holding time threshold interval according to the times according to a preset adjusting strategy, wherein the adjusting strategy comprises that the time upper limit threshold is increased along with the increase of the times of pauses, and the time lower limit threshold is reduced along with the increase of the times of pauses.
In a third aspect, the present invention also provides a storage device comprising a storage controller and NAND FLASH, the storage controller comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the method of optimizing task scheduling for an SSD device as described above when the computer program is executed.
According to the method, the device and the storage device for optimizing task scheduling of the SSD device, a task holding time threshold interval is determined through the time upper limit threshold and the time lower limit threshold, and accordingly time for suspending a current operation task is determined, on one hand, when high-priority operation arrives, if the continuous execution duration of the current operation task is judged to meet the condition smaller than the time lower limit threshold or is judged to be greater than the time upper limit threshold, the high-priority operation task can be timely executed through suspending the current operation task, on the other hand, if the continuous execution duration of the current operation task belongs to a time range corresponding to the task holding time threshold interval, namely, the time interval for suspending the current operation is properly prolonged, and the current operation task is continuously executed. The invention can avoid frequently interrupting the current operation task, can effectively execute the suspension request on the current operation task by adjusting the strategy of suspending the execution of the current operation task, ensures that the time delay of the high-priority operation task is distributed in a desired range, avoids the occurrence of ultra-long time delay, achieves better and more stable time delay performance, and effectively improves the user experience.
The foregoing description is only an overview of the present invention, and is intended to be implemented in accordance with the teachings of the present invention in order that the same may be more clearly understood and to make the same and other objects, features and advantages of the present invention more readily apparent.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to designate like parts throughout the figures. In the drawings:
FIG. 1 is a flowchart of a method for optimizing task scheduling in SSD devices according to an embodiment of the present invention;
FIG. 2 is a system block diagram of a system for optimizing task scheduling in SSD devices according to an embodiment of the present invention;
FIG. 3 is a schematic diagram showing the implementation effect of task scheduling by presetting a time threshold;
FIG. 4 is a schematic diagram showing the implementation effect of task scheduling by dynamically adjusting a time threshold;
Fig. 5 is a block diagram of an apparatus for optimizing task scheduling of an SSD device according to an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
As used herein, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless expressly stated otherwise, as understood by those skilled in the art. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It will be understood by those skilled in the art that all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs unless defined otherwise. It will be further understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the prior art and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein.
FIG. 1 schematically illustrates a flow chart of a method of optimizing task scheduling for SSD devices in accordance with one embodiment of the present invention. Referring to fig. 1, the method for optimizing task scheduling of SSD device according to an embodiment of the invention specifically includes the following steps:
S11, when a target task with a higher priority than the priority level of the current operation task is received in the process of executing the operation task by the SSD device, acquiring the continuous execution duration of the current operation task.
The system for optimizing task scheduling of an SSD device according to the present invention includes three components, as shown in fig. 2, including an SSD storage controller (controller) as a host server (hoSt) that receives and executes host commands, and a data storage area NAND FLASH. The invention provides a method for optimizing task scheduling of SSD equipment, which belongs to a processing optimization method in a controller.
S12, acquiring a task holding time threshold interval matched with the current operation task.
In this embodiment, a task holding time threshold interval corresponding to the write operation and the erase operation may be set in advance. The task holding time threshold intervals corresponding to the writing operation and the erasing operation can be the same or flexibly set according to application scenes, and the invention is not limited to the above.
The task hold time threshold interval is a time range determined by two thresholds, an upper time threshold and a lower time threshold. In actual application, a task holding time threshold interval matched with the current operation task can be acquired according to the type of the currently executed operation task with low priority.
And S13, if the continuous execution duration belongs to the time range corresponding to the task holding time threshold interval, distributing the target task to a waiting queue, and continuing to execute the current operation task.
And S14, if the continuous execution time is longer than the upper time threshold value of the task holding time threshold value interval or is smaller than the lower time threshold value of the task holding time threshold value interval, suspending the current operation task and starting to execute the target task.
According to the method for optimizing task scheduling of SSD equipment, a task holding time threshold interval is determined through the two thresholds of the time upper limit threshold and the time lower limit threshold, and accordingly time for suspending a current operation task is determined, on one hand, when high-priority operation arrives, if the condition that the continuous execution duration of the current operation task is smaller than the time lower limit threshold or larger than the time upper limit threshold is judged, the high-priority operation task can be timely executed through suspending the current operation task, on the other hand, if the continuous execution duration of the current operation task belongs to a time range corresponding to the task holding time threshold interval, namely, falls in a time range which is larger than or equal to the time lower limit threshold and smaller than or equal to the time upper limit time threshold, the time interval for suspending the current operation task is properly prolonged, and the current operation task is continuously executed. The invention can avoid frequently interrupting the current operation task, can effectively execute the suspension request on the current operation task by adjusting the strategy of suspending the execution of the current operation task, ensures that the time delay of the high-priority operation task is distributed in a desired range, avoids the occurrence of ultra-long time delay, achieves better and more stable time delay performance, and effectively improves the user experience.
The embodiment of the invention pre-configures the priority levels of the read operation task, the write operation task and the erase operation task, wherein the priority levels of the tasks are sequentially the read operation task, the write operation task and the erase operation task from high to low; the task holding time threshold intervals corresponding to the writing operation task and the erasing operation task are different.
The operation task types of NAND FLASH related by the invention are sequentially as follows from high to low: read operation, write operation, erase operation. If the current operation task is an erasing operation, the high-priority task is a reading operation and a writing operation, and the low-priority task is an erasing operation; if the current operation is a write operation, the high priority task is a read operation and the low priority task is a write operation and an erase operation. In this embodiment, the current operation task is taken as an example of an erase operation, and the write operation is consistent with the erase operation in execution steps, which are not described herein.
The invention monitors the execution state of the current execution operation task of the SSD, such as writing operation or erasing operation, when receiving the operation with high priority, decides whether to suspend the current operation and insert the operation with high priority or delay to suspend the current operation and insert the operation with high priority after waiting for a certain time according to the execution state, thereby optimizing the delay performance of the SSD.
In the embodiment of the present invention, the step S11 of obtaining the continuous execution duration of the current operation task specifically includes the following steps: acquiring a first time value when the target task is received; and acquiring a time difference value between the starting time value of the current operation task and the first time value, and taking the time difference value as the continuous execution duration of the current operation task. The starting time value of the current operation task comprises a time value of starting to execute the current operation task for the first time or a time value of resuming to execute the current operation task last time.
When scheduling operation with lower priority, if receiving operation task with higher priority, recording current time value t when receiving operation task with higher priority, and calculating time difference from time of starting to execute current operation task or last resume to execute current operation task to current time value t, and recording as delta t=t-t , wherein t represents time value of starting to execute current operation task or last resume to execute current operation task.
In an embodiment of the present invention, after the target task is allocated to the waiting queue, the method further includes: and monitoring the continuous execution time length of the current operation task in real time, and when the continuous execution time length is longer than the time upper threshold of the task holding time threshold interval, sequentially executing the tasks to be executed in the waiting queue according to the sequence of the enqueue time.
Further, the sequentially executing the tasks to be executed in the waiting queue according to the sequence of the enqueuing time specifically includes: sequentially executing all tasks in the waiting queue according to the sequence of the enqueue time; or selecting at most a preset number of tasks to be executed from the waiting queue according to the sequence of the enqueuing time, and sequentially executing the tasks to be executed; or sequentially executing the tasks to be executed in the waiting queue according to the sequence of the enqueuing time until the suspension time of the current operation task is greater than a preset time suspension threshold or all the tasks in the waiting queue are executed to be completed.
In an alternative embodiment of the present invention, the acquiring a task hold time threshold interval matched with the current operation task in step S12 includes: and directly acquiring a preset task holding time threshold interval of the current operation task.
The present invention will be described in detail with reference to the following examples. In this embodiment, the present operation task is taken as an example of an erasing operation, and specific operation steps are as follows:
1. the preset decision threshold, namely a task holding time threshold interval, comprises a time lower limit threshold and a time upper limit threshold, which are respectively marked as t l and t u.
2. When the erasing operation is scheduled, if the operation with higher priority comes, the current time value t is recorded, the difference between the time when the erasing operation starts to be executed or the last time the erasing operation is resumed to be executed and the current time is calculated and is recorded as delta t=t-t , and the continuous execution duration delta t of the current operation task is obtained.
3. If the continuous execution duration of the current operation task meets the condition: Δt < t l or Δt > t u, then the currently executing erase operation is suspended, and the higher priority operation is performed instead. Namely, a suspension request is initiated to the current erasing operation, the current erasing operation is suspended, operation execution with higher priority is inserted, and after a certain number of operations with high priority are executed, the current erasing operation is resumed.
4. If the continuous execution duration of the current operation task meets the condition: t l≤Δt≤tu, the current erase operation task is continued, and the operation task with high priority is allocated to the waiting queue.
5. If there is a high priority operation task in the wait queue and the condition Δt > t u is satisfied, it is indicated that the current erase operation has been performed long enough so that the high priority operation has not been performed for a longer period of time, and its latency has risen. Then suspending the current operation, dequeuing the operation with high priority from the queue, executing the operation, waiting for the execution of a certain number of operations with high priority, and resuming the execution of the current erasing operation.
As shown in fig. 3, the effect of performing task scheduling by presetting a time threshold is shown by taking an erase operation as an example, and the effect of writing operation is consistent with the erase operation. It can be seen that by the preset two time thresholds t l and t u, the time interval during which the current operation being performed is suspended is controlled to be within the two ranges of greater than t u and less than t l, and suspension of less than t l is used to respond to most high priority commands in time, while when the time is between t l and t u, the time interval during which the current operation is suspended is suitably lengthened by delaying the suspension until t u. The invention avoids frequently interrupting the current operation to the upper limit, and the current writing operation or erasing operation is completed for a longer time at the moment, so that the operation with high priority cannot be inserted and executed by suspending the current writing operation or erasing operation. In this way, the delay of the high priority operation is controlled within a reasonable range, so as to optimize the delay performance of the SSD.
In the embodiment, by recording the continuous execution time of a low-priority operation task currently executed by the SSD, such as a writing operation or an erasing operation, when a high-priority operation task is received, determining whether to suspend the current operation and insert the high-priority operation by comparing the low-priority operation task with the time upper limit threshold and the time lower limit threshold of the set task holding time threshold interval; or continuing the current operation, suspending the current operation after waiting for a period of time, and inserting the operation with high priority, so that the time delay of the task with high priority is distributed in a desired range, and the occurrence of ultra-long time delay is avoided, thereby achieving better and more stable time delay performance and effectively improving the user experience.
In another alternative embodiment of the present invention, the acquiring a task hold time threshold interval matched with the current operation task in step S12 includes: acquiring a preset task holding time threshold interval and the number of times that a current operation task is suspended; and dynamically adjusting the time upper limit threshold and/or the time lower limit threshold of the task holding time threshold interval according to the times according to a preset adjustment strategy. The adjustment strategy comprises that both the time upper limit threshold and the time lower limit threshold are increased along with the increase of the pause times, and the interval range between the time upper limit threshold and the time lower limit threshold is increased along with the increase of the pause times. The embodiment of the invention is suitable for optimizing the time delay of the high-priority task and reducing the negative influence of the suspension operation of the solid state disk. According to the method and the device, the time threshold is dynamically adjusted according to the times of the pausing of the currently executed low-priority operation task, namely the time window allowing the pausing of the current operation is dynamically adjusted, and whether the low-priority task is paused or not is determined according to the adjusted time threshold, so that the time delay of the task is optimized, frequent pausing is avoided, and the time delay of the high-priority task is optimized, and meanwhile, the effective execution of the low-priority task is ensured.
The present invention will be described in detail with reference to another embodiment. In this embodiment, the present operation task is taken as an example of an erasing operation, and specific operation steps are as follows:
1. A decision threshold, namely a task holding time threshold interval and an adjustment strategy are preset. The task holding time threshold interval comprises a time lower limit threshold and a time upper limit threshold which are respectively marked as t l and t u; the adjustment strategy comprises a calculation function model of a time upper limit threshold and a time lower limit threshold, wherein the calculation function model of the time upper limit threshold represents a positive proportion relation, and the calculation function model of the time lower limit threshold represents an inverse proportion relation.
Wherein, the calculation function model of the time lower threshold is selected as follows:
wherein, the calculation function model of the time upper limit threshold value can be selected as follows:
tu=n2tl
Wherein t l is a time lower threshold, t u is a time upper threshold, a, b, n 1、n2 are preset coefficients, S is the number of times the current operation task is suspended, Is rounded upward.
Further, expressed in a set, the selectable value range of a is [100, 1000]; the selectable value range of b may be [0.1,0.2]; the value range of n 1、n2 can be selected as {2,4,8} and {2,4} respectively, and can be replaced by shift operation in the implementation process, so that the calculation cost is reduced.
2. When the erase operation is scheduled, if an operation task of higher priority arrives, the current time value t is recorded, and the time value t at which the erase operation starts to be performed or the execution of the erase operation resumes last time is initialized, and the number of times the current low-priority task is suspended is recorded as s=0.
3. In the execution process of the low-priority task, if the high-priority task is received, the current time upper limit threshold and the current time lower limit threshold are required to be adjusted according to the calculation function model; and calculating a time difference value from the time t when the erasing operation starts to be executed or the erasing operation resumes to be executed last time to the current time value t according to the current time value t, and recording the time difference value as delta t=t-t to obtain a continuous execution duration delta t of the current operation task.
4. If the continuous execution duration of the current operation task meets the condition: Δt < t l or Δt > t u, a pause request is initiated for the current low-priority task, and after the low-priority task is paused, the high-priority task is executed. After the execution of the task with high priority is finished, the execution of the task with low priority is resumed, and the suspension times S=S+1 of the task with low priority is updated, and the updated time value t is the current time.
5. If the continuous execution duration of the current operation task meets the condition: and t l≤Δt≤tu, continuing to execute the current erasing operation task, and distributing the operation task with high priority into a waiting queue until the next time the high-priority task needs to be processed, and returning to execute the step 3.
6. If there is a high priority operation task in the wait queue and the condition Δt > t u is satisfied, it is indicated that the current erase operation has been performed long enough so that the high priority operation has not been performed for a longer period of time, and its latency has risen. Then suspending the current operation, dequeuing the operation with high priority from the queue, executing the operation, waiting for the execution of a certain number of operations with high priority, and resuming the execution of the current erasing operation.
As shown in fig. 4, the implementation effect of task scheduling by dynamically adjusting the time threshold is shown. It can be seen that when the number of times that the current low-priority task is suspended is small, a judgment is made when the high-priority task is received, and if the condition is met, the current low-priority task is suspended, and the high-priority task is inserted and executed; and as the number of times the current low priority task is suspended increases, the time threshold is dynamically adjusted continuously, the upper threshold increases as the number of times the task is suspended increases, and the lower threshold decreases as the number of times the task is suspended increases. At this time, the high priority task may not be immediately executed, but rather the current low priority task is suspended and the high priority task in the queue is executed after a given upper time threshold is exceeded. Therefore, the time delay of the high-priority task can be ensured when the number of times that the current low-priority task is suspended is small; and when the current low-priority task is paused for a plurality of times, the execution of the high-priority task is properly delayed, so that the low-priority task is ensured to be effectively processed.
The embodiment of the invention dynamically adjusts the time threshold by monitoring the times of executing the pause operation by the current low-priority task, thereby determining whether to pause the current low-priority task. Compared with the method that a fixed check point which is not changed along with the change of the suspension times is preset, in the method that the check point decides whether to suspend the current low-priority task according to whether the high-priority task exists or not, the method and the device can dynamically adjust the time threshold according to the state of the current low-priority task in real time, and the time threshold can be increased or decreased along with the suspension times of the current low-priority task, so that the time window of the high-priority task for suspending the low-priority task is dynamically adjusted. By means of the strategy, a better time delay effect of the high-priority tasks is achieved, and effective execution of the low-priority tasks is guaranteed.
For the purposes of simplicity of explanation, the methodologies are shown and described as a series of acts, it is to be understood and appreciated by one of ordinary skill in the art that the methodologies are not limited by the order of acts, as some acts may, in accordance with the methodologies, take place in other order or concurrently. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred embodiments, and that the acts are not necessarily required by the embodiments of the invention.
In addition, the embodiment of the invention also provides a device for optimizing the task scheduling of the SSD device, which comprises a functional module for realizing the method for optimizing the task scheduling of the SSD device. FIG. 5 schematically illustrates a block diagram of an apparatus for optimizing task scheduling for SSD devices in accordance with one embodiment of the present invention. Referring to fig. 5, an apparatus for optimizing task scheduling of an SSD device according to an embodiment of the invention specifically includes a first obtaining module 201, a second obtaining module 202, and a control module 203, where:
The first obtaining module 201 is configured to obtain, when a target task with a priority higher than a priority level of a current operation task is received during execution of the operation task by the SSD device, a continuous execution duration of the current operation task;
a second obtaining module 202, configured to obtain a task holding time threshold interval that is matched with a current operation task;
The control module 203 is configured to allocate the target task to a waiting queue and continue to execute a current operation task when the continuous execution duration belongs to a time range corresponding to the task holding time threshold interval;
The control module 203 is further configured to suspend a current operation task and start executing the target task when the continuous execution time is longer than a time upper threshold of the task holding time threshold interval or is smaller than a time lower threshold of the task holding time threshold interval.
Further, the first obtaining module 201 is specifically configured to obtain a first time value when the target task is received; acquiring a time difference value between a starting time value of a current operation task and the first time value, and taking the time difference value as continuous execution duration of the current operation task; the starting time value of the current operation task comprises a time value of starting to execute the current operation task for the first time or a time value of resuming to execute the current operation task last time.
Further, the control module 203 is further configured to monitor, in real time, a continuous execution duration of the current operation task after the target task is allocated to the waiting queue, and sequentially execute the tasks to be executed in the waiting queue according to a sequence of enqueuing time when the continuous execution duration is greater than a time upper threshold of the task holding time threshold interval.
Further, the device also comprises a configuration module, which is used for pre-configuring the priority levels of the read operation task, the write operation task and the erase operation task, wherein the priority levels of the tasks are the read operation task, the write operation task and the erase operation task in sequence from high to low. The task holding time threshold intervals corresponding to the writing operation task and the erasing operation task may be different.
In the embodiment of the present invention, the second obtaining module 202 specifically includes an obtaining unit and an adjusting unit, where:
The acquisition unit is used for acquiring a preset task holding time threshold interval and the number of times that the current operation task is suspended;
And the adjusting unit is used for dynamically adjusting the time upper limit threshold and/or the time lower limit threshold of the task holding time threshold interval according to the times according to a preset adjusting strategy. Wherein the adjustment strategy comprises that the time upper threshold value is increased along with the increase of the pause times, and the time lower threshold value is decreased along with the increase of the pause times.
Further, the adjusting unit is specifically configured to dynamically adjust the upper time threshold and/or the lower time threshold of the task holding time threshold interval by using the following calculation model, and includes:
tu=n2tl
Wherein t l is a time lower threshold, t u is a time upper threshold, a, b, n 1、n2 are preset coefficients, S is the number of times the current operation task is suspended, Is rounded upward.
For the device embodiment, since it is substantially similar to the method embodiment, the description is relatively simple, and the relevant points refer to the part of the description of the method embodiment, and have corresponding technical effects.
In addition, the embodiment of the invention also provides a computer readable storage medium, on which a computer program is stored, the computer program being executed by a processor to implement the steps of the method for optimizing task scheduling of SSD device.
In this embodiment, the method for optimizing task scheduling of SSD device may be stored in a computer readable storage medium if implemented in the form of a software functional unit and sold or used as a separate product. Based on such understanding, the present invention may implement all or part of the flow of the method of the above embodiment, or may be implemented by a computer program to instruct related hardware, where the computer program may be stored in a computer readable storage medium, and when the computer program is executed by a processor, the computer program may implement the steps of each of the method embodiments described above. Wherein the computer program comprises computer program code which may be in source code form, object code form, executable file or some intermediate form etc. The computer readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM), a random access Memory (RAM, random AcceSS Memory), an electrical carrier signal, a telecommunications signal, a software distribution medium, and so forth. It should be noted that the computer readable medium contains content that can be appropriately scaled according to the requirements of jurisdictions in which such content is subject to legislation and patent practice, such as in certain jurisdictions in which such content is subject to legislation and patent practice, the computer readable medium does not include electrical carrier signals and telecommunication signals.
In addition, an embodiment of the present invention further provides a storage device, including a storage controller and NAND FLASH, where the storage controller includes a memory, a processor, and a computer program stored on the memory and capable of running on the processor, where the processor implements the steps of the method for optimizing task scheduling of an SSD device as described above when the processor executes the computer program. For example, steps S11 to S14 shown in fig. 1. Or the processor, when executing the computer program, implements the functions of each module/unit in the above-mentioned apparatus embodiment for optimizing task scheduling of an SSD device, for example, the first acquisition module 201, the second acquisition module 202, and the control module 203 shown in fig. 5.
In one particular embodiment, the storage device may be an SSD device.
According to the method, the device and the storage device for optimizing task scheduling of the SSD device, a task holding time threshold interval is determined through the time upper limit threshold and the time lower limit threshold, and accordingly time for suspending a current operation task is determined, on one hand, when high-priority operation arrives, if the continuous execution duration of the current operation task is judged to meet the condition smaller than the time lower limit threshold or is judged to be greater than the time upper limit threshold, the high-priority operation task can be timely executed through suspending the current operation task, on the other hand, if the continuous execution duration of the current operation task belongs to a time range corresponding to the task holding time threshold interval, namely, the time interval for suspending the current operation is properly prolonged, and the current operation task is continuously executed. The invention can avoid frequently interrupting the current operation task, can effectively execute the suspension request on the current operation task by adjusting the strategy of suspending the execution of the current operation task, ensures that the time delay of the high-priority operation task is distributed in a desired range, avoids the occurrence of ultra-long time delay, achieves better and more stable time delay performance, and effectively improves the user experience.
Further, the method, the device and the storage device for optimizing task scheduling of the SSD device can dynamically adjust the time upper limit threshold and/or the time lower limit threshold according to the execution state of the current low-priority task, so that the time window for suspending the low-priority task by the high-priority task is dynamically adjusted, a better time delay effect of the high-priority task can be achieved, and effective execution of the low-priority task can be guaranteed.
Furthermore, those skilled in the art will appreciate that while some embodiments herein include some features but not others included in other embodiments, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, any of the claimed embodiments can be used in any combination.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and are not limiting; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims (10)

1. A method of optimizing task scheduling for an SSD device, the method comprising:
When a target task with a higher priority than the priority level of the current operation task is received in the process of executing the operation task by the SSD device, acquiring the continuous execution time length of the current operation task;
acquiring a task holding time threshold interval matched with a current operation task;
If the continuous execution duration belongs to the time range corresponding to the task holding time threshold interval, the target task is distributed to a waiting queue, and the current operation task is continuously executed;
And if the continuous execution time is longer than the time upper limit threshold of the task holding time threshold interval or is smaller than the time lower limit threshold of the task holding time threshold interval, suspending the current operation task and starting to execute the target task.
2. The method of claim 1, wherein the obtaining the continuous execution duration of the current operation task comprises:
Acquiring a first time value when the target task is received;
acquiring a time difference value between a starting time value of a current operation task and the first time value, and taking the time difference value as continuous execution duration of the current operation task;
the starting time value of the current operation task comprises a time value of starting to execute the current operation task for the first time or a time value of resuming to execute the current operation task last time.
3. The method of claim 1, wherein after assigning the target task to a wait queue, the method further comprises:
And monitoring the continuous execution time length of the current operation task in real time, and when the continuous execution time length is longer than the time upper threshold of the task holding time threshold interval, sequentially executing the tasks to be executed in the waiting queue according to the sequence of the enqueue time.
4. A method according to claim 3, wherein sequentially executing the tasks to be executed in the waiting queue according to the order of enqueue time comprises:
Sequentially executing all tasks in the waiting queue according to the sequence of the enqueue time; or selecting at most a preset number of tasks to be executed from the waiting queue according to the sequence of the enqueuing time, and sequentially executing the tasks to be executed; or sequentially executing the tasks to be executed in the waiting queue according to the sequence of the enqueuing time until the suspension time of the current operation task is greater than a preset time suspension threshold or all the tasks in the waiting queue are executed to be completed.
5. The method according to claim 1, wherein the method further comprises:
The method comprises the steps of pre-configuring priority levels of a read operation task, a write operation task and an erase operation task, wherein the priority levels of the tasks are the read operation task, the write operation task and the erase operation task in sequence from high to low;
the task holding time threshold intervals corresponding to the writing operation task and the erasing operation task are different.
6. The method of any of claims 1-5, wherein the obtaining a task hold time threshold interval that matches a current operational task comprises:
Acquiring a preset task holding time threshold interval and the number of times that a current operation task is suspended;
And dynamically adjusting the time upper limit threshold and/or the time lower limit threshold of the task holding time threshold interval according to the times according to a preset adjustment strategy, wherein the adjustment strategy comprises that the time upper limit threshold and the time lower limit threshold are both increased along with the increase of the times of pauses, and the interval range between the time upper limit threshold and the time lower limit threshold is increased along with the increase of the times of pauses.
7. The method of claim 6, wherein the method further comprises:
Dynamically adjusting the time upper limit threshold and/or the time lower limit threshold of the task holding time threshold interval by adopting the following calculation model, wherein the method comprises the following steps:
tu=n2tl
Wherein t l is a time lower threshold, t u is a time upper threshold, a, b, n 1、n2 are preset coefficients, S is the number of times the current operation task is suspended, Is rounded upward.
8. An apparatus for optimizing task scheduling for an SSD device, the apparatus comprising:
the first acquisition module is used for acquiring continuous execution time length of the current operation task when receiving a target task with higher priority than the priority level of the current operation task in the process of executing the operation task by the SSD device;
the second acquisition module is used for acquiring a task holding time threshold interval matched with the current operation task;
The control module is used for distributing the target task to a waiting queue and continuously executing the current operation task when the continuous execution duration belongs to the time range corresponding to the task holding time threshold interval;
The control module is further configured to suspend a current operation task and start executing the target task when the continuous execution time is longer than a time upper threshold of the task holding time threshold interval or is shorter than a time lower threshold of the task holding time threshold interval.
9. The apparatus of claim 8, wherein the second acquisition module comprises:
The acquisition unit is used for acquiring a preset task holding time threshold interval and the number of times that the current operation task is suspended;
The adjusting unit is used for dynamically adjusting the time upper limit threshold and/or the time lower limit threshold of the task holding time threshold interval according to the times according to a preset adjusting strategy, wherein the adjusting strategy comprises that the time upper limit threshold is increased along with the increase of the times of pauses, and the time lower limit threshold is reduced along with the increase of the times of pauses.
10. A storage device comprising a storage controller and NAND FLASH, the storage controller comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the method according to any one of claims 1-7 when the computer program is executed.
CN202410113669.5A 2024-01-26 2024-01-26 Method and device for optimizing task scheduling of SSD (solid State disk) device and storage device Pending CN118012342A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410113669.5A CN118012342A (en) 2024-01-26 2024-01-26 Method and device for optimizing task scheduling of SSD (solid State disk) device and storage device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410113669.5A CN118012342A (en) 2024-01-26 2024-01-26 Method and device for optimizing task scheduling of SSD (solid State disk) device and storage device

Publications (1)

Publication Number Publication Date
CN118012342A true CN118012342A (en) 2024-05-10

Family

ID=90942209

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410113669.5A Pending CN118012342A (en) 2024-01-26 2024-01-26 Method and device for optimizing task scheduling of SSD (solid State disk) device and storage device

Country Status (1)

Country Link
CN (1) CN118012342A (en)

Similar Documents

Publication Publication Date Title
US11467769B2 (en) Managed fetching and execution of commands from submission queues
US7702824B2 (en) Computer system and method for performing low impact backup operations
US8799913B2 (en) Computing system, method and computer-readable medium for managing a processing of tasks
US8136113B2 (en) Method and apparatus for adjusting sleep time of fixed high-priority threads
CN106681661B (en) Read-write scheduling method and device in solid state disk
US11093352B2 (en) Fault management in NVMe systems
US20050028160A1 (en) Adaptive scheduler for anytime tasks
EP2884396A1 (en) Storage control apparatus, storage control program, and storage control method
GB2540809A (en) Task scheduling
US10908839B2 (en) Storage device throttling amount of communicated data depending on suspension frequency of operation
CN112799606B (en) Scheduling method and device of IO (input/output) request
CN110209502B (en) Information storage method and device, electronic equipment and storage medium
US10915446B2 (en) Prefetch confidence and phase prediction for improving prefetch performance in bandwidth constrained scenarios
CN108874324B (en) Access request processing method, device, equipment and readable storage medium
US10474383B1 (en) Using overload correlations between units of managed storage objects to apply performance controls in a data storage system
US20190369919A1 (en) Task management method and host for electronic storage device
CN110674064B (en) Data transmission method, device, equipment and computer readable storage medium
US7783797B2 (en) Adaptive bandwidth distribution system for high-performance input/output devices with variable throughput
CN113687943A (en) Method, device and equipment for dynamically adjusting disk scheduling strategy
CN111782396B (en) Concurrency elastic control method based on distributed database
CN118012342A (en) Method and device for optimizing task scheduling of SSD (solid State disk) device and storage device
US11481341B2 (en) System and method for dynamically adjusting priority-based allocation of storage system resources
CN109582460B (en) Redis memory data elimination method and device
CN118012343A (en) Method and device for controlling read-write operation of solid state disk and solid state disk
CN110727518B (en) Data processing method and related equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination