Method for improving performance stability of solid state disk
By dynamically adjusting the priority of the SSD channel and the number of processing requests, the problem of insufficient performance stability of the SSD is solved, and a more stable performance operation curve and a smaller host write performance impact is achieved.
Patent Information
- Application Number
- CN202411771361.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-04
- Publication Date
- 2025-03-11
AI Technical Summary
The existing solid-state drives have insufficient performance stability and cannot meet the high requirements of video and game fluency for stable hard drive performance.
By processing channel requests in priority order when running a solid state drive, dynamically adjusting the priority of each channel and the number of single processing requests, and adjusting them according to the queue length, waiting time and bandwidth of the channel.
It achieves more stable performance of solid-state drives, more straighter performance operation curves, and minimal impact on host write performance.
Smart Images

Figure CN119597223A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of solid state hard disks, and in particular to a method for improving the performance stability of solid state hard disks. Background Art
[0002] The performance of the solid-state drive refers to the host read and write performance. The underlying layers of various tasks within the SSD all request FLASH operations, so the host read and write performance will be affected by multiple other tasks.
[0003] Most current SSDs use the strategy of controlling GC to adjust stability, but the fluctuation space is still large. Because there are many factors that affect performance stability, only controlling GC can achieve a certain effect on performance stability, but the performance fluctuation space is still not very rational.
[0004] Now our life has entered the era of short videos and large-scale games. The smoothness of videos and games places increasingly higher demands on the stability of hard disk performance. The current performance stabilization methods no longer meet the requirements. Summary of the invention
[0005] The present application solves the problem of insufficient performance stability of solid-state hard disks in the prior art by providing a method for improving the performance stability of solid-state hard disks, thereby achieving a technical effect of more stable performance and a flatter performance operation curve.
[0006] The present application embodiment provides a method for improving the performance stability of a solid state drive, which includes the following steps when the solid state drive is running: S1: Select a relatively high-priority channel from all channels in order of priority, set the state to keep grant, obtain the length requests in front of the queue in this channel, and process them, where length is the number of requests processed at a time; S2: After the channel that keeps the grant has processed length requests, release the grant; check whether there are any unprocessed requests in all channels. If so, execute S3, otherwise execute S4; S3: readjust the priority of each channel and the number of requests processed at a single time according to the impact factor and the corresponding weight, and return to execute S1; S4: Restore the priority of all channels and the number of requests processed at a time to the default configuration state.
[0007] Based on the above embodiments, the present application can be further improved as follows: In one embodiment of the present application, the method loads a default configuration when the solid-state drive is initialized. In the default configuration, multi-task requests are divided into several channels by category, and each channel is given a preset priority and the number of requests to be processed at a single time.
[0008] In one of the embodiments of the present application, the channels include five channels: host write, garbage collection write, table write, table garbage collection write, and system write.
[0009] In one of the embodiments of the present application, in step S3, the influencing factors include: the number of waiting requests in the queue of the channel, the waiting time of the channel, and the bandwidth of the channel.
[0010] In one of the embodiments of the present application, in step S3, the adjustment method is as follows: the score of each channel is calculated according to the impact factor and the corresponding weight, and the priority of each channel and the number of processing requests are reset according to the comparison between the score and the preset threshold.
[0011] In one embodiment of the present application, in step S3, the score calculation method is as follows: Credit i =waittime i * weight i1 + queue length i * weight i2 + bandwidth i *weight i3 ; Among them, Credit i Indicates the score of the i-th channel, waittime i Indicates the waiting time of the i-th channel, queuelength i Indicates the number of waiting requests in the queue of the i-th channel, bandwidth i Indicates the bandwidth of the i-th channel, weight i1 、weight i2 、weight i3 Represented as the corresponding weight.
[0012] In one embodiment of the present application, in step S3, the total value of all the weights is a fixed value, which is pre-allocated to each of the impact factors of each of the channels according to the degree of impact.
[0013] In one of the embodiments of the present application, the method monitors the hard disk status in real time during the operation of the solid-state hard disk; if it is detected that the table write and table garbage collection write channels are started from 0 or the bandwidth suddenly fluctuates greatly, the priority of the garbage collection write channel and the number of processing requests are reduced as set; when an emergency state is detected, the priority of each channel is directly adjusted according to the preset and processed in sequence.
[0014] In one of the embodiments of the present application, the priority is divided into high H, medium M, or low L, and the priority of the host write channel is always maintained at high H or medium M.
[0015] The beneficial effect of the above embodiment is that the method selects the factors that affect the host write performance, and flexibly and dynamically adjusts the priority and processing length of each channel, always ensuring that the host write performance is minimally affected, the performance is more stable, and the performance operation curve is flatter. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following is a brief introduction to the drawings required for the specific embodiments or the description of the prior art. In all the drawings, similar elements or parts are generally identified by similar reference numerals. In the drawings, the elements or parts are not necessarily drawn according to the actual scale.
[0017] Figure 1 This is a flowchart of the steps of a method for improving the performance stability of a solid state drive in an embodiment of the present application. DETAILED DESCRIPTION
[0018] The present invention is further explained below in conjunction with specific implementation methods. It should be understood that these implementation methods are only used to illustrate the present invention and are not used to limit the scope of the present invention. After reading the present invention, various equivalent forms of modifications to the present invention by those skilled in the art all fall within the scope defined by the claims attached to this application.
[0019] 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.
[0020] The embodiment of the present application solves the problem of insufficient performance stability of solid-state hard disks in the prior art by providing a method for improving the performance stability of solid-state hard disks, thereby achieving a technical effect of more stable performance and a flatter performance operation curve.
[0021] The technical solution in the embodiment of the present application is to solve the above problems, and the overall idea is as follows: Example: like Figure 1 As shown, a method for improving the performance stability of a solid state drive comprises the following steps: initialization: S0: The default configuration is loaded when the hard disk is started or initialized. In the default configuration, multi-task requests are divided into several channels by category, and each channel is given a preset priority and the number of single processing requests. For example, in this example, the task requests are divided into five channels: host write, garbage collection write, table write, table garbage collection write, and system write, and the corresponding priorities are high H, medium M, or low L. Among them, the total write speed of the storage chip in the hard disk is limited and fixed, but there are multiple channels for writing, and the upper-level devices such as servers and personal computers only pay attention to host writes, so the speed stability of the "host write" channel is the main parameter of the hard disk. Therefore, the priority of "host write" is generally always kept at high H or medium M.
[0022] Running: S1: Select a relatively high-priority channel from all channels in order of priority, set the state to keep grant (that is, the channel obtains the system execution right and maintains exclusive use), obtain the length requests in front of the queue in this channel, and process them; S2: After the channel that keeps the grant has executed length requests, it releases the grant (i.e. releases the execution right after execution); it checks whether there are any unprocessed requests in all channels. If so, it executes S3; if not (i.e. the hard disk enters the idle state), it executes S4; S3: Recalculate (i.e. dynamically adjust) the priority (priority) of each channel and the number (length) of requests processed at a time based on the impact factor and the corresponding weight, and return to execute S1; S4: After determining that all requests in all channels have been processed, the priority (priority) and the number of processed requests (length) of all channels are restored to the default configuration state.
[0023] In step S3, the factors affecting the adjustment of the priority and the number of requests processed at a single time include: the number of waiting requests in the queue of the channel (queue length), the channel waiting time (wait time), and the channel bandwidth (bandwidth).
[0024] According to different SSD system states, such as steady-state operation, different weights are assigned to each impact factor. The impact factor is combined with the weight to calculate the credit of each channel. Each channel resets its priority and the number of processing requests based on the credit.
[0025] When the credit reaches the threshold corresponding to the priority, the priority and the number of requests processed are adjusted upward or downward, otherwise they remain unchanged. Example: For a channel with a middle priority of M and a number of requests processed of L2, if the credit is lower than the low L threshold after calculation, the priority of the channel is adjusted to low L; if it exceeds the high H threshold, the priority of the channel is adjusted to high H; if the credit is lower than the L1 threshold after calculation, the number of requests processed by the channel is adjusted to L1; if it is higher than the L3 threshold, the number of requests processed by the channel is adjusted to L3 (L1<L2<L3).
[0026] The credit calculation method is as follows: Credit i =waittime i * weight i1 + queue length i * weight i2 + bandwidth i *weight i3 ; Among them, Credit i Indicates the score of the i-th channel, waittime i Indicates the waiting time of the i-th channel, queuelength i Indicates the number of waiting requests in the queue of the i-th channel, bandwidth i Indicates the bandwidth of the i-th channel, weight i1 、weight i2 、weight i3 Represented as the corresponding weight.
[0027] Among them, the total value of all weights is a fixed value, such as 10, which is pre-allocated to each influencing factor of each channel according to the degree of influence, that is: ; In this example, M is 10 and n is 5.
[0028] Furthermore, the method monitors the hard disk status in real time during the operation of the solid-state hard disk, and processes the hard disk in steady-state operation according to the above method. For example, when the channel bandwidth of table writing, table garbage collection writing, and system writing is 0 or the bandwidth is stable (the fluctuation is within 20% compared with the historical average), and garbage collection is the determining factor, the number (length) of processing requests of the garbage collection channel is adjusted by the score to control the real-time bandwidth of garbage collection, so as to prevent garbage collection from being too fast or too slow, thereby affecting the host write performance; If jitter is detected, such as when table writes or table garbage collection writes start from 0 or the bandwidth suddenly jitters significantly (greater than 20% of the historical average), the priority of garbage collection writes and the number of processing requests (length) are reduced according to the settings to reduce the bandwidth (bandwidth) so that the jitter of the table can be absorbed by garbage collection to avoid affecting the host write; If an urgent state (such as power failure) is detected, the priority of each channel is adjusted according to the preset, such as processing all requests of each channel in the order of host write, table write, and system write.
[0029] Furthermore, when there are multiple channels with the same priority level, if the system has set the dependency between the channels, they are executed according to the dependency; if the system has not set it, they are executed alternately according to the zipper principle.
[0030] The technical solutions in the above embodiments of the present application have at least the following technical effects or advantages: 1. This method selects the factors that affect the host write performance, and flexibly and dynamically adjusts the priority and processing length to always ensure that the host write performance is minimally affected, the performance is more stable, and the performance operation curve is flatter.
[0031] 2. This method aims to minimize the impact of other channels on the host while taking into account the overall mechanism of the hard disk. That is, "host write" always maintains high H or medium M priority, and other channels reduce the impact on "host write" by controlling priority and the number of processing requests.
[0032] 3. This method presets emergency processing under special conditions. For example, when the amount of data to be written by "table write" is large, the speed of "host write" will be significantly reduced. By adjusting the priority and the number of processing requests, the speed of "host write" is less affected, and the requests of other channels can also be completed within a reasonable time.
[0033] A solid state drive is also provided in an embodiment of the present application. By adopting the above method, the performance of the solid state drive is more stable. During internal experiments, the performance fluctuation in steady state is reduced from less than 20% to less than 5%.
[0034] It should also be noted that the various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction. In order to avoid unnecessary repetition, the present invention will not further describe various possible combinations.
Claims
1. A method for improving the performance stability of a solid state drive, characterized in that: When the SSD is running, the following steps are included: S1: select the channel with a relatively high priority from all channels in order of priority, set the state to keep grant, obtain the length requests in front of the queue in the channel, and process them, where length is the number of processed requests; S2: After the channel that keeps the grant has processed length requests, release the grant; check whether there are any unprocessed requests in all the channels, if so, execute S3, otherwise execute S4; S3: readjust the priority and the number of processing requests corresponding to each channel according to the impact factor and the corresponding weight, and return to execute S1; S4: Restore the priorities and the number of single processing requests of all the channels to the default configuration state.
2. The method according to claim 1, characterized in that: When the solid state drive is initialized, a default configuration is loaded. In the default configuration, multi-task requests are divided into a plurality of channels by category, and the priority and the number of processing requests are preset for each channel respectively.
3. The method according to claim 2, characterized in that: The channels include five channels: host write, garbage collection write, table write, table garbage collection write, and system write.
4. The method according to claim 1, characterized in that: In step S3, the influencing factors include: the number of waiting requests in the queue of the channel, the waiting time of the channel, and the bandwidth of the channel.
5. The method according to claim 4, characterized in that: In the step S3, the adjustment method is as follows: the score of each channel is calculated according to the impact factor and the corresponding weight, and the priority and the number of processing requests of each channel are reset according to the comparison between the score and the preset threshold.
6. The method according to claim 5, characterized in that: In step S3, the score calculation method is as follows: Credit i = waittime i * weight i1 + queue length i * weight i2 + bandwidth i * weight i3 ; Among them, Credit i Indicates the score of the i-th channel, waittime i Indicates the waiting time of the i-th channel, queuelength i Indicates the number of waiting requests in the queue of the i-th channel, bandwidth i Indicates the bandwidth of the i-th channel, weight i1 、weight i2 、weight i3 Represented as the corresponding weight.
7. The method according to claim 6, characterized in that: In the step S3, the total value of all the weights is a fixed value, which is pre-allocated to each of the impact factors of each of the channels according to the impact degree.
8. The method according to claim 3, characterized in that: The method monitors the hard disk status in real time during the operation of the solid-state hard disk; if it is detected that the table write and table garbage collection write channels are started from 0 or the bandwidth suddenly fluctuates greatly, the priority of the garbage collection write channel and the number of processing requests are reduced according to the settings; when an emergency state is detected, the priority of each channel is directly adjusted according to the preset and processed in sequence.
9. The method according to claim 3, characterized in that: The priority is divided into high (H), medium (M), or low (L).
10. A solid state hard disk, characterized in that: Adopt the method described in any one of claims 1-9.