[go: up one dir, main page]

CN117769699A - Control method and device of storage device - Google Patents

Control method and device of storage device Download PDF

Info

Publication number
CN117769699A
CN117769699A CN202180100197.4A CN202180100197A CN117769699A CN 117769699 A CN117769699 A CN 117769699A CN 202180100197 A CN202180100197 A CN 202180100197A CN 117769699 A CN117769699 A CN 117769699A
Authority
CN
China
Prior art keywords
time period
storage space
burst
traffic
burst traffic
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
CN202180100197.4A
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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Publication of CN117769699A publication Critical patent/CN117769699A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses a control method and a device of a storage device, wherein the storage device comprises a controller and a storage array, the method is applied to the controller, and the method comprises the following steps: when the existence of the burst traffic in the first time period is predicted, increasing bandwidth resources allocated to the garbage collection GC operation before the first time period; the burst traffic contains a first number of data processing requests, the first number being greater than the number of data processing requests that the storage device can respond to per second; and executing the GC operation by using the first bandwidth resource to obtain a first available storage space in the storage array, wherein the first bandwidth resource is the bandwidth resource allocated to the GC operation. In the scheme, GC operation is quickened before the burst flow arrives, more available storage space can be obtained, more available storage space in the storage device can be ensured to be used for responding to the burst flow when the burst flow arrives, and further the stability of the storage device and the input/output IO response speed are improved.

Description

Control method and device of storage device Technical Field
The present disclosure relates to the field of storage technologies, and in particular, to a method and an apparatus for controlling a storage device.
Background
Solid State Disks (SSDs) are now widely used in a variety of storage scenarios, such as servers, data centers, embedded devices, and the like.
The SSD is equipped with a garbage collection GC (garbage collection, GC) algorithm. The GC algorithm is used to garbage collect the storage space of the stored data when the available space (i.e., the empty space) in the SSD storage space is less than a threshold (referred to as the GC watermark), thereby freeing some storage space.
When a user request (IO) is issued to the SSD, the SSD needs a certain time to respond to the IO, and when the response time exceeds a user tolerance threshold (such as 1 s), the user experience is affected. The response time of the IO is the total time from the beginning of IO issuing to the time when the IO is processed, and the response time comprises the time of waiting to be processed of the IO in addition to the time of flash memory processing. When the SSD continues to stabilize the response to the received IO, the number of IOPS processed per second by the SSD is referred to as the disk capability. Generally, the disk capacity of an SSD will be less than its maximum capacity due to the resources occupied by the GC.
Currently, in SSD control, resources used by a GC vary with resources used by an IO response, and when the resources used by the IO response are large, the resources allocated to the GC are large, and when the resources used by the IO response are small, the resources allocated to the GC are small. When the IO access amount is smaller, resources and storage space required by the SSD for responding to the IO and the storage space occupied by the generated garbage are smaller, and the GC can maintain the relative stability of the storage space occupied by the IO for responding to the IO and the storage space released by the GC by using fewer resources. Therefore, when the IO access amount is smaller than the disc capacity (called conventional flow), the SSD can finish the execution of the IO on time, and meanwhile, the GC can be normally executed, so that a stable available storage space is maintained. However, when the amount of IO access exceeds the disk capacity (referred to as burst traffic), the resources required and the consumed memory space for handling the IO are greatly increased in a short time. On the one hand, the GC may not be able to timely recover enough storage space in a short time, so that the relative stability between the storage space occupied by the IO response and the storage space released by the GC may be broken, and even the storage space may be consumed by the IO response process, which affects the stability of the storage system. On the other hand, the GC also needs to use more resources to accelerate the speed of releasing the storage space, so as to release more storage space for the IO response as much as possible, which can cause resource contention in the GC and the IO response process, affect the speed of the IO response, and possibly cause the problem of timeout of the IO response.
Disclosure of Invention
The application provides a control method and device of a storage device, which are used for improving the stability and IO response speed of the storage device by controlling the resource allocation and execution of garbage collection GC operation in the storage device.
In a first aspect, the present application provides a method for controlling a storage device, where the storage device includes a controller and a storage array, the method being applied to the controller, the method including: when burst traffic is predicted to exist in a first period of time, increasing bandwidth resources allocated to garbage collection GC operations prior to the first period of time; wherein the burst traffic contains a first number of data processing requests, the first number being greater than the number of data processing requests that the storage device can respond to per second; and executing the GC operation by using a first bandwidth resource to obtain a first available storage space in the storage array, wherein the first bandwidth resource is a bandwidth resource allocated to the GC operation.
In the method, when the controller of the storage device predicts the burst flow, the execution speed of the GC operation can be increased by increasing the bandwidth resources allocated to the GC operation before the burst flow arrives, so that the GC operation can quickly recover more available storage space in a shorter time. The method can be used to prepare memory space in advance for responding to bursty traffic when bursty traffic is predicted. Therefore, when the burst flow arrives, more storage space in the storage device can be ensured to be used for responding to the burst flow, so that the excessive consumption of the available storage space is avoided and the stability of the storage device is improved while the higher response speed is ensured.
In one possible design, the method further comprises: and when the burst traffic is determined to exist, distributing the first available storage space to IO operation corresponding to the burst traffic.
In the method, when the burst traffic is determined to exist, the first available storage space obtained through GC operation advanced processing is distributed to the IO operation corresponding to the burst traffic, so that more storage space can be ensured to be used for the IO operation. On one hand, the storage space is sufficient, so that the execution speed of IO operation can be improved, and on the other hand, the excessive consumption of the available storage space can be avoided, and the stability of the storage device is improved.
In one possible design, when burst traffic is predicted to exist within the first time period, the method further includes: raising a start-up threshold of the GC operation; wherein the GC operation is initiated when the available storage space in the storage array is less than the initiation threshold.
In the method, by raising the starting threshold of the GC operation when the burst flow is predicted, the controller can obtain a larger available storage space by executing the GC operation, and can also ensure that the controller can maintain the obtained available storage space by executing the GC operation after obtaining the larger available storage space by executing the GC operation.
In one possible design, when burst traffic is predicted to exist within the first time period, the method further includes: determining a first target moment based on a storage space required by IO operation corresponding to the burst flow and the first bandwidth resource; when the first target moment arrives, the starting threshold value of the GC operation is increased; wherein the GC operation is initiated when the available storage space in the storage array is less than the initiation threshold.
According to the method, according to the storage space required by the IO operation corresponding to the burst flow and the bandwidth resource allocated to the GC operation, the time required by the GC operation processing to obtain the storage space can be determined, the time can be further used as a reference, the time for heightening the starting threshold of the GC operation can be more accurately determined, the starting threshold of the GC operation can be prevented from being heightened too early or too late, unnecessary GC operation is further reduced, the influence on the service life of a storage device is reduced, and the available storage space with enough size can be obtained through the GC operation for use when the burst flow arrives.
In one possible design, the method further comprises: when it is determined that the bursty traffic is present, lowering a start-up threshold of the GC operation; or if the predicted burst flow does not arrive at the second target time, reducing the starting threshold of the GC operation; wherein the second target time is any time within the first time period.
In the method, when the burst flow is determined to exist, the GC operation can be stopped by reducing the starting threshold of the GC operation, so that more bandwidth resources can be released for IO operation, the IO operation can respond to the burst flow timely and rapidly, and the problem of timeout of IO response is reduced or avoided. If the high start-up threshold of GC operation is maintained at all times in the absence of predicted burst traffic, the lifetime of the storage device may be affected by excessive and unnecessary GC operations. Thus, the startup threshold of the GC operation may be lowered upon determining that the predicted burst traffic is not coming, which may mitigate the impact on storage device lifetime.
In one possible design, the method further comprises: before determining that the burst traffic exists, when the first available storage space reaches a target value, allocating a second bandwidth resource to an IO operation corresponding to a current data processing request, and allocating a third bandwidth resource to the GC operation; the target value is larger than or equal to a storage space required by IO operation corresponding to the burst flow; the size of the second bandwidth resource has a positive correlation with the size of the available storage space in the storage array, and the size of the third bandwidth resource has a negative correlation with the size of the available storage space in the storage array.
In the method, when the available storage space in the storage array reaches a target value, the first available storage space obtained through GC operation is indicated to be enough for IO operation corresponding to the burst traffic. If the burst traffic is not determined to exist at this time, by allocating bandwidth resources with positive correlation with the available storage space for the IO operation and allocating bandwidth resources with negative correlation with the available storage space for the GC operation, consumption of the storage space can be quickened when the available storage space is too large, recovery of the available storage space can be slowed down, consumption of the storage space can be slowed down when the available storage space is too small, recovery of the storage space can be quickened, and accordingly the size of the available storage space can be kept relatively stable, and the burst traffic can be waited for.
In one possible design, the second bandwidth resource conforms to the following formula:
BW 1 =BW 2 ×S 1 /S th
wherein the BW is 1 For the second bandwidth resource, the BW 2 For the total bandwidth resources that the controller can use, the S 1 For the available storage space in the storage array, the S th Is a start threshold for the GC operation.
In the method, the accuracy of bandwidth resource allocation can be further improved by allocating the bandwidth resource with a proportional relation with the available storage space for IO operation, and the accuracy of controlling the storage device is further improved.
In one possible design, the target value is a sum of a first parameter that is a memory space required for the IO operation corresponding to the burst traffic and a second parameter that is an available memory space in the memory array when the burst traffic is predicted to exist within a first period of time.
In the method, the setting of the target value can ensure that a certain margin of available storage space can be maintained after the storage space required by IO operation corresponding to the burst flow is provided for the burst flow, so that the condition that the burst flow consumes the available storage space can be avoided, and the stability of a storage system is improved.
In one possible design, the storage space required for the IO operation corresponding to the burst traffic conforms to the following formula:
S 2 =BW 3 ×T
wherein the S is 2 For the storage space required by the IO operation corresponding to the burst traffic, the BW 3 And for transmitting the bandwidth resource required by the burst traffic, the T is the duration of the burst traffic.
According to the method, according to the bandwidth resource required by the transmission of the burst traffic and the duration of the burst traffic, the storage space required by IO operation corresponding to the burst traffic can be accurately calculated, and then the storage device is correspondingly controlled according to the storage space.
In one possible design, determining that the bursty traffic is present includes: after the second time period is over, determining that the burst traffic exists according to the data processing request in the second time period; the duration of the second time period is smaller than a set threshold value, and the ending time of the second time period is before the ending time of the first time period.
In the method, after the second time period is finished, based on the actual data processing request in the second time period, whether the burst traffic exists is judged, so that real-time traffic identification can be realized, and the accuracy is higher.
In one possible design, determining that the burst traffic exists according to the data processing request in the second period of time includes at least one of: determining that the total number of data processing requests within the second time period is greater than a set number threshold; determining that the total bandwidth of the data processing requests in the second time period is greater than a set bandwidth threshold; determining that an increment of the number of data processing requests within the second time period is greater than a set increment threshold; determining that the increase in the number of data processing requests within the second period of time is greater than a set increase threshold.
In this method, the characteristics of burst traffic are that the number of data processing requests involved is large and the number of data processing requests grows fast in a short time. Therefore, based on the information which can reflect the characteristics of the burst flow and is multiple in aspects, the data processing request in the second time period is analyzed, the burst flow can be more accurately identified, and therefore the burst flow can be more accurately controlled.
In one possible design, the presence of bursty traffic is predicted to occur during a first time period, comprising: predicting that burst traffic exists in the first time period according to the data processing request in the target historical time period by using a set traffic prediction model; wherein the flow prediction model is obtained through machine learning and/or model training; or predicting that the burst traffic exists in the first time period according to the burst traffic prediction information from the upper layer application; wherein the burst traffic prediction information is used for indicating: burst traffic is predicted to exist within the first time period.
In the method, the burst flow is predicted by using the set flow prediction model, so that the accuracy of burst flow prediction can be improved, and the method can be suitable for predicting burst flows in various different scenes and has good universality. The controller determines that the burst traffic is predicted according to the instruction from the upper layer application, and then the prediction process of the burst traffic can be transferred to the upper layer application, so that the processing flow of the controller is simplified, and the processing rate is improved.
In one possible design, the storage device is a solid state disk.
In a second aspect, the present application provides a control device of a storage device, the control device being applied to a controller in the storage device, wherein the storage device further comprises a storage array; the control device includes: the prediction module is used for predicting that burst traffic exists in the first time period; the processing module is used for increasing bandwidth resources allocated to GC operations before the first time period and executing the GC operations by utilizing the first bandwidth resources to obtain a first available storage space in the storage array; wherein the burst traffic contains a first number of data processing requests, the first number being greater than the number of data processing requests that the storage device can respond to per second; the first bandwidth resource is a bandwidth resource allocated to the GC operation.
In one possible design, the processing module is further configured to: and when the burst traffic is determined to exist, distributing the first available storage space to the input/output IO operation corresponding to the burst traffic.
In one possible design, when the prediction module predicts that there is bursty traffic within the first time period, the processing module is further to: raising a start-up threshold of the GC operation; wherein the GC operation is initiated when the available storage space in the storage array is less than the initiation threshold.
In one possible design, when the prediction module predicts that there is bursty traffic within the first time period, the processing module is further to: determining a first target moment based on a storage space required by IO operation corresponding to the burst flow and the first bandwidth resource; when the first target moment arrives, the starting threshold value of the GC operation is increased; wherein the GC operation is initiated when the available storage space in the storage array is less than the initiation threshold.
In one possible design, the processing module is further configured to: when it is determined that the bursty traffic is present, lowering a start-up threshold of the GC operation; or if the predicted burst flow does not arrive at the second target time, reducing the starting threshold of the GC operation; wherein the second target time is any time within the first time period.
In one possible design, the processing module is further configured to: before determining that the burst traffic exists, when the first available storage space reaches a target value, allocating a second bandwidth resource to an IO operation corresponding to a current data processing request, and allocating a third bandwidth resource to the GC operation; the target value is larger than or equal to a storage space required by IO operation corresponding to the burst flow; the size of the second bandwidth resource has a positive correlation with the size of the available storage space in the storage array, and the size of the third bandwidth resource has a negative correlation with the size of the available storage space in the storage array.
In one possible design, the second bandwidth resource conforms to the following formula:
BW 1 =BW 2 ×S 1 /S th
wherein the BW is 1 For the second bandwidth resource, the BW 2 For the total bandwidth resources that the controller can use, the S 1 For the available storage space in the storage array, the S th Is a start threshold for the GC operation.
In one possible design, the target value is a sum of a first parameter that is a memory space required for the IO operation corresponding to the burst traffic and a second parameter that is an available memory space in the memory array when the burst traffic is predicted to exist within a first period of time.
In one possible design, the storage space required for the IO operation corresponding to the burst traffic conforms to the following formula:
S 2 =BW 3 ×T
wherein the S is 2 For the storage space required by the IO operation corresponding to the burst traffic, the BW 3 And for transmitting the bandwidth resource required by the burst traffic, the T is the duration of the burst traffic.
In one possible design, the processing module, when determining that the bursty traffic is present, is specifically configured to: after the second time period is over, determining that the burst traffic exists according to the data processing request in the second time period; the duration of the second time period is smaller than a set threshold value, and the ending time of the second time period is before the ending time of the first time period.
In one possible design, the processing module is specifically configured to perform at least one of the following when it is determined that the bursty traffic exists according to the data processing request in the second time period: determining that the total number of data processing requests within the second time period is greater than a set number threshold; determining that the total bandwidth of the data processing requests in the second time period is greater than a set bandwidth threshold; determining that an increment of the number of data processing requests within the second time period is greater than a set increment threshold; determining that the increase in the number of data processing requests within the second period of time is greater than a set increase threshold.
In one possible design, the prediction module is specifically configured to, when it is predicted that there is bursty traffic in the first period of time: predicting that burst traffic exists in the first time period according to the data processing request in the target historical time period by using a set traffic prediction model; wherein the flow prediction model is obtained through machine learning and/or model training; or predicting that the burst traffic exists in the first time period according to the burst traffic prediction information from the upper layer application; wherein the burst traffic prediction information is used for indicating: burst traffic is predicted to exist within the first time period.
In one possible design, the storage device is a solid state disk.
In a third aspect, the present application provides a storage device comprising a controller and a storage array; the storage array is used for storing data; the controller is configured to perform the method described in the first aspect or any of the possible designs of the first aspect above on the storage device.
In one possible design, the storage device is a solid state disk.
In a fourth aspect, the present application provides a computing device comprising the storage means described in any one of the possible designs of the second aspect or the second aspect described above, or the computing device comprising the storage means described in any one of the possible designs of the third aspect or the third aspect described above.
In one possible design, the storage device is a solid state disk.
In a fifth aspect, the present application provides a computer readable storage medium storing computer instructions which, when run on a computer or processor, cause the computer or processor to perform the method described by any one of the possible designs of the first aspect or the first aspect.
In a sixth aspect, the present application provides a computer program product which, when run on a computer or processor, causes the computer or processor to perform the method described by any one of the possible designs of the first aspect or the first aspect above.
The beneficial effects of the second aspect to the sixth aspect are described with reference to the beneficial effects of the first aspect, and the detailed description is not repeated here.
Drawings
FIG. 1 is a schematic architecture diagram of one possible application system of the solution provided in the embodiments of the present application;
fig. 2 is a schematic diagram of a control method of a storage device according to an embodiment of the present application;
fig. 3 is a flow chart of a control method of a storage device according to an embodiment of the present application;
fig. 4a is a schematic diagram of a control manner of an SSD according to an embodiment of the disclosure;
fig. 4b is a schematic diagram of another control manner of SSD according to an embodiment of the disclosure;
FIG. 4c is a schematic diagram of another SSD control manner according to an embodiment of the present application;
fig. 5 is a schematic diagram of bandwidth resources corresponding to IO operations at different stages according to an embodiment of the present application;
fig. 6 is a schematic diagram of a memory device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application more apparent, the embodiments of the present application will be described in further detail with reference to the accompanying drawings. Wherein in the description of embodiments of the present application, the terms "first," "second," and the like are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include one or more such feature.
For ease of understanding, a description of concepts related to the present application is given by way of example for reference.
1) The solid state disk is a hard disk made of a solid state electronic memory chip array, and is also called a solid state drive. The solid state disk generally at least comprises a controller and a storage array, and the controller can be used for controlling the solid state disk. The storage array is used for providing a storage area of the solid state disk and can store data.
When a solid state disk adopts a flash memory as a storage medium, the storage array generally comprises tens, hundreds or even thousands of flash memories, each flash memory can comprise hundreds to thousands of flash memory blocks, and each flash memory block can comprise thousands of flash memory pages. The flash memory has three basic operations of reading, writing and erasing, wherein the operation granularity of the reading operation and the writing operation is one flash page, and the operation granularity of the erasing operation is one flash block, so that the flash memory has the characteristics of remote updating and asymmetric reading, writing and erasing time delay.
In order to better use the flash memory, a flash translation layer (flash translation layer, FTL) mapping table and GC operation algorithm are provided in the solid state disk to ensure continuous and efficient writing performance.
The FTL mapping table is an address translation table, and is used for indicating a mapping relationship between a logical address and a physical address of data. Wherein, the logical address is the address generated by the system for data before writing into the flash memory, and the physical address is the address after writing into the flash memory. After a data processing request (or a user request) is issued to the solid state disk, the solid state disk can determine a physical address in the flash memory corresponding to the data processing request through the FTL mapping table. If the data processing request is a read request (for requesting a read operation), reading data of a corresponding physical address in the flash memory; if the data processing request is a write request (for requesting to execute a write operation), and the write operation is to write certain data for the first time, writing the data into a blank physical address in the flash memory; if the data processing request is a request to execute a writing operation, and the writing operation is used for updating a certain stored data, marking the physical address corresponding to the data in the flash memory as invalid, writing the updated data corresponding to the data into a blank physical address in the flash memory, and then updating the corresponding address mapping relation in the FTL mapping table to finish the operation. If the data processing request is an erase request (for requesting to perform an erase operation), deleting the data of the corresponding physical address in the flash memory, and deleting the corresponding address mapping relationship in the FTL mapping table.
In the embodiment of the present application, the data processing request may be simply referred to as an input/output (IO) or an IO request.
The GC operation is to select one flash block to recycle when the available memory space (blank memory space or free memory space) in the memory array is smaller than a start-up threshold (called GC waterline), and specifically operates to read out valid data in the selected flash block and migrate into a flash page in the available memory space, and then erase the contents in the flash block, thereby recycling the memory space corresponding to the flash block through the GC operation. The GC operations cease to execute when the available storage space in the storage array is greater than or equal to the boot threshold by the GC operations.
2) IO (or IO request), refers to a data processing request issued by another device (e.g., a host device) to a storage device. For example, the IO may include at least one of a read request, a write request, an erase request.
Taking a storage device as a solid state disk as an example, according to the disk capacity of the solid state disk, IO occurring in a period of time can be defined as two cases: regular traffic and bursty traffic. The conventional flow is smaller than the disc capacity of the solid state disc, so that the solid state disc can process all requests of a host in time in a scene with fewer data processing requests. The burst flow is larger than the disc capacity of the solid state disk, so that the solid state disk can only respond to the data processing requests in the burst flow in batches, and the phenomenon of overtime request response can be caused.
In the embodiment of the application, the IO operation refers to a process of executing a corresponding operation by the solid state disk according to the received IO, and is an operation executed by the solid state disk when responding to the IO. For example, the IO operation may include at least one of a read operation, a write operation, an erase operation.
3) Bandwidth, which refers to the amount of data that can be transmitted per unit time, can be used to identify the data transmission capabilities of a device, apparatus, or communication line, and is typically expressed in bits per second or bits per second (bps).
Typically, the bandwidth of the storage device is fixed. In the process of controlling the execution of the IO operation or the GC operation, the controller can realize the effect of executing the IO operation or the GC operation under different bandwidth capacities by controlling the frequency of using the bandwidth. Thus, in the practice of the present application, bandwidth resources refer to bandwidth capabilities (or data transfer capabilities) achieved by varying the frequency at which the bandwidth is used. Allocating bandwidth resources to IO operations or GC operations refers to: the corresponding bandwidth capability is configured for the IO operation or the GC operation by configuring the frequency of using the bandwidth in the operation executing process for the IO operation or the GC operation, so that the IO operation or the GC operation is executed under the corresponding bandwidth capability.
Further, in embodiments of the present application, the bandwidth resources of the storage device and the IOPS of the storage device (i.e., the number of data processing requests the storage device can respond to per second) may be mutually converted.
It should be understood that in embodiments of the present application, "at least one" means one or more, and "a plurality" means two or more. "and/or", describes an association relationship of an association object, and indicates that there may be three relationships, for example, a and/or B, and may indicate: a alone, a and B together, and B alone, wherein A, B may be singular or plural. The character "/" generally indicates that the context-dependent object is an "or" relationship. "at least one (item) below" or the like, refers to any combination of these items, including any combination of single item(s) or plural items(s). For example, at least one (one) of a, b or c may represent: a, b, c, a and b, a and c, b and c, or a, b and c, wherein a, b and c can be single or multiple.
Currently, if the IO access amount of the solid state disk is smaller than the disk capacity (namely, a conventional flow scene), the solid state disk can finish the corresponding IO operation on time. And based on the current resource allocation modes of IO operation and GC operation, the bandwidth resources allocated in the solid state disk can also maintain stable available storage space. However, if the IO access amount exceeds the disc capacity (i.e. the burst traffic scenario), the solid state disk needs a long waiting time when performing the corresponding IO operation, which may cause a response timeout. Moreover, based on the current resource allocation modes of IO operation and GC operation, bandwidth resources allocated in the solid state disk cannot maintain relative stability between the storage space occupied by the IO operation and the storage space released by the GC, so that stable available storage space cannot be maintained, even the situation that the available storage space is consumed by the IO operation possibly exists, and the storage performance and stability of the solid state disk are affected.
At present, a method for controlling resources of GC operation is to start and stop the GC operation according to the requirement of IO operation, so as to achieve the effect of preferentially responding to IO. Specifically, when the burst flow comes, the GC operation may be temporarily stopped, so that all resources are used for the IO operation, and when the burst flow ends, the GC operation is restarted to recover the storage space. However, the scheme only considers the IO requirement, but does not consider the actual situation of the storage space, and can not maintain the relatively stable available storage space. And, when the available memory space is small and the burst traffic duration is long, it may cause the available memory space to consume light, resulting in system breakdown. Thus, the feasibility of this solution is poor.
In order to improve system stability of a solid state disk, the embodiment of the application provides a control method of a storage device, wherein the storage device has the capability of performing GC operation and IO operation. Alternatively, the storage device may be a solid state disk. In the method, the storage device can adjust the starting threshold of the GC operation, so that the storage device can always keep a larger available storage space in the storage device by executing the GC operation after the starting threshold is adjusted to be high, and meanwhile, the storage device can start and stop the GC operation according to the requirement of the IO operation. Therefore, before the burst flow arrives, the storage device can firstly increase the starting threshold value of the GC operation to keep a larger available storage space, and the available storage space can be used for IO operation when the burst flow arrives, so that the IO operation is prevented from consuming the available storage space, meanwhile, resources competing for the GC operation and the IO operation can be avoided, and the execution efficiency of the IO operation is improved.
In the scheme, after the starting threshold value of the GC operation is increased, the storage device can always keep a larger available storage space in a conventional flow scene, and the storage device can use the available storage space when responding to the burst flow in a burst flow scene, so that the storage system breakdown of the storage device is avoided, and the stability of the storage device is improved. However, in the above scheme, the high start threshold of the GC operation may cause frequent execution of the GC operation, and the GC operation needs to be moved to the effective flash page during the execution process, which increases the erasing burden of the storage device and causes the problem of the life loss of the storage device.
In view of this, the embodiment of the present application further provides another control method of a storage device, which is used for controlling the resource allocation and execution processes of the IO operation and the GC operation of the storage device, so that the storage device can timely respond to a large number of IOs while maintaining a certain available storage space, thereby ensuring the normal working performance of the storage device, and further improving the running stability and the storage performance of the storage device.
Fig. 1 is a schematic architecture diagram of one possible application system according to the solution provided in the embodiments of the present application. As shown in fig. 1, the system at least comprises a storage device, the storage device comprises a controller and a storage array, the controller is used for controlling the storage device, and the storage array is used for providing a storage space of the storage device. Alternatively, the storage device may be a solid state disk.
Optionally, a host (host) device may also be included in the system. The host device may communicate with and may control some of the storage devices, which may also respond to data processing requests (IOs) from the host device. Alternatively, the storage may be deployed in a host device.
In the storage device, the controller may further include a statistics module, a modulation module, and a GC module. The statistics module can be used for counting current flow information, the conditions of available storage space and the like, and sending the counted information to the regulation and control module. The regulation and control module may be used for executing the control method provided by the embodiment of the present application, and mainly includes calculating a starting threshold value of the GC operation under a specific condition according to current and future flow information and information of available storage space, allocating bandwidth resources of the IO operation and the GC operation, controlling execution of the IO operation and the GC operation, and so on. The GC module is used for executing GC operation according to the control of the modulation module.
In one possible approach, the controller may further include a prediction module. The prediction module may be configured to predict future flow information according to historical flow information of the storage device, and send the predicted future flow information to the regulation module, so that the regulation module may obtain the future flow information.
In another possible scenario, an upper layer application in the host device may predict future traffic information of the storage device after acquiring the historical traffic information thereof, and send the predicted future traffic information to the controller of the storage device. The regulatory module in the controller may also obtain future traffic information from the upper layer applications.
In one possible approach, the upper layer application or prediction module may convert the IOPS of the storage device to a bandwidth requirement and send it to the controller of the storage device.
In a storage device, a storage array is a physical carrier on which data is ultimately stored. By way of example, the memory array may employ a NAND gate (NAND) type flash memory, and may include a plurality of flash arrays (flash arrays). Each flash array may act as a NAND flash memory pellet (flash media pellet), so the memory array corresponds to a NAND flash memory pellet group.
It should be noted that the above system architecture is only an exemplary illustration of a system architecture applicable to the present application, and is not limited to the system architecture applicable to the present application. Other devices or modules may be added to the system architecture described above, or some of the devices or modules may be reduced or modified.
The following describes the solution provided in the present application in connection with specific embodiments.
Fig. 2 is a schematic diagram of a control method of a storage device according to an embodiment of the present application. As shown in fig. 2, the method includes:
s201: when it is predicted that there is burst traffic in a first period of time, the controller of the storage device increases bandwidth resources allocated to garbage collection GC operations prior to the first period of time; wherein the burst traffic contains a first number of data processing requests, the first number being greater than the number of data processing requests that the storage device can respond to per second.
The storage device comprises a controller and a storage array, and has the capability of executing GC operation and IO operation. Optionally, the storage device is a solid state disk.
In this embodiment of the present application, the number of data processing requests included in the regular traffic is smaller than or equal to the number of data processing requests that the storage device can respond to per second, and the number of data processing requests included in the burst traffic is larger than the number of data processing requests that the storage device can respond to per second.
In a conventional traffic scenario, the manner in which the controller allocates bandwidth resources for IO operations and GC operations may be: and allocating corresponding bandwidth resources for the IO operation and the GC operation, so that in the running process of the storage device, the relative balance between the storage space required by the IO operation and the storage space recovered by the GC operation can be maintained, for example, the difference between the two storage spaces is in a set range. Thus, the storage device can have enough storage space for executing IO operation, and the influence of frequent execution of GC operation on the service life of the storage device can be avoided as much as possible.
Under the conventional flow scene, the controller judges whether burst flow exists in a future time period while controlling according to the mode so as to adjust the control mode accordingly.
As an alternative embodiment, the controller may predict whether there is bursty traffic in a future time period based on data processing requests received during a historical time period. Specifically, the controller may predict, using the set flow prediction model, that there is a burst flow in the first period according to the data processing request in the target historical period; wherein the flow prediction model is obtained through machine learning and/or model training, and the first time period is a future time period. Alternatively, the traffic prediction model may be a long short-term memory network (LSTM) based model.
For example, when the scheme is applied to the system shown in fig. 1, the controller may predict that there is burst traffic in the first period through the prediction module.
As another alternative embodiment, the controller may predict that there is burst traffic in the first period according to burst traffic prediction information from an upper layer application; wherein the burst traffic prediction information is used for indicating: burst traffic is predicted to exist within the first time period. Alternatively, the upper layer application may predict that there is bursty traffic in the first period of time using the traffic prediction model described above and indicate to the controller.
For example, when the scheme is applied to the system shown in fig. 1, prediction of future traffic may be performed by the host device, and the controller may determine that there is burst traffic in the first period directly according to an instruction of an upper layer application in the host device.
In some embodiments of the present application, the information predicting the bursty traffic present in the first time period may include: the expected arrival time of the bursty traffic (i.e., the starting time of the first time period), the bandwidth resources required to transmit the bursty traffic, the duration of the bursty traffic (i.e., the duration of the first time period).
When the controller predicts that the burst traffic exists in the first time period, bandwidth resources allocated to GC operation can be increased based on the bandwidth resource allocation situation in the conventional traffic scenario. For example, the controller may allocate spare bandwidth resource increases in the storage device to GC operations, thereby speeding up the reclamation rate of storage space.
S202: and the controller executes the GC operation by using a first bandwidth resource to obtain a first available storage space in the storage array, wherein the first bandwidth resource is a bandwidth resource allocated to the GC operation.
After the controller increases the bandwidth resources allocated to the GC operation, the GC operation may be performed using the first bandwidth resources allocated to the GC operation, resulting in a first available memory space. Wherein the first available storage space is larger than the available storage space that can be maintained in the storage device in a conventional traffic scenario.
According to the bandwidth resource allocation method in the conventional traffic scenario, the controller can complete the IO operation and the GC operation only by a part of the bandwidth resources in the bandwidth resources of the storage device, so that the bandwidth resources of the storage device may have a margin. Based on this, when the controller predicts that there is burst traffic in the first period, the controller may further allocate, based on the bandwidth resource allocation situation in the conventional traffic scenario, a surplus portion or all of the bandwidth resources in the storage device to GC operation use before the first period. The controller executes the GC operation by utilizing all the increased bandwidth resources allocated to the GC operation, so that the execution rate of the GC operation can be increased, and the recovery rate of the storage space can be further increased, and the GC operation can recover more storage space before the first time period comes. Therefore, when the burst flow arrives, more storage space can be provided for IO operation in the storage device, so that the timely execution of the IO operation is ensured, the IO response speed is improved, the excessive small available storage space is avoided as much as possible, and the stability of the storage device is improved.
Further, in the step S201, when it is predicted that there is burst traffic in the first period, the controller may further control start and stop of the GC operation by raising the start threshold of the GC operation before the first period, on the basis of increasing the bandwidth resources allocated to the garbage collection GC operation before the first period.
In one possible approach, the controller may raise the start-up threshold of GC operation when burst traffic is predicted to exist within the first period of time. Wherein the GC operation is initiated when the available storage space in the storage array is less than the initiation threshold.
In this way, by raising the start threshold of the GC operation, the controller can obtain a larger available storage space by performing the GC operation, and it is also ensured that after obtaining a larger available storage space by performing the GC operation, the controller can maintain the obtained available storage space by performing the GC operation.
In another possible manner, the controller may determine, when it is predicted that there is burst traffic in the first period of time, a first target time based on a storage space required for an IO operation corresponding to the burst traffic and the first bandwidth resource; when the first target moment arrives, the starting threshold value of the GC operation is regulated to be high; wherein the GC operation is initiated when the available storage space in the storage array is less than the initiation threshold.
Specifically, the controller may calculate, according to the predicted bandwidth resource required for transmitting the burst traffic and the duration of the burst traffic, a storage space required for the IO operation corresponding to the burst traffic. By way of example, the calculation may be performed according to the following formula:
S 2 =BW 3 ×T
wherein S is 2 Memory space, BW, required for IO operation corresponding to the burst traffic 3 And T is the duration of the burst traffic in order to transmit the bandwidth resource required by the burst traffic.
Then, the controller may calculate the time required for obtaining the storage space through the GC operation according to the storage space required by the IO operation corresponding to the burst flow and the increased bandwidth resource allocated to the GC operation. By way of example, the calculation may be performed according to the following formula:
T 1 =S 2 /BW 4
wherein t is 1 S for the time required to obtain the memory space by GC operations 2 Memory space, BW, required for IO operation corresponding to the burst traffic 4 And adding bandwidth resources allocated to the GC operation to the first resources.
After determining the above information, the controller may calculate and determine the first target time. Specifically, the controller may calculate a duration between a first target time and a time when the burst traffic is predicted to exist in the first period according to the following formula:
T 2 =T 3 -T 1
Wherein T is 2 For the duration between the first target instant and the instant when the presence of bursty traffic in the first period is predicted, T 3 For a time period between a starting time of the first time period and a time when the existence of the burst traffic in the first time period is predicted, T 1 In order to obtain the time required by the memory space required by the IO operation corresponding to the burst flow through GC operation, delta can be set time length, and delta is more than or equal to 0 and less than or equal to T 3 -T 1
The controller calculates T 2 Later, the time when the existence of the burst traffic in the first time period is predicted is delayed by T 2 The corresponding time is the first target time. The start threshold of GC operation may be turned up when the first target time arrives.
In this way, the controller can determine the time T required for obtaining the storage space capable of being used for processing the burst traffic through the GC operation according to the bandwidth resources additionally allocated to the GC operation and the bandwidth resources required for transmitting the burst traffic 1 Then, the estimated arrival time of the burst flow is advanced by T 1 The GC threshold value is increased at the corresponding moment, thereby not only reducing unnecessary to the maximum extentGC operation reduces the influence on the service life of the storage device, and a larger storage space can be obtained through the GC operation so as to be used when burst flow arrives. Further, at the advance T 1 By adding a certain time margin delta on the basis of the above, the storage space obtained by GC operation can be further ensured to be used when enough supply burst flow arrives.
In the two modes, when the controller increases the starting threshold of the GC operation, the starting threshold of the GC operation may be adjusted to the first threshold. The first threshold value is larger than or equal to a target value, and the target value is larger than or equal to a storage space required by IO operation corresponding to the burst flow.
For example, the target value may be a sum of a first parameter and a second parameter, where the first parameter is a storage space required for the IO operation corresponding to the burst traffic, and the second parameter is an available storage space in the storage array when the burst traffic is predicted to exist in the first period of time. The first threshold value may be equal to the target value or slightly greater than the target value. That is, the target value may satisfy the following formula: s=s 2 +S 3 Wherein S is a target value, S 2 S is the storage space required by the IO operation corresponding to the burst flow 3 Is available memory in the memory array when burst traffic is predicted to exist within a first period of time. The first threshold may satisfy the following formula: n (N) 1 Not less than S, wherein N 1 Is a first threshold.
Further, after increasing the allocated bandwidth resource for the GC operation and raising the start threshold of the GC operation based on the above manner, the controller may determine whether there is a burst traffic (i.e., whether the burst traffic comes) according to the real-time traffic information in the process of executing the GC operation according to step S202, so as to further control.
When the controller judges whether burst traffic exists according to the real-time traffic information, the following mode can be adopted: after the second time period is over, determining that the burst traffic exists according to the data processing request in the second time period; the duration of the second time period is smaller than a set threshold value, and the ending time of the second time period is before the ending time of the first time period. The set threshold may be, for example, a short duration in the order of milliseconds or seconds.
Specifically, the controller may determine that there is burst traffic when determining that the data processing request in the second period satisfies at least one of the following conditions 1 to 4.
The total number of data processing requests in the condition 1, the second period of time is greater than the set number threshold.
The total bandwidth of the data processing request in the condition 2, the second period of time is greater than the set bandwidth threshold.
The increment of the number of data processing requests in the second period of time of condition 3 is larger than the set increment threshold.
The speed-up of the number of data processing requests in the second period of time is greater than the set speed-up threshold value.
The second period of time in each of the above conditions is a short period of time, and when the data processing request in the second period of time satisfies the condition 1, it is assumed that there is a large number of data processing requests in a short time, and burst traffic is considered to exist. When the data processing request in the second period satisfies the condition 2, it is assumed that there is burst traffic, which means that the data amount of the data processing request in a short time is large. When the data processing request in the second period satisfies the condition 3 or the condition 4, which means that the data processing request increases rapidly in a short time, it can be considered that there is burst traffic.
It should be noted that, in the embodiments of the present application, the method is not limited to determining whether the burst traffic exists in the foregoing manner, and the controller may also determine in other manners, which are not listed here.
In the embodiment of the application, in the process of judging whether the burst flow exists in real time, the controller may obtain multiple judging results, and correspondingly adopted control modes are different. Meanwhile, when the size of the available storage space in the storage array changes, the control mode adopted by the controller also changes. Therefore, the controller needs to flexibly adjust the control modes of GC operation and IO operation according to the change of actual conditions, so that a better control effect is obtained.
The following will describe the details of cases 1 to 3.
In case 1, before the burst traffic arrives, the available storage space in the storage array reaches the target value, and then the controller reallocates the bandwidth resources used in the execution process of the IO operation and the GC operation.
It should be noted that, in the embodiment of the present application, when the controller determines that there is burst traffic according to the above manner, the controller indicates that burst traffic arrives.
In this embodiment of the present application, the target value is greater than or equal to a storage space required for the IO operation corresponding to the burst flow. Thus, when the available memory in the memory array reaches the target value, it is indicated that the first available memory obtained by GC operation is sufficient for IO operation use corresponding to burst traffic. If it is not determined that there is burst traffic, that is, burst traffic has not arrived yet, the execution speed of the IO operation may be reduced appropriately, so that the first available storage space that is currently obtained may be maintained, thereby avoiding an influence of excessive GC operation on the lifetime of the storage device.
Specifically, before determining that the burst traffic exists, the controller may allocate the second bandwidth resource to the IO operation corresponding to the current data processing request and allocate the third bandwidth resource to the GC operation when determining that the first available storage space reaches the target value. The size of the second bandwidth resource has a positive correlation with the size of the available storage space in the storage array, and the size of the third bandwidth resource has a negative correlation with the size of the available storage space in the storage array.
Based on the mode, when the available storage space is larger, the controller can allocate more bandwidth resources for IO operation and less bandwidth resources for GC operation, so that the consumption of the available storage space can be accelerated, the recovery of the available storage space is slowed down, the available storage space is properly consumed, the overlarge available storage space is avoided, and meanwhile, the IO operation speed is improved. When the available storage space is smaller, the controller can allocate less bandwidth resources for IO operation and more bandwidth resources for GC operation, so that the recovery of the available storage space can be quickened, the consumption of the available storage space is slowed down, and the available storage space is prevented from being too small. The bandwidth resources of IO operation and GC operation are flexibly allocated in the mode, and the size of the available storage space can be kept stable until burst traffic arrives.
Illustratively, the second bandwidth resource corresponds to the following formula:
BW 1 =BW 2 ×S 1 /S th
wherein BW is 1 BW for the second bandwidth resource 2 S is the total bandwidth resource which can be used by the controller 1 For the available storage space in the storage array, the S th Is the start threshold for GC operation.
The third bandwidth resource may be part or all of the bandwidth resources obtained by subtracting the second bandwidth resource from the total bandwidth resource that the controller can use.
And 2, when the burst flow arrives, the controller reduces the starting threshold of the GC operation.
In the process of judging whether the burst flow exists in real time, the controller regulates down the starting threshold of the GC operation when determining that the burst flow exists. Meanwhile, the controller can allocate the first available storage space obtained by executing the GC operation to the IO operation corresponding to the burst traffic, so that timely response to the burst traffic is ensured.
After the controller lowers the starting threshold of the GC operation, the GC operation is stopped, more bandwidth resources can be supplied to the IO operation, and the IO operation can respond to the burst flow timely and rapidly, so that the problem of timeout of IO response is reduced or avoided.
The controller may adjust the start-up threshold of the GC operation to a second threshold when the start-up threshold of the GC operation is adjusted down. Wherein the second threshold may be a start-up threshold for GC operations when bursty traffic is predicted (N 0 ) Alternatively, the second threshold is less than or equal to the target value (S).
3, if the predicted burst flow does not arrive at the second target moment, reducing the starting threshold of the GC operation; wherein the second target time is any time within the first time period.
If the high start-up threshold of GC operation is maintained at all times in the absence of predicted burst traffic, the lifetime of the storage device may be affected by excessive and unnecessary GC operations. Therefore, when it is determined that the predicted burst traffic does not arrive, the start-up threshold of GC operation needs to be lowered in time. Because the predicted time when the burst traffic exists is the first time period, if the burst traffic cannot be determined to arrive in the first time period, the controller can determine that the burst traffic does not exist actually and lower the start threshold of the GC operation.
Specifically, if the controller determines that the predicted burst traffic does not arrive at the second target time, it determines that the burst traffic does not exist, and may reduce the start threshold of the GC operation. Alternatively, the second target time may be a starting time of the first period. Wherein, the controller may adjust the start-up threshold of the GC operation to the second threshold described in case 2 above when the start-up threshold of the GC operation is adjusted down.
In the above embodiment, the controller in the storage device predicts the arrival of the burst traffic in advance, and simultaneously combines the situation that the bandwidth resources required by the conventional traffic are smaller and the surplus bandwidth resources are available in the storage device, when the burst traffic is predicted, the bandwidth resources allocated to the GC operation are increased, so that the recovery rate of the storage space is increased, and the available storage space is prepared for the burst traffic in advance. When the burst flow arrives, the controller can provide the available storage space prepared in advance for IO operation corresponding to the burst flow, so that the IO response speed is ensured, the user experience is improved, meanwhile, the excessive consumption of the available storage space is avoided, and the running stability of the storage device is improved.
Taking a storage device as an example of an SSD, a scheme provided in an embodiment of the present application is described below.
Fig. 3 is a flowchart of a control method of a storage device according to an embodiment of the present application. When the storage device is an SSD, the process includes:
s301: under the conventional traffic scene, the controller controls the SSD according to the conventional strategy, and obtains the prediction information of the burst traffic.
The conventional policy allocates bandwidth resources corresponding to the conventional policy to the GC operation according to the performed IO operation, so that the storage space recovered by the GC operation is relatively balanced with the storage space required by the IO operation corresponding to the conventional flow.
For example, referring to fig. 4a, initially, the controller of the SSD may employ flow control policy 0 to regulate and receive the predicted information of the bursty traffic. Wherein, the flow control strategy 0 controls the starting threshold value of GC operation to be an initial value N 0 . At this time, the bandwidth resources of the IO operation are close to those of the GC operation, and are smaller, and more idle bandwidth resources exist in the SSD and are not used.
The predicted information of the burst traffic includes the predicted arrival time, duration, bandwidth resources required for transmitting the burst traffic, and the like of the burst traffic. The predicted information of the burst traffic may be predicted by the controller itself or determined according to an instruction of an upper layer application.
S302: after the controller acquires the prediction information of the burst flow, bandwidth resources allocated to the GC operation are increased, and the starting threshold of the GC operation is increased.
For example, referring to fig. 4b, after determining that burst traffic is predicted according to the prediction information of burst traffic, the controller adjusts the adopted flow control policy 0 to flow control policy 1. Wherein, the flow control strategy 1 is to adjust the starting threshold of the GC operation to a first threshold N 1 And meanwhile, increasing and distributing the idle bandwidth resources in the SSD to GC operation until the available storage space reaches a target value S.
Wherein the target value s=bandwidth resource required for transmitting the burst traffic x burst traffic duration+available storage space in the storage array when the burst traffic is predicted, N 1 Is a value slightly greater than S.
For example, as shown in the curve corresponding to the "stage of preparing available storage space" in fig. 5, when burst traffic is predicted, the controller adopts the flow control policy 1, and the bandwidth resource used by the IO operation changes according to the change of the actual IO traffic, but because the space required by the IO operation is smaller, and the speed of GC operation is faster, the size of the available storage space is gradually increased.
S303: and when the controller determines that the available storage space reaches the target value, allocating bandwidth resources with positive correlation with the current available storage space for IO operation, and allocating bandwidth resources with negative correlation with the current available storage space for GC operation.
Illustratively, referring to fig. 4b, after the controller determines that the available storage space reaches the target value S, the adopted flow control strategy 1 is adjusted to be the flow control strategy 2. Wherein, the flow control strategy 2 allocates bandwidth resources proportional to the available storage space to the IO operation, and the residual bandwidth resources can be allocated to the GC operation.
Wherein bandwidth resource=total bandwidth resource×available storage space/N corresponding to IO operation 1 . Maximum available memory is N 1 At this point the IO operation uses the full bandwidth resources.
For example, as shown in the curve corresponding to the "maintain available storage space stage" in fig. 5, when the controller adopts the flow control policy 2, the bandwidth resource used by the IO operation is proportional to the available storage space, and in this process, the available storage space can be maintained at a level around S as much as possible.
S304: the controller judges whether the burst flow arrives according to the actual IO condition, if so, the step S305 is executed; otherwise, step S306 is performed.
By way of example, the controller may determine that burst traffic is coming if it determines that the number of IOs per second increases by more than 50% over the previous second in 3 consecutive seconds.
S305: the controller adjusts the start-up threshold of GC operation down.
Illustratively, referring to fig. 4c, when the controller determines that the bursty traffic is coming, the adopted flow control strategy 2 is adjusted to be the flow control strategy 3. Wherein the flowControl strategy 3 is to adjust the start threshold of GC operation to an initial value N 0 Thereby stopping the GC operation and using bandwidth resources for the IO operation.
Illustratively, as shown in the curve corresponding to the "use available storage space stage" in fig. 5, when the controller adopts the flow control policy 3, the GC operation is stopped, and the IO operation may use the total bandwidth resource.
S306: the controller maintains the current control mode or switches to control the SSD according to the conventional strategy when the expected ending time of the burst traffic is determined.
For example, the controller may maintain the flow control policy 2 when it is not determined that the bursty traffic is coming, or adjust the flow control policy 2 to be adopted to the flow control policy 3 when it is determined that the expected end time of the bursty traffic is reached.
The expected ending time of the burst traffic is a corresponding time after the expected arrival time of the burst traffic delays the duration of the burst traffic.
It should be understood that the above examples are merely illustrative of implementations in one possible scenario of the present application, and not all possible scenarios or situations are contemplated. The specific implementation of each step in the above examples may refer to the description in the above examples, and will not be described in detail here.
In the above example, the controller may quickly vacate the storage space required by the IO operation corresponding to the burst traffic after predicting the burst traffic, and temporarily lower the start threshold of the GC operation when the burst traffic comes, thereby maximizing the IO response capability to absorb the burst traffic, and improving the IO response speed and the stability of the SSD. In this process, only increasing the configuration bandwidth resources for GC operation to quickly reclaim storage space will have an impact on the life of the SSD, but for a shorter duration, so the impact on life can be reduced.
Based on the above embodiments and the same conception, the embodiments of the present application further provide a control device of a storage device, where the control device is applied to a controller in the storage device, and the storage device further includes a storage array. As shown in fig. 6, the control device 600 includes: a prediction module 601, configured to predict that there is burst traffic in the first period; a processing module 602, configured to increase bandwidth resources allocated to GC operations before the first period of time, and perform the GC operations using the first bandwidth resources, to obtain a first available storage space in the storage array; wherein the burst traffic contains a first number of data processing requests, the first number being greater than the number of data processing requests that the storage device can respond to per second; the first bandwidth resource is a bandwidth resource allocated to the GC operation.
In one possible design, the processing module 602 is further configured to: and when the burst traffic is determined to exist, distributing the first available storage space to the input/output IO operation corresponding to the burst traffic.
In one possible design, when the prediction module 601 predicts that there is bursty traffic in the first time period, the processing module 602 is further configured to: raising a start-up threshold of the GC operation; wherein the GC operation is initiated when the available storage space in the storage array is less than the initiation threshold.
In one possible design, when the prediction module 601 predicts that there is bursty traffic in the first time period, the processing module 602 is further configured to: determining a first target moment based on a storage space required by IO operation corresponding to the burst flow and the first bandwidth resource; when the first target moment arrives, the starting threshold value of the GC operation is increased; wherein the GC operation is initiated when the available storage space in the storage array is less than the initiation threshold.
In one possible design, the processing module 602 is further configured to: when it is determined that the bursty traffic is present, lowering a start-up threshold of the GC operation; or if the predicted burst flow does not arrive at the second target time, reducing the starting threshold of the GC operation; wherein the second target time is any time within the first time period.
In one possible design, the processing module 602 is further configured to: before determining that the burst traffic exists, when the first available storage space reaches a target value, allocating a second bandwidth resource to an IO operation corresponding to a current data processing request, and allocating a third bandwidth resource to the GC operation; the target value is larger than or equal to a storage space required by IO operation corresponding to the burst flow; the size of the second bandwidth resource has a positive correlation with the size of the available storage space in the storage array, and the size of the third bandwidth resource has a negative correlation with the size of the available storage space in the storage array.
In one possible design, the second bandwidth resource conforms to the following formula:
BW 1 =BW 2 ×S 1 /S th
wherein the BW is 1 For the second bandwidth resource, the BW 2 For the total bandwidth resources that the controller can use, the S 1 For the available storage space in the storage array, the S th Is a start threshold for the GC operation.
In one possible design, the target value is a sum of a first parameter that is a memory space required for the IO operation corresponding to the burst traffic and a second parameter that is an available memory space in the memory array when the burst traffic is predicted to exist within a first period of time.
In one possible design, the storage space required for the IO operation corresponding to the burst traffic conforms to the following formula:
S 2 =BW 3 ×T
wherein the S is 2 For the storage space required by the IO operation corresponding to the burst traffic, the BW 3 And for transmitting the bandwidth resource required by the burst traffic, the T is the duration of the burst traffic.
In one possible design, the processing module 602 is specifically configured to, when determining that the bursty traffic is present: after the second time period is over, determining that the burst traffic exists according to the data processing request in the second time period; the duration of the second time period is smaller than a set threshold value, and the ending time of the second time period is before the ending time of the first time period.
In one possible design, the processing module 602 is specifically configured to perform at least one of the following when it is determined that the bursty traffic exists according to the data processing request in the second time period: determining that the total number of data processing requests within the second time period is greater than a set number threshold; determining that the total bandwidth of the data processing requests in the second time period is greater than a set bandwidth threshold; determining that an increment of the number of data processing requests within the second time period is greater than a set increment threshold; determining that the increase in the number of data processing requests within the second period of time is greater than a set increase threshold.
In one possible design, the prediction module 601 is specifically configured to, when it predicts that there is bursty traffic in the first period of time: predicting that burst traffic exists in the first time period according to the data processing request in the target historical time period by using a set traffic prediction model; wherein the flow prediction model is obtained through machine learning and/or model training; or predicting that the burst traffic exists in the first time period according to the burst traffic prediction information from the upper layer application; wherein the burst traffic prediction information is used for indicating: burst traffic is predicted to exist within the first time period.
In one possible design, the storage device is a solid state disk.
The division of the modules in the embodiments of the present application is schematically only one logic function division, and there may be another division manner in actual implementation, and in addition, each functional module in each embodiment of the present application may be integrated in one processor, or may exist separately and physically, or two or more modules may be integrated in one module. The integrated modules may be implemented in hardware or in software functional modules.
Only one or more of the individual modules in fig. 6 may be implemented in software, hardware, firmware, or a combination thereof. The software or firmware includes, but is not limited to, computer program instructions or code and may be executed by a hardware processor. The hardware includes, but is not limited to, various types of integrated circuits such as a Central Processing Unit (CPU), a Digital Signal Processor (DSP), a Field Programmable Gate Array (FPGA), or an Application Specific Integrated Circuit (ASIC).
Based on the above embodiments and the same conception, the present application embodiments also provide a storage device including a controller and a storage array; the storage array is used for storing data; the controller is configured to execute the control method of the storage device provided in the foregoing embodiment on the storage device.
In one possible design, the storage device is a solid state disk.
Based on the above embodiments and the same concepts, the present application further provides a computing device, where the computing device includes the storage device provided in the embodiments.
In one possible design, the storage device is a solid state disk.
Based on the above embodiments and the same conception, the present application also provides a computer-readable storage medium storing computer instructions that, when executed on a computer or a processor, cause the computer or the processor to execute the control method of the storage device provided in the above embodiments.
Based on the above embodiments and the same conception, the present application embodiment also provides a computer program product, which when run on a computer or a processor, causes the computer or the processor to execute the control method of the storage device provided in the above embodiments.
The method provided by the embodiments of the present application may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, produces a flow or function in accordance with embodiments of the present invention, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, a network device, a user device, or other programmable apparatus. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by means of a wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL), or wireless (e.g., infrared, wireless, microwave, etc.), the computer-readable storage medium may be any available medium that can be accessed by the computer or a data storage device such as a server, data center, etc., that contains an integration of one or more available media, the available media may be magnetic media (e.g., floppy disk, hard disk, tape), optical media (e.g., digital video disc (digital video disc, DVD), or semiconductor media (e.g., SSD), etc.
It will be apparent to those skilled in the art that various modifications and variations can be made in the present application without departing from the scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims and the equivalents thereof, the present application is intended to cover such modifications and variations.

Claims (30)

  1. A control method of a storage device including a controller and a storage array, the method being applied to the controller, the method comprising:
    when burst traffic is predicted to exist in a first period of time, increasing bandwidth resources allocated to garbage collection GC operations prior to the first period of time; wherein the burst traffic contains a first number of data processing requests, the first number being greater than the number of data processing requests that the storage device can respond to per second;
    and executing the GC operation by using a first bandwidth resource to obtain a first available storage space in the storage array, wherein the first bandwidth resource is a bandwidth resource allocated to the GC operation.
  2. The method according to claim 1, wherein the method further comprises:
    and when the burst traffic is determined to exist, distributing the first available storage space to the input/output IO operation corresponding to the burst traffic.
  3. The method according to claim 1 or 2, wherein when burst traffic is predicted to exist within the first time period, the method further comprises:
    raising a start-up threshold of the GC operation; wherein the GC operation is initiated when the available storage space in the storage array is less than the initiation threshold.
  4. The method according to claim 1 or 2, wherein when burst traffic is predicted to exist within the first time period, the method further comprises:
    determining a first target moment based on a storage space required by IO operation corresponding to the burst flow and the first bandwidth resource;
    when the first target moment arrives, the starting threshold value of the GC operation is increased; wherein the GC operation is initiated when the available storage space in the storage array is less than the initiation threshold.
  5. The method according to any one of claims 1 to 4, further comprising:
    when it is determined that the bursty traffic is present, lowering a start-up threshold of the GC operation; or alternatively
    If the predicted burst flow does not arrive at the second target moment, the starting threshold value of the GC operation is lowered; wherein the second target time is any time within the first time period.
  6. The method according to any one of claims 1 to 5, further comprising:
    before determining that the burst traffic exists, when the first available storage space reaches a target value, allocating a second bandwidth resource to an IO operation corresponding to a current data processing request, and allocating a third bandwidth resource to the GC operation;
    the target value is larger than or equal to a storage space required by IO operation corresponding to the burst flow; the size of the second bandwidth resource has a positive correlation with the size of the available storage space in the storage array, and the size of the third bandwidth resource has a negative correlation with the size of the available storage space in the storage array.
  7. The method of claim 6, wherein the second bandwidth resource conforms to the formula:
    BW 1 =BW 2 ×S 1 /S th
    wherein the BW is 1 For the second bandwidth resource, the BW 2 For the total bandwidth resources that the controller can use, the S 1 For the available storage space in the storage array, the S th Is a start threshold for the GC operation.
  8. The method of claim 6 or 7, wherein the target value is a sum of a first parameter and a second parameter, the first parameter being a memory space required for IO operations corresponding to the bursty traffic, the second parameter being an available memory space in the memory array when the bursty traffic is predicted to exist within a first period of time.
  9. The method according to any one of claims 6 to 8, wherein the storage space required for the IO operation corresponding to the burst traffic conforms to the following formula:
    S 2 =BW 3 ×T
    wherein the S is 2 For the storage space required by the IO operation corresponding to the burst traffic, the BW 3 And for transmitting the bandwidth resource required by the burst traffic, the T is the duration of the burst traffic.
  10. The method according to any one of claims 6 to 9, wherein determining that the bursty traffic is present comprises:
    after the second time period is over, determining that the burst traffic exists according to the data processing request in the second time period; the duration of the second time period is smaller than a set threshold value, and the ending time of the second time period is before the ending time of the first time period.
  11. The method of claim 10, wherein determining that the bursty traffic is present based on the data processing request during the second time period comprises at least one of:
    determining that the total number of data processing requests within the second time period is greater than a set number threshold;
    determining that the total bandwidth of the data processing requests in the second time period is greater than a set bandwidth threshold;
    Determining that an increment of the number of data processing requests within the second time period is greater than a set increment threshold;
    determining that the increase in the number of data processing requests within the second period of time is greater than a set increase threshold.
  12. The method according to any one of claims 1 to 11, wherein predicting that there is bursty traffic in the first time period comprises:
    predicting that burst traffic exists in the first time period according to the data processing request in the target historical time period by using a set traffic prediction model; wherein the flow prediction model is obtained through machine learning and/or model training; or alternatively
    Predicting that burst traffic exists in the first time period according to burst traffic prediction information from an upper layer application; wherein the burst traffic prediction information is used for indicating: burst traffic is predicted to exist within the first time period.
  13. The method of any one of claims 1 to 12, wherein the storage device is a solid state disk.
  14. A control device of a storage device, the control device being applied to a controller in the storage device, wherein the storage device further comprises a storage array; characterized in that the control device comprises:
    The prediction module is used for predicting that burst traffic exists in the first time period;
    the processing module is used for increasing bandwidth resources allocated to GC operations before the first time period and executing the GC operations by utilizing the first bandwidth resources to obtain a first available storage space in the storage array; wherein the burst traffic contains a first number of data processing requests, the first number being greater than the number of data processing requests that the storage device can respond to per second; the first bandwidth resource is a bandwidth resource allocated to the GC operation.
  15. The control device of claim 14, wherein the processing module is further configured to:
    and when the burst traffic is determined to exist, distributing the first available storage space to the input/output IO operation corresponding to the burst traffic.
  16. The control apparatus of claim 14 or 15, wherein when the prediction module predicts that there is bursty traffic within a first time period, the processing module is further configured to:
    raising a start-up threshold of the GC operation; wherein the GC operation is initiated when the available storage space in the storage array is less than the initiation threshold.
  17. The control apparatus of claim 14 or 15, wherein when the prediction module predicts that there is bursty traffic within a first time period, the processing module is further configured to:
    determining a first target moment based on a storage space required by IO operation corresponding to the burst flow and the first bandwidth resource;
    when the first target moment arrives, the starting threshold value of the GC operation is increased; wherein the GC operation is initiated when the available storage space in the storage array is less than the initiation threshold.
  18. The control device according to any one of claims 14 to 17, wherein the processing module is further configured to:
    when it is determined that the bursty traffic is present, lowering a start-up threshold of the GC operation; or alternatively
    If the predicted burst flow does not arrive at the second target moment, the starting threshold value of the GC operation is lowered; wherein the second target time is any time within the first time period.
  19. The control device according to any one of claims 14 to 18, wherein the processing module is further configured to:
    before determining that the burst traffic exists, when the first available storage space reaches a target value, allocating a second bandwidth resource to an IO operation corresponding to a current data processing request, and allocating a third bandwidth resource to the GC operation;
    The target value is larger than or equal to a storage space required by IO operation corresponding to the burst flow; the size of the second bandwidth resource has a positive correlation with the size of the available storage space in the storage array, and the size of the third bandwidth resource has a negative correlation with the size of the available storage space in the storage array.
  20. The control device of claim 19, wherein the second bandwidth resource conforms to the following formula:
    BW 1 =BW 2 ×S 1 /S th
    wherein the BW is 1 For the second bandwidth resource, the BW 2 For the total bandwidth resources that the controller can use, the S 1 For the available storage space in the storage array, the S th Is a start threshold for the GC operation.
  21. The control device according to claim 19 or 20, wherein the target value is a sum of a first parameter, which is a memory space required for IO operations corresponding to the burst traffic, and a second parameter, which is an available memory space in the memory array when it is predicted that there is burst traffic in a first period of time.
  22. The control device according to any one of claims 19 to 21, wherein a storage space required for the IO operation corresponding to the burst flow conforms to the following formula:
    S 2 =BW 3 ×T
    Wherein the S is 2 For the storage space required by the IO operation corresponding to the burst traffic, the BW 3 And for transmitting the bandwidth resource required by the burst traffic, the T is the duration of the burst traffic.
  23. The control device according to any one of claims 19 to 22, wherein the processing module, when determining that the bursty traffic is present, is specifically configured to:
    after the second time period is over, determining that the burst traffic exists according to the data processing request in the second time period; the duration of the second time period is smaller than a set threshold value, and the ending time of the second time period is before the ending time of the first time period.
  24. The control device according to claim 23, wherein the processing module is configured to, when it is determined that the bursty traffic is present according to the data processing request in the second time period, specifically perform at least one of:
    determining that the total number of data processing requests within the second time period is greater than a set number threshold;
    determining that the total bandwidth of the data processing requests in the second time period is greater than a set bandwidth threshold;
    determining that an increment of the number of data processing requests within the second time period is greater than a set increment threshold;
    Determining that the increase in the number of data processing requests within the second period of time is greater than a set increase threshold.
  25. The control device according to any one of claims 14 to 23, wherein the prediction module is configured to, when it is predicted that there is burst traffic in the first period of time:
    predicting that burst traffic exists in the first time period according to the data processing request in the target historical time period by using a set traffic prediction model; wherein the flow prediction model is obtained through machine learning and/or model training; or alternatively
    Predicting that burst traffic exists in the first time period according to burst traffic prediction information from an upper layer application; wherein the burst traffic prediction information is used for indicating: burst traffic is predicted to exist within the first time period.
  26. The control device according to any one of claims 14 to 25, wherein the storage device is a solid state disk.
  27. A memory device, wherein the memory device comprises a controller and a memory array;
    the storage array is used for storing data;
    the controller is configured to perform the method of any one of claims 1-13 on the storage device.
  28. The storage device of claim 27, wherein the storage device is a solid state disk.
  29. A computer readable storage medium storing computer instructions which, when run on a computer or processor, cause the computer or processor to perform the method of any one of claims 1-13.
  30. A computer program product, characterized in that the computer program product, when run on a computer or a processor, causes the computer or the processor to perform the method of any of claims 1-13.
CN202180100197.4A 2021-09-07 2021-09-07 Control method and device of storage device Pending CN117769699A (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2021/116983 WO2023035113A1 (en) 2021-09-07 2021-09-07 Control method and apparatus for storage apparatus

Publications (1)

Publication Number Publication Date
CN117769699A true CN117769699A (en) 2024-03-26

Family

ID=85506148

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202180100197.4A Pending CN117769699A (en) 2021-09-07 2021-09-07 Control method and device of storage device

Country Status (2)

Country Link
CN (1) CN117769699A (en)
WO (1) WO2023035113A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117785619B (en) * 2024-02-27 2024-05-10 深圳超盈智能科技有限公司 Method and system for monitoring chip storage state
CN118519591B (en) * 2024-07-25 2024-11-29 山东云海国创云计算装备产业创新中心有限公司 Solid state hard disk flow control method and device, storage medium and electronic device

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI584289B (en) * 2016-01-20 2017-05-21 大心電子(英屬維京群島)股份有限公司 Memory management method, memory storage device and memory control circuit unit
CN109977032B (en) * 2017-12-28 2024-08-09 北京忆恒创源科技股份有限公司 Garbage data recovery control method and device
CN108984116B (en) * 2018-06-14 2021-07-20 浙江大华存储科技有限公司 Flow control method and device for garbage recovery bandwidth of solid state disk

Also Published As

Publication number Publication date
WO2023035113A1 (en) 2023-03-16

Similar Documents

Publication Publication Date Title
US9244617B2 (en) Scheduling requests in a solid state memory device
CN107885456B (en) Reducing conflicts for IO command access to NVM
US8392635B2 (en) Selectively enabling a host transfer interrupt
CN104090847B (en) Address distribution method of solid-state storage device
US10871920B2 (en) Storage device and computer system
KR102719059B1 (en) Multi-stream ssd qos management
US11983444B2 (en) Memory system and method of controlling nonvolatile memory
US11010094B2 (en) Task management method and host for electronic storage device
CN108762665B (en) Method and device for controlling reading and writing of storage device
CN117769699A (en) Control method and device of storage device
EP3561678A1 (en) Information processing device and memory access method
CN110162396A (en) Method for recovering internal storage, device, system and storage medium
WO2014136302A1 (en) Task management device and task management method
US20240012578A1 (en) Data storage device for guaranteeing that system resources meet performance requirements, method of operating the same, and memory controller for the same
CN110908595A (en) Storage device and information processing system
JP6193189B2 (en) NAND background processing controller
US20220043604A1 (en) Memory system and write control method
CN117119201B (en) Compressed video transmission method, device, equipment and storage medium
CN115576876A (en) DMA (direct memory Access) allocation and management method applied to NVMe (network video disk) SSD (solid State disk)
US20160077882A1 (en) Scheduling system, scheduling method, and recording medium
CN115033370B (en) Method and device for scheduling flash memory tasks in storage equipment, storage medium and equipment
US11928360B2 (en) Command slot management for memory devices
CN112463027B (en) I/O processing method, system, equipment and computer readable storage medium
CN115686855A (en) Cache data access scheduling method, processor, electronic device and storage medium
CN108572924B (en) A request processing method for 3D MLC flash memory device

Legal Events

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