SSD writing performance regulation and control method and device, equipment and medium
By determining the time slice coefficient based on SSD particle parameters and preset IOPS thresholds, and rationally allocating time slices for garbage collection and data writing operations, the problem of insufficient SSD write performance is solved, and the write performance and minimum write time are improved.
Patent Information
- Application Number
- CN202410649891.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-24
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2044-05-24
AI Technical Summary
When SSD performs garbage collection and data writing, garbage collection takes a long time and the writing performance cannot meet the minimum performance limit. As a result, data writing needs to wait for garbage collection to release space, which affects the writing performance.
By determining the time slice coefficient based on SSD particle parameters and preset IOPS thresholds, the number of time slices for garbage collection and data writing operations is reasonably allocated, and the time slice allocation is dynamically adjusted to optimize the execution time of garbage collection and data writing.
It improves the write performance of SSD, ensures the minimum write time, and improves the write performance's ability to meet the minimum performance limit.
Smart Images

Figure CN118550466A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of flash memory storage control technology, and in particular to a method, device, equipment and medium for regulating and controlling SSD write performance. Background Art
[0002] Solid State Drive (SSD) has a garbage collection (GC) module. The Input / Output Operations Per Second (IOPS) of SSD is an important indicator for measuring the write performance of SSD. In some scenarios, the IOPS of SSD is required to be no less than a certain threshold.
[0003] In the prior art, when an SSD performs garbage collection and data writing at the same time, since garbage collection takes longer than data writing, after the GC module is started, the physical block space released by garbage collection is often lower than the physical block space required for data writing. This results in data writing having to wait for garbage collection to release space, and the execution time of data writing is relatively short, resulting in the SSD's write performance being unable to meet the minimum performance limit requirements. Summary of the invention
[0004] In view of this, the purpose of the present invention is to overcome the deficiencies in the prior art and to provide an SSD write performance control method, device, equipment and medium, aiming to improve the write performance of the SSD by reasonably allocating the execution time of garbage collection operations and the execution time of data writing operations.
[0005] The present invention provides the following technical solutions:
[0006] In a first aspect, the present invention provides a method for controlling SSD write performance, the method comprising:
[0007] Determining a first running time required for a garbage collection module to recycle a garbage block according to SSD particle parameters, wherein the SSD particle parameters include an erase block time, a page number, a page read time, and a page write time;
[0008] Determine, according to a preset IOPS threshold, a second running time required for the data writing module to fully write one free block;
[0009] Determine a time slice coefficient according to the first running time and the second running time;
[0010] According to the time slice coefficient, determine the number of garbage collection time slices M and the number of data writing time slices N, wherein the ratio of the number of garbage collection time slices M to the number of data writing time slices N is equal to the time slice coefficient;
[0011] According to the number N of data writing time slices, determining whether it is necessary to allocate a data writing time slice to the data writing module, and if so, allocating one of the data writing time slices to the data writing module, and performing a data writing operation on the SSD through the data writing module within the data writing time slice;
[0012] If not, determine whether it is necessary to allocate a garbage collection time slice to the garbage collection module based on the number of garbage collection time slices M. If so, allocate a garbage collection time slice to the garbage collection module, and perform garbage collection operations on the SSD through the garbage collection module within the garbage collection time slice.
[0013] In one embodiment, judging whether it is necessary to allocate a data writing time slice to the data writing module according to the number N of data writing time slices includes:
[0014] Determine whether the number N of data writing time slices is greater than a first preset threshold value. If so, determine that the data writing time slice needs to be allocated to the data writing module; if not, determine that the data writing time slice does not need to be allocated to the data writing module.
[0015] In one embodiment, after allocating the data write time slice to the data write module, it also includes: determining that the number of data write time slices is N-1; obtaining the current number of free blocks of the SSD, and judging whether to continue to start the garbage collection module according to the current number of free blocks; if continuing to start, allocating the data write time slice to the data write module until the number of data write time slices is equal to the first preset threshold.
[0016] In one embodiment, the determining whether it is necessary to allocate garbage collection time slices to the garbage collection module based on the number M of garbage collection time slices includes: determining whether the number M of garbage collection time slices is greater than a second preset threshold value, and if so, determining that it is necessary to allocate the garbage collection time slices to the garbage collection module; if not, determining that it is not necessary to allocate the garbage collection time slices to the garbage collection module.
[0017] In one embodiment, after allocating a garbage collection time slice to the garbage collection module, it also includes: determining that the number of garbage collection time slices is M-1; obtaining the current number of free blocks of the SSD, and judging whether to continue starting the garbage collection module according to the current number of free blocks; if continuing to start, allocating a garbage collection time slice to the garbage collection module until the number of garbage collection time slices is equal to the second preset threshold.
[0018] In one embodiment, the current number of free blocks of the SSD is obtained, and whether to continue to start the garbage collection module is determined based on the current number of free blocks, including: comparing the current number of free blocks with a preset starting threshold of the garbage collection module, and if the number of free blocks is less than the preset starting threshold, starting the garbage collection module.
[0019] In one embodiment, the method further includes: when the number of data writing time slices is equal to a first preset threshold and the number of garbage collection time slices is equal to a second preset threshold, resetting the number of garbage collection time slices to M and resetting the number of time slices to N.
[0020] In a second aspect, the present invention provides an SSD write performance control device, the device comprising:
[0021] A first determination module is used to determine a first running time required for a garbage collection module to recycle a garbage block according to SSD particle parameters, wherein the SSD particle parameters include an erase block time, a page number, a page read time, and a page write time;
[0022] A second determination module is used to determine a second running time required for the data writing module to fill up a free block according to a preset IOPS threshold;
[0023] a coefficient determination module, configured to determine a time slice coefficient according to the first running time and the second running time;
[0024] A time slice determination module, used to determine the number of garbage collection time slices M and the number of data writing time slices N according to the time slice coefficient, wherein the ratio of the number of garbage collection time slices M to the number of data writing time slices N is equal to the time slice coefficient;
[0025] An execution module is used to determine whether it is necessary to allocate a data write time slice to the data write module based on the number of data write time slices N. If so, one of the data write time slices is allocated to the data write module, and a data write operation is performed on the SSD by the data write module within the data write time slice; if not, it is used to determine whether it is necessary to allocate a garbage collection time slice to the garbage collection module based on the number of garbage collection time slices M. If so, one of the garbage collection time slices is allocated to the garbage collection module, and a garbage collection operation is performed on the SSD by the garbage collection module within the garbage collection time slice.
[0026] In a third aspect, the present invention provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program runs on the processor, the SSD write performance control method described in the first aspect is executed.
[0027] In a fourth aspect, the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the SSD write performance control method described in the first aspect.
[0028] The SSD write performance control method, device, equipment and medium provided by the present invention determine the first running time required for a garbage collection module to recycle a garbage block according to SSD particle parameters, wherein the SSD particle parameters include erase block time, page number, page read time and page write time; determine the second running time required for a data write module to fill up a free block according to a preset IOPS threshold; determine a time slice coefficient according to the first running time and the second running time; determine the number of garbage collection time slices M and the number of data write time slices N according to the time slice coefficient, wherein the number of garbage collection time slices M and the number of data write time slices N are equal. The ratio is equal to the time slice coefficient; according to the number of data writing time slices N, it is judged whether it is necessary to allocate a data writing time slice for the data writing module, and if so, a data writing time slice is allocated to the data writing module, and a data writing operation is performed on the SSD by the data writing module within the data writing time slice; if not, according to the number of garbage collection time slices M, it is judged whether it is necessary to allocate a garbage collection time slice for the garbage collection module, and if so, a garbage collection time slice is allocated to the garbage collection module, and a garbage collection operation is performed on the SSD by the garbage collection module within the garbage collection time slice. The present invention determines the time slice coefficient according to the particle parameters of the SSD and the preset IOPS threshold, so as to reasonably allocate the running operation time of the garbage collection module and the data writing module, ensure the minimum writing time of the SSD, and improve the minimum writing performance of the SSD.
[0029] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and understandable, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0031] Figure 1 A schematic diagram of a process of a method for controlling SSD write performance provided by an embodiment of the present invention is shown;
[0032] Figure 2Another schematic diagram of the process of the SSD write performance control method provided by an embodiment of the present invention is shown;
[0033] Figure 3 Another schematic diagram of a flow chart of the SSD write performance control method provided by an embodiment of the present invention is shown;
[0034] Figure 4 A schematic diagram of the structure of an SSD write performance control device provided by an embodiment of the present invention is shown;
[0035] Figure 5 A schematic structural diagram of an electronic device provided by an embodiment of the present invention is shown.
[0036] Description of main component symbols:
[0037] 400 - SSD write performance control device; 410 - first determination module; 420 - second determination module; 430 - coefficient determination module; 440 - time slice determination module; 450 - execution module; 500 - electronic device; 501 - transceiver; 502 - processor; 503 - memory. DETAILED DESCRIPTION
[0038] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be understood as limiting the present invention.
[0039] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0040] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein in the specification of the template are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more of the related listed items.
[0041] Example 1
[0042] The embodiment of the present invention provides a method for controlling SSD write performance. For details, see Figure 1 , the method includes steps S110 to S160.
[0043] Step S110, determining a first running time required for a garbage collection module to recycle a garbage block according to SSD particle parameters, wherein the SSD particle parameters include erase block time, page number, page read time, and page write time.
[0044] It should be noted that due to the characteristics of the non-volatile flash memory chip (NAND Flash Memory Chip) in the SSD, new data must be written after being erased. Therefore, the SSD firmware has a garbage collection module (Garbage Collection, GC) for recycling invalid physical blocks in the SSD, that is, garbage blocks. The first running time required for the garbage collection module to recycle a garbage block can be calculated based on the SSD particle parameters. SSDs of different manufacturers and models may have different particle parameters. For details, you can refer to the SSD specification sheet or technical documentation.
[0045] In this embodiment, the first running time can be calculated based on the erase block time, page read time and page write time. The specific calculation formula is: first running time = erase block time + page read time × number of pages in the garbage block + page write time × number of pages in the garbage block.
[0046] Step S120: determining a second running time required for the data writing module to fully write a free block according to a preset IOPS threshold.
[0047] It should be noted that in some application scenarios, the write performance of the SSD is required to be no less than a certain minimum performance threshold, and the write performance of the SSD is mainly measured by the input / output operations per second (IOPS) of the SSD.
[0048] In this embodiment, according to the minimum performance IOPS requirement, the running time to fill a free block at the writing speed of the minimum performance IOPS is calculated, that is, the second running time. The specific calculation formula is: second running time = free block capacity / preset IOPS threshold, where the free block capacity can be obtained by referring to the technical documentation of the SSD, which is usually 4KB.
[0049] Step S130: determining a time slice coefficient according to the first running time and the second running time.
[0050] In this embodiment, the ratio of the first running time to the second running time is determined as the time slice coefficient.
[0051] Step S140, determining the number of garbage collection time slices M and the number of data writing time slices N according to the time slice coefficient, wherein the ratio of the number of garbage collection time slices M to the number of data writing time slices N is equal to the time slice coefficient.
[0052] In this embodiment, when there is a large amount of data waiting to be written to the SSD and the garbage collection module is turned on, the allocation of time slices can be dynamically adjusted according to the time slice coefficient and the current workload. For example, if the time slice coefficient is 1.5, it can be determined that the ratio of the time allocated to the garbage collection operation to the time allocated to the data writing operation should be 3:2, thereby determining the number of time slices allocated to the garbage collection module and the data writing module.
[0053] Step S150, based on the number N of data writing time slices, determine whether it is necessary to allocate a data writing time slice for the data writing module. If so, allocate a data writing time slice for the data writing module, and perform a data writing operation on the SSD through the data writing module within the data writing time slice.
[0054] It should be noted that the data write time slice refers to the maximum execution time allocated to the data write module to perform the data write operation. When the data write module obtains the data write time slice, it means that it has obtained the right to use the processor.
[0055] In this embodiment, when there is a large amount of data waiting to be written to the SSD and the garbage collection module is turned on, the data writing module first initiates a request for a time slice. When it is detected that the number of time slices allocated to the data writing module according to the time slice coefficient and the current workload of the SSD is N, and N is greater than a first preset threshold, a data writing time slice is allocated to the data writing module, and the number of time slices N pre-allocated to the data writing module is reduced by one accordingly.
[0056] In one embodiment, judging whether it is necessary to allocate data write time slices to the data write module based on the number of data write time slices N includes: judging whether the number of data write time slices N is greater than a first preset threshold value, and if so, determining that it is necessary to allocate the data write time slice to the data write module; if not, determining that it is not necessary to allocate the data write time slice to the data write module.
[0057] In this embodiment, the first preset threshold value may be 0. In other embodiments, the first preset threshold value may also be other values, which may be determined according to actual conditions and are not limited here.
[0058] After allocating a data writing time slice to the data writing module, the method further includes steps S151 to S153. For details, see Figure 2 .
[0059] Step S151, determining that the number of data writing time slices is N-1.
[0060] Step S152, obtaining the current number of free blocks of the SSD, and determining whether to continue starting the garbage collection module according to the current number of free blocks.
[0061] It should be noted that the garbage collection module is enabled only when the number of free blocks in the SSD is less than a preset startup threshold of the garbage collection module.
[0062] Step S153: if the startup continues, a data writing time slice is allocated to the data writing module until the number of the data writing time slices is equal to the first preset threshold.
[0063] In this embodiment, after the data write operation is performed within the data write time slice through the data write module, the number of free blocks changes due to new data writing. At this time, it is necessary to re-judge whether to continue to turn on the garbage collection module. If the garbage collection module continues to be turned on, continue to allocate data write time slices to the data write module, and repeat this operation until the data write time slice is equal to the first preset threshold, for example 0.
[0064] Step S160, if not, determine whether it is necessary to allocate a garbage collection time slice for the garbage collection module based on the number of garbage collection time slices M. If so, allocate a garbage collection time slice for the garbage collection module, and perform garbage collection operations on the SSD through the garbage collection module within the garbage collection time slice.
[0065] In this embodiment, when the number of data writing time slices of the data writing module is exhausted, that is, when the number of data writing time slices is equal to the first preset threshold, the garbage collection module starts to initiate a request for a time slice. When it is detected that the number of garbage collection time slices is M, and M is greater than the second preset threshold, for example 0, a garbage collection time slice is allocated to the garbage collection module, and the number of garbage collection time slices M is reduced by one accordingly.
[0066] In one embodiment, the determining whether it is necessary to allocate garbage collection time slices to the garbage collection module based on the number M of garbage collection time slices includes: determining whether the number M of garbage collection time slices is greater than a second preset threshold value, and if so, determining that it is necessary to allocate the garbage collection time slices to the garbage collection module; if not, determining that it is not necessary to allocate the garbage collection time slices to the garbage collection module.
[0067] In this embodiment, when the number of garbage collection time slices M is greater than a second preset threshold, for example 0, a garbage collection time slice is allocated to the garbage collection module. At this time, the garbage collection module obtains the right to use the processor and starts to perform garbage collection operations on the SSD. The operation time is the length of the garbage collection time slice.
[0068] After allocating a garbage collection time slice to the garbage collection module, the process further includes steps S161 to S163. For details, see Figure 3 .
[0069] Step S161, determining that the number of garbage collection time slices is M-1.
[0070] Step S162, obtaining the current number of free blocks of the SSD, and determining whether to continue starting the garbage collection module according to the current number of free blocks.
[0071] In this embodiment, after the garbage collection module obtains a garbage collection time slice and performs the garbage collection operation, the number of free blocks in the SSD changes. Therefore, it is necessary to re-determine whether to continue to enable the garbage collection module based on the current number of free blocks. If it continues to be enabled, the garbage collection module continues to request a time slice.
[0072] Step S163: if the startup continues, a garbage collection time slice is allocated to the garbage collection module until the number of garbage collection time slices is equal to the second preset threshold.
[0073] It should be noted that if the garbage collection module is not enabled, the data writing module can directly perform data writing operations.
[0074] In one embodiment, the current number of free blocks of the SSD is obtained, and whether to continue to start the garbage collection module is determined based on the current number of free blocks, including: comparing the current number of free blocks with a preset starting threshold of the garbage collection module, and if the number of free blocks is less than the preset starting threshold, starting the garbage collection module.
[0075] In this embodiment, the number of free blocks is monitored, and when the number of free blocks is less than a preset start threshold of the garbage collection module, the garbage collection module is started.
[0076] In one embodiment, the method further includes: when the number of data writing time slices is equal to a first preset threshold and the number of garbage collection time slices is equal to a second preset threshold, resetting the number of garbage collection time slices to M and resetting the number of time slices to N.
[0077] In this embodiment, when the number of data writing time slices is equal to the first preset threshold and the number of garbage collection time slices is equal to the second preset threshold, it means that the current data writing and garbage collection process is ended. At this time, the number of garbage collection time slices and the number of data writing time slices need to be reset according to the time slice coefficient.
[0078] The SSD write performance control method provided by the present invention comprises: determining a first running time required for a garbage collection module to recycle a garbage block according to SSD particle parameters, wherein the SSD particle parameters include erase block time, page number, page read time and page write time; determining a second running time required for a data write module to fill up a free block according to a preset IOPS threshold; determining a time slice coefficient according to the first running time and the second running time; determining a garbage collection time slice number M and a data write time slice number N according to the time slice coefficient, wherein the ratio of the garbage collection time slice number M to the data write time slice number N is The ratio is equal to the time slice coefficient; according to the number of data writing time slices N, it is determined whether it is necessary to allocate a data writing time slice for the data writing module; if so, a data writing time slice is allocated to the data writing module, and a data writing operation is performed on the SSD by the data writing module within the data writing time slice; if not, according to the number of garbage collection time slices M, it is determined whether it is necessary to allocate a garbage collection time slice for the garbage collection module; if so, a garbage collection time slice is allocated to the garbage collection module, and a garbage collection operation is performed on the SSD by the garbage collection module within the garbage collection time slice. The present invention determines the time slice coefficient according to the particle parameters of the SSD and the preset IOPS threshold, so as to reasonably allocate the running operation time of the garbage collection module and the data writing module, ensure the minimum writing time of the SSD, and improve the minimum writing performance of the SSD.
[0079] Example 2
[0080] In addition, an embodiment of the present invention further provides an SSD write performance control device. For details, see Figure 4 , the SSD write performance control device 400 includes:
[0081] A first determination module 410 is used to determine a first running time required for a garbage collection module to recycle a garbage block according to SSD particle parameters, wherein the SSD particle parameters include an erase block time, a page number, a page read time, and a page write time;
[0082] A second determination module 420, configured to determine a second running time required for the data writing module to fully write a free block according to a preset IOPS threshold;
[0083] A coefficient determination module 430, configured to determine a time slice coefficient according to the first running time and the second running time;
[0084] A time slice determination module 440 is used to determine the number of garbage collection time slices M and the number of data writing time slices N according to the time slice coefficient, wherein the ratio of the number of garbage collection time slices M to the number of data writing time slices N is equal to the time slice coefficient;
[0085] The execution module 450 is used to determine whether it is necessary to allocate a data write time slice to the data write module based on the number of data write time slices N. If so, a data write time slice is allocated to the data write module, and a data write operation is performed on the SSD by the data write module within the data write time slice; if not, it is used to determine whether it is necessary to allocate a garbage collection time slice to the garbage collection module based on the number of garbage collection time slices M. If so, a garbage collection time slice is allocated to the garbage collection module, and a garbage collection operation is performed on the SSD by the garbage collection module within the garbage collection time slice.
[0086] An SSD write performance control device provided by an embodiment of the present invention comprises a first determination module for determining a first running time required for a garbage collection module to recycle a garbage block according to SSD particle parameters, wherein the SSD particle parameters include erase block time, page number, page read time, and page write time; a second determination module for determining a second running time required for a data write module to fill up a free block according to a preset IOPS threshold; a coefficient determination module for determining a time slice coefficient according to the first running time and the second running time; a time slice determination module for determining a garbage collection time slice number M and a data write time slice number N according to the time slice coefficient, wherein the garbage collection time slice number The ratio of the quantity M to the number of data writing time slices N is equal to the time slice coefficient; an execution module is used to determine whether it is necessary to allocate a data writing time slice to the data writing module according to the number of data writing time slices N, and if so, allocate a data writing time slice to the data writing module, and perform a data writing operation on the SSD through the data writing module within the data writing time slice; if not, determine whether it is necessary to allocate a garbage collection time slice to the garbage collection module according to the number of garbage collection time slices M, and if so, allocate a garbage collection time slice to the garbage collection module, and perform a garbage collection operation on the SSD through the garbage collection module within the garbage collection time slice. The present invention determines the time slice coefficient according to the particle parameters of the SSD and the preset IOPS threshold, so as to reasonably allocate the running operation time of the garbage collection module and the data writing module, ensure the minimum writing time of the SSD, and improve the minimum writing performance of the SSD.
[0087] Example 3
[0088] In addition, an embodiment of the present invention provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program runs on the processor, the SSD write performance control method provided in Example 1 is executed.
[0089] For details, see Figure 5 The electronic device 500 includes: a transceiver 501, a bus interface and a processor 502, wherein the processor 502 is used to determine the first running time required for the garbage collection module to recycle a garbage block according to the SSD particle parameters, and the SSD particle parameters include the erase block time, the number of pages, the page read time and the page write time; determine the second running time required for the data write module to fill up a free block according to the preset IOPS threshold; determine the time slice coefficient according to the first running time and the second running time; determine the number of garbage collection time slices M and the number of data write time slices N according to the time slice coefficient, and the number of garbage collection time slices M and the number of data write time slices N are The ratio of the number of write time slices N is equal to the time slice coefficient; based on the number of data write time slices N, determine whether it is necessary to allocate a data write time slice to the data write module; if so, allocate a data write time slice to the data write module, and perform a data write operation on the SSD through the data write time slice; if not, based on the number of garbage collection time slices M, determine whether it is necessary to allocate a garbage collection time slice to the garbage collection module; if so, allocate a garbage collection time slice to the garbage collection module, and perform a garbage collection operation on the SSD through the garbage collection module within the garbage collection time slice.
[0090] In the embodiment of the present invention, the electronic device 500 further includes a memory 503. Figure 5 In the embodiment, the bus architecture may include any number of interconnected buses and bridges, specifically linking various circuits of one or more processors represented by processor 502 and memory represented by memory 503. The bus architecture may also link various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. The bus interface provides an interface. The transceiver 501 may be a plurality of components, i.e., including a transmitter and a receiver, providing a unit for communicating with various other devices on a transmission medium. The processor 502 is responsible for managing the bus architecture and general processing, and the memory 503 may store data used by the processor 502 when performing operations.
[0091] The electronic device 500 provided in the embodiment of the present invention can execute the SSD write performance control method provided in the above method embodiment 1, which will not be described again here to avoid repetition.
[0092] Example 4
[0093] In addition, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the SSD write performance control method provided in Example 1 is implemented.
[0094] In this embodiment, the computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0095] The computer-readable storage medium provided in this embodiment can implement the SSD write performance control method provided in Example 1, and will not be described again here to avoid repetition.
[0096] In all examples shown and described herein, any specific values should be interpreted as merely exemplary and not as limiting, and thus other examples of the exemplary embodiments may have different values.
[0097] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0098] The above-mentioned embodiments only express several implementation methods of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the present invention. It should be pointed out that for ordinary technicians in this field, several modifications and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention.
Claims
1. A method for regulating SSD write performance. It is characterized in that The method comprises: Determining a first running time required for a garbage collection module to recycle a garbage block according to SSD particle parameters, wherein the SSD particle parameters include an erase block time, a page number, a page read time, and a page write time; Determine, according to a preset IOPS threshold, a second running time required for the data writing module to fully write one free block; Determine a time slice coefficient according to the first running time and the second running time; According to the time slice coefficient, determine the number of garbage collection time slices M and the number of data writing time slices N, wherein the ratio of the number of garbage collection time slices M to the number of data writing time slices N is equal to the time slice coefficient; According to the number N of data writing time slices, determining whether it is necessary to allocate a data writing time slice to the data writing module, and if so, allocating one of the data writing time slices to the data writing module, and performing a data writing operation on the SSD through the data writing module within the data writing time slice; If not, determine whether it is necessary to allocate a garbage collection time slice to the garbage collection module based on the number of garbage collection time slices M. If so, allocate a garbage collection time slice to the garbage collection module, and perform garbage collection operations on the SSD through the garbage collection module within the garbage collection time slice.
2. The SSD write performance control method according to claim 1, It is characterized in that The determining, according to the number N of data writing time slices, whether it is necessary to allocate a data writing time slice to the data writing module comprises: Determine whether the number N of the data writing time slices is greater than a first preset threshold, and if so, determine that the data writing time slice needs to be allocated to the data writing module; If not, it is determined that the data writing time slice does not need to be allocated to the data writing module.
3. The SSD write performance control method according to claim 2, It is characterized in that After allocating the data writing time slice to the data writing module, the method further includes: Determine that the number of time slices for writing the data is N-1; Obtain the current number of free blocks of the SSD, and determine whether to continue to start the garbage collection module according to the current number of free blocks; If the startup continues, a data writing time slice is allocated to the data writing module until the number of the data writing time slices is equal to the first preset threshold.
4. The SSD write performance control method according to claim 1, It is characterized in that The determining, based on the number M of garbage collection time slices, whether it is necessary to allocate garbage collection time slices to the garbage collection module includes: Determine whether the number M of garbage collection time slices is greater than a second preset threshold, and if so, determine that the garbage collection time slice needs to be allocated to the garbage collection module; If not, it is determined that the garbage collection time slice does not need to be allocated to the garbage collection module.
5. The SSD write performance control method according to claim 4, It is characterized in that After allocating the garbage collection time slice to the garbage collection module, the method further includes: Determine the number of garbage collection time slices to be M-1; Obtain the current number of free blocks of the SSD, and determine whether to continue to start the garbage collection module according to the current number of free blocks; If the startup continues, a garbage collection time slice is allocated to the garbage collection module until the number of the garbage collection time slices is equal to the second preset threshold.
6. The SSD write performance control method according to claim 3 or 5, It is characterized in that The obtaining the current number of free blocks of the SSD and determining whether to continue to start the garbage collection module according to the current number of free blocks includes: The current number of free blocks is compared with a preset start threshold of the garbage collection module, and if the number of free blocks is less than the preset start threshold, the garbage collection module is started.
7. The SSD write performance control method according to claim 6, It is characterized in that The method further comprises: When the number of data writing time slices is equal to a first preset threshold, and the number of garbage collection time slices is equal to a second preset threshold, the number of garbage collection time slices is reset to M, and the number of time slices is reset to N.
8. A SSD write performance control device, It is characterized in that The device comprises: A first determination module is used to determine a first running time required for a garbage collection module to recycle a garbage block according to SSD particle parameters, wherein the SSD particle parameters include an erase block time, a page number, a page read time, and a page write time; A second determination module, used to determine a second running time required for the data writing module to fill up a free block according to a preset IOPS threshold; a coefficient determination module, configured to determine a time slice coefficient according to the first running time and the second running time; A time slice determination module, used to determine the number of garbage collection time slices M and the number of data writing time slices N according to the time slice coefficient, wherein the ratio of the number of garbage collection time slices M to the number of data writing time slices N is equal to the time slice coefficient; An execution module is used to determine whether it is necessary to allocate a data write time slice to the data write module based on the number of data write time slices N. If so, one of the data write time slices is allocated to the data write module, and a data write operation is performed on the SSD by the data write module within the data write time slice; if not, it is used to determine whether it is necessary to allocate a garbage collection time slice to the garbage collection module based on the number of garbage collection time slices M. If so, one of the garbage collection time slices is allocated to the garbage collection module, and a garbage collection operation is performed on the SSD by the garbage collection module within the garbage collection time slice.
9. An electronic device, It is characterized in that The method comprises a memory and a processor, wherein the memory stores a computer program, and when the computer program is run on the processor, the method for controlling the SSD write performance according to any one of claims 1 to 7 is executed.
10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the SSD write performance control method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Management method, system and equipment of memory chip and storage medium
CN108089822A
User write-in speed control method and device, equipment and medium
CN112416255A
Method for reducing writing performance fluctuation of solid state disk
CN114153381A
Solid state disk dynamic garbage collection method and solid state disk
CN115687174A
Flow control method and device of solid state disk (SSD), storage medium and equipment
CN116126253A
Cited By
Command management method, storage control chip and flash memory device
CN119473139A
