Register configuration parameter optimization method and device and storage equipment
By detecting and matching the optimal aggregation parameter combination configuration register, the problem of interrupt processing pressure of high-speed NVMe SSD under high-intensity IO load is solved, and the random read and write performance of the storage device and the efficiency of the interrupt aggregation function are improved.
Patent Information
- Application Number
- CN202410875540.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-02
- Publication Date
- 2024-10-01
AI Technical Summary
High-speed NVMe SSDs may cause intensive IO interrupt events under high-intensity IO loads, causing interrupt processing pressure on the host CPU. Existing tools cannot provide interrupt aggregation parameter recommendations for specific scenarios, resulting in limited controller performance.
When receiving the target command to be processed, determine its queue depth. If the depth is greater than the preset threshold, set multiple aggregation parameter combinations, detect the read and write rates under each combination within the preset polling time, and match the optimal aggregation parameter combination. Use the configuration register to implement the interrupt aggregation function.
Significantly improve the read and write performance of storage devices, improve the efficiency and reliability of the interrupt aggregation function, and adapt to different platforms and read and write command combinations.
Smart Images

Figure CN118732953A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of hard disks, and in particular to a register configuration parameter optimization method, apparatus and storage device. Background Art
[0002] Due to the extremely high IO processing capability, high-speed NVMe SSDs may generate dense IO interrupt events under high-intensity IO load conditions, which will cause relatively large interrupt processing pressure on the host CPU. If the host does not handle the interrupt in time, the controller performance will not reach its maximum value, and the speed limit of both is limited by the host.
[0003] Since the interrupt aggregation parameter is a recommended value for the controller when the host processes data, the tools currently used are ever-changing, and the operating system cannot give a specific recommended value for a certain scenario. Therefore, most platforms currently do not configure this value. In order to improve random read and write performance, the controller can improve the read and write speed of the device on the host by adopting a manufacturer-defined interrupt aggregation algorithm. In the face of different host platforms resulting in different processing speeds for interrupts, the interrupt aggregation algorithm should be applicable to different platforms and be able to improve the random read and write speed on each platform. This requires the algorithm to be adaptive. Therefore, how to improve the random read and write performance of the hard disk by setting the interrupt aggregation parameter is an urgent problem to be solved. Summary of the invention
[0004] In a first aspect, the present application provides a register configuration parameter optimization method, comprising:
[0005] If a target command to be processed is received, determining the depth of the queue for incoming target commands;
[0006] When the depth is greater than a preset depth threshold, multiple aggregation parameter combinations are set, and within a preset polling time, the corresponding read and write rates of the configuration register when processing the target command under the configuration of each aggregation parameter combination are detected in sequence;
[0007] According to the detected read and write rate results, an optimal aggregation parameter combination is matched from each of the aggregation parameter combinations; the optimal aggregation parameter combination is used to configure the parameters of the configuration register so that the configuration register achieves the interrupt aggregation function.
[0008] In an optional embodiment, it also includes:
[0009] If the depth is not greater than the preset depth threshold, the parameter configuration operation of the configuration register is not performed.
[0010] In an optional embodiment, it also includes:
[0011] If the depth of the queue for the incoming target command cannot be determined, and the read and write rate of the configuration register is greater than the first preset rate value and less than the second preset rate value, setting different aggregation parameter combinations;
[0012] Within the preset polling time, sequentially detecting the corresponding read and write rates of the configuration register when processing the target command within the same time period when different aggregation parameter combinations are configured;
[0013] If the read / write rate under the subsequent aggregation parameter combination is lower than the read / write rate under the current aggregation parameter combination by a preset ratio value, the current aggregation parameter combination is used as the optimal aggregation parameter combination.
[0014] In an optional implementation manner, after taking the current aggregation parameter combination as the optimal aggregation parameter combination, the method further includes:
[0015] If any one of the following conditions is met, jump to the step of sequentially detecting the corresponding read and write rates of the configuration register when processing the target command in the same time period under the condition of configuring different aggregation parameter combinations within the preset polling time, so as to perform the next polling;
[0016] Condition 1: the read and write rate of the configuration register is less than the first preset rate value and greater than the second preset rate value;
[0017] Condition 2: the preset polling time is reached.
[0018] In an optional implementation manner, matching the detected read / write rate results from the aggregation parameter combinations to obtain the optimal aggregation parameter combination includes:
[0019] If the read / write rate under the next aggregation parameter combination is lower than the read / write rate under the current aggregation parameter combination by a preset ratio value, the current aggregation parameter combination is used as the optimal aggregation parameter combination;
[0020] Or, when the read / write rate under the last aggregation parameter combination is greater than the read / write rate under each previous aggregation parameter combination, the last aggregation parameter combination is used as the optimal aggregation parameter combination.
[0021] In an optional implementation manner, the aggregation parameter combination includes an aggregation threshold, or a parameter combination of the aggregation threshold and an aggregation time;
[0022] If the aggregation parameter combination includes the aggregation threshold, setting multiple aggregation parameter combinations includes:
[0023] A plurality of aggregation thresholds are set based on the depth, specifically including:
[0024] The values are taken starting from zero until the last value is equal to the value of the depth, and each selected value is used as the corresponding aggregation threshold.
[0025] In an optional implementation manner, after obtaining the optimal aggregation parameter combination from the aggregation parameter combinations according to the detected read / write rate results, the method further includes:
[0026] If the preset polling time is reached, jump to the step of sequentially detecting the corresponding read and write rates of the configuration register when processing the target command under the configuration of each aggregation parameter combination within the preset polling time to perform the next polling.
[0027] In a second aspect, the present application provides a register configuration parameter optimization device, comprising:
[0028] A determination module, configured to determine the depth of a queue for incoming target commands when receiving a target command to be processed;
[0029] A polling module, configured to set a plurality of aggregation parameter combinations when the depth is greater than a preset depth threshold, and sequentially detect, within a preset polling time, a corresponding read and write rate when the configuration register processes the target command under the configuration of each of the aggregation parameter combinations;
[0030] The polling module is used to match the optimal aggregation parameter combination from each aggregation parameter combination according to the detected read and write rate results; the optimal aggregation parameter combination is used to configure the parameters of the configuration register so that the configuration register can achieve the interrupt aggregation function.
[0031] In a third aspect, the present application provides a storage device, including a configuration register, a memory and a processor, wherein the memory stores a computer program, and the processor is used to execute the computer program to implement the aforementioned register configuration parameter optimization method.
[0032] In a fourth aspect, the present application provides a computer storage medium storing a computer program, which, when executed, implements the aforementioned register configuration parameter optimization method.
[0033] The embodiments of the present application have the following beneficial effects:
[0034] The embodiment of the present application provides a register configuration parameter optimization method, the method comprising: if a target command to be processed is received, determining the depth of the queue of the incoming target command; when the depth is greater than a preset depth threshold, setting multiple aggregation parameter combinations, and in a preset polling time, sequentially detecting the corresponding read and write rates of the configuration register when processing the target command under the configuration of each aggregation parameter combination; according to the detected read and write rate results, matching the optimal aggregation parameter combination from each aggregation parameter combination; the optimal aggregation parameter combination is used to configure the parameters of the configuration register so that the configuration register achieves the interrupt aggregation function. The embodiment of the present application performs aggregation parameter optimization on the configuration register in advance to match the optimal aggregation parameter, so that when the register parameters are configured based on the optimal aggregation parameter, the read and write performance of the storage device can be significantly improved, which helps to improve the efficiency and reliability of the interrupt aggregation function, and can also improve the random read and write performance of the storage device under a variety of read and write command combinations. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the technical solution of the present application, the following is a brief introduction to the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present application and should not be regarded as limiting the scope of protection of the present application. In each of the drawings, similar components are numbered similarly.
[0036] Figure 1 A first flow chart of a register configuration parameter optimization method according to an embodiment of the present application is shown;
[0037] Figure 2 A second flow chart of the register configuration parameter optimization method according to an embodiment of the present application is shown;
[0038] Figure 3 A structural schematic diagram of a register configuration parameter optimization device in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0039] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments.
[0040] The components of the embodiments of the present application generally described and shown in the drawings herein may be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0041] Hereinafter, the terms "including", "having" and their cognates, which may be used in various embodiments of the present application, are intended only to indicate specific features, numbers, steps, operations, elements, components, or combinations of the foregoing items, and should not be understood as first excluding the existence of one or more other features, numbers, steps, operations, elements, components, or combinations of the foregoing items or adding the possibility of one or more features, numbers, steps, operations, elements, components, or combinations of the foregoing items.
[0042] Furthermore, the terms “first”, “second”, “third”, etc. are merely used for distinguishing descriptions and are not to be understood as indicating or implying relative importance.
[0043] Unless otherwise defined, all terms (including technical terms and scientific terms) used herein have the same meanings as those generally understood by those skilled in the art to which the various embodiments of the present application belong. The terms (such as those defined in generally used dictionaries) will be interpreted as having the same meanings as the contextual meanings in the relevant technical field and will not be interpreted as having idealized meanings or overly formal meanings unless clearly defined in the various embodiments of the present application.
[0044] Queue Depth refers to the maximum number of packets that can be accommodated in a queue used to store and process packets in a network device or system.
[0045] In order to improve performance, reduce latency and CPU utilization of HOST (host) processing interrupt services, HOST currently chooses MSI-X interrupt mode, which is more common. Interrupt aggregation (nvme Specification), also known as interrupt merging, aims to reduce the interrupt service overhead of HOST by reducing the interrupt request frequency of the HOST internal controller (Controller). This way of reducing HOST expenses usually comes at the cost of increased latency. Among them, the aggregation threshold (Aggregation Threshold) represents the minimum interrupt aggregation threshold that HOST expects on a per-interrupt vector basis. This value defines the number of completion queue entries (Completion Queue Entries) when interrupt aggregation is performed on each interrupt vector to reduce the HOST processing overhead to below the threshold level. The aggregation time (Aggregation Time) represents the maximum delay time that HOST expects before generating an interrupt signal to HOST. This value is a recommended value given by HOST to Controller. Interrupts can be triggered before or after this time arrives. Controller can use this value on a certain interrupt or all interrupts.
[0046] Due to the extremely high IO processing capability, high-speed NVMe SSDs may generate dense IO interrupt events under high-intensity IO load conditions, which will cause relatively large interrupt processing pressure on the host CPU. If the host does not handle the interrupt in time, the controller's performance will not reach its maximum value, and the speed limit of both is limited by the host.
[0047] Since interrupt aggregation is a recommended value for the controller when the host processes data, the tools currently used are ever-changing, and the operating system cannot give a specific recommended value for a certain scenario. Therefore, most platforms currently do not configure this value. In order to improve random read and write performance, the controller uses a manufacturer-defined interrupt aggregation algorithm to improve the read and write speed of the device on the host. In the face of different host platforms resulting in different processing speeds for interrupts, the interrupt aggregation algorithm should be applicable to different platforms and can improve the random read and write speed on each platform, which requires the algorithm to be adaptive.
[0048] In scenarios with high concurrency and high pressure, aggregating different queue depths and multiple read and write scenarios will increase the read and write speed. However, when the queue depth is 1, interrupt aggregation should not be used, as it will only increase the command processing latency and reduce the command processing speed.
[0049] Based on this, the present application provides a register configuration parameter optimization method, which sets different interrupt aggregation parameters for different queue depths, and then respectively detects the read and write rates of the storage device when processing the target command when configured with different interrupt aggregation parameters, so as to select the optimal interrupt aggregation parameters therefrom, so that the registers configured with the optimal interrupt aggregation parameters still have random read and write performance with strong interrupt processing pressure under the high-intensity IO load conditions of the host, and optimize the random read and write performance.
[0050] like Figure 1 As shown, an embodiment of the register configuration parameter optimization method specifically includes the following steps:
[0051] S10: If a target command to be processed is received, determine the depth of the queue for incoming target commands.
[0052] In this embodiment, after receiving the target command to be processed, the queue for transmitting the target command to the storage device and the queue depth of the queue are first determined. That is, the depth of the queue for storing the target command is determined; wherein the target command includes but is not limited to a read command, a write command, etc.
[0053] In some examples, if it is determined that the depth of the queue is not greater than a preset depth threshold, the parameter configuration operation of the configuration register is not performed.
[0054] Among them, the value of the preset depth threshold can be set accordingly according to actual needs and is not limited here; for example, since executing dynamic interrupt aggregation may cause register performance to decrease when the queue depth is 1, the preset depth threshold can be set to 1, and the configuration register parameters are not configured when the queue depth is 1, and there is no need to execute the interrupt aggregation function.
[0055] S20, when the depth is greater than a preset depth threshold, multiple aggregation parameter combinations are set, and within a preset polling time, the corresponding read and write rates of the configuration register when processing the target command under the configuration of each aggregation parameter combination are detected in sequence.
[0056] When the depth of the queue into which the target command is passed is greater than a preset depth threshold, a plurality of aggregation parameter combinations are set; wherein the aggregation parameter is an interrupt aggregation parameter that needs to be configured by the configuration register for supporting the interrupt aggregation function when processing the target command. For example, the aggregation parameter combination includes an aggregation threshold, or a parameter combination of an aggregation threshold and an aggregation time; that is, multiple aggregation thresholds can be set to perform a subsequent polling detection process, or a combination of multiple aggregation thresholds and aggregation can be set to perform a subsequent polling detection process.
[0057] In one example, if the aggregation parameter combination includes an aggregation threshold, multiple aggregation thresholds are set based on depth when setting multiple aggregation parameter combinations; wherein, multiple aggregation thresholds are set in sequence starting from zero until the value of the last aggregation threshold is equal to the value of the depth.
[0058] Then, within the preset polling time period, the corresponding read and write rates of the configuration register when the register parameters are configured based on each aggregation parameter combination and the target command are processed respectively are detected in turn, so as to determine the optimal aggregation parameter combination according to the read and write rates. Among them, the read and write rates of multiple aggregation parameter combinations can be detected in turn within the preset polling time period, and after reaching the preset polling time period, the detection of the read and write rates corresponding to the multiple aggregation parameter combinations is re-executed. Optionally, the specific value of the preset polling time period can be set according to actual needs, and this embodiment does not limit this. For example, the preset polling time period can be set to 3s.
[0059] In this embodiment, if the aggregation threshold is 0, it means that one interrupt is returned for one command, and when the aggregation threshold is 1, it means that one interrupt is returned for every two commands, and so on. In this embodiment, the aggregation threshold is polled within a certain period of time, and the configuration register is configured to continuously configure an aggregation parameter combination within the period of time. Optionally, the value of the detection time period corresponding to each aggregation parameter combination can be set according to actual needs, and this embodiment is not limited to it, such as it can be set to 50ms.
[0060] S30, according to the detected read and write rate results, matching the optimal aggregation parameter combination from various aggregation parameter combinations.
[0061] According to the detection results of the read and write rates corresponding to each aggregation parameter combination within a polling time period, the optimal aggregation parameter combination for performing register configuration parameter optimization is matched; wherein the optimal aggregation parameter combination is used to configure the parameters of the configuration register so that the configuration register achieves the interrupt aggregation function.
[0062] For reference, if the read / write rate under the next aggregation parameter combination is lower than the read / write rate under the current aggregation parameter combination by a preset ratio value, the current aggregation parameter combination is used as the configuration register to execute the optimal aggregation parameter combination of the interrupt aggregation function. The value of the preset ratio value can be set according to actual needs and is not limited here. For example, the ratio value can be set to 5%.
[0063] Alternatively, if the read / write rate under the last aggregation parameter combination is greater than the read / write rate under all aggregation parameter combinations, the last aggregation parameter combination is used as the optimal aggregation parameter combination.
[0064] In one embodiment, if the preset polling time has been reached, the execution jumps to the step of "detecting the corresponding read and write rates of the configuration register when processing the target command under the configuration of each aggregation parameter combination in sequence within the preset polling time" in S20 to perform the next polling. That is, with the preset polling time as the polling cycle, the detection of the corresponding read and write rates of multiple aggregation parameter combinations is periodically implemented, so as to periodically optimize the configuration register, and enter the next polling cycle after completing one polling cycle.
[0065] In some examples, if the depth of the queue of the incoming target command cannot be determined, it is determined whether the read and write rate of the configuration register is greater than a first preset rate value and less than a second preset rate value.
[0066] Furthermore, if Figure 2 As shown, if it is determined that the read and write rate of the configuration register is greater than the first preset rate value and less than the second preset rate value, this embodiment may specifically include the following steps:
[0067] S41, setting different aggregation parameter combinations.
[0068] First, different aggregation parameter combinations are set, and then the read and write rates corresponding to each aggregation parameter combination in the same detection time period are detected, wherein the aggregation parameter combination includes an aggregation threshold and an aggregation time, and the detection time period can be set to 50ms.
[0069] For example, the first aggregation parameter combination is set as follows: the aggregation threshold is 0 and the aggregation time is 0; the second aggregation parameter combination is set as follows: the aggregation threshold is 1 and the aggregation time is 40us. Multiple aggregation parameter combinations can be set in this way. The aggregation threshold is set in the 2N-1 rule.
[0070] It should be noted that in this embodiment, due to the hardware limitation of certain types of registers, the actual queue depth cannot be obtained. It is found through experiments that when the read and write rate of the storage device is above 4500Mb / s, its random read and write rate cannot be improved, and when the queue depth is 1, the maximum read and write rate of the storage device is generally around 350Mb / s. Therefore, in order not to affect the detection effect of the aggregation parameter combination, this embodiment starts to detect the read and write rate after setting the current read and write rate of the configuration register to be greater than the first preset rate value and less than the second preset rate value. That is, in the case that the actual queue depth cannot be obtained, this embodiment detects the optimal read and write rate of the storage device between the first preset rate value and the second preset rate value to match and obtain the corresponding optimal aggregation parameter. Among them, the second preset rate value is greater than the first preset rate value, and the values of the first preset rate value and the second preset rate value can be set according to actual needs, and are not limited here. Optionally, the first preset rate value may be set to 350 Mb / s, 360 Mb / s, etc., and the second preset rate value may be set to 4500 Mb / s, 4600 Mb / s, etc.
[0071] S42, within a preset polling time, sequentially detecting the corresponding read and write rates of the configuration register when processing the target command within the same time period when different aggregation parameter combinations are configured.
[0072] S43: If the read / write rate under the next aggregation parameter combination is lower than the read / write rate under the current aggregation parameter combination by a preset ratio, the current aggregation parameter combination is used as the optimal aggregation parameter combination.
[0073] Within a time period, the corresponding read and write rates of the configuration register when processing the target command under the configuration of the first aggregation parameter combination are detected; then the same time period is used as the detection duration to detect the corresponding read and write rates of the configuration register when processing the target command under the configuration of the second aggregation parameter combination; and so on, the read and write rates corresponding to multiple aggregation parameter combinations are detected in turn until the preset polling time is reached.
[0074] Among them, within a preset polling time, if the read and write rate under the subsequent aggregation parameter combination is lower than the read and write rate under the current aggregation parameter combination by a preset ratio value, the current aggregation parameter combination will be used as the optimal aggregation parameter combination, and the subsequent configuration registers can use the optimal aggregation parameter combination to configure the register parameters, thereby executing the interrupt aggregation function.
[0075] In some examples, after the current aggregation parameter combination is used as the optimal aggregation parameter combination of the configuration register, if any of the following conditions is met, the process jumps to step S42, that is, within the preset polling time, sequentially detecting the corresponding read and write rates of the configuration register when processing the target command in the same time period when different aggregation parameter combinations are configured, that is, re-executing the corresponding read and write rate detection process when multiple aggregation parameter combinations are configured; wherein, condition one, the read and write rate of the configuration register is less than the first preset rate value and greater than the second preset rate value; condition two, the preset polling time is reached.
[0076] In one example, if the depth of the queue of the incoming target command cannot be determined, and before the read / write rate detection is performed, if it is determined that the read / write rate of the configuration register is less than the first preset rate value, the parameter configuration operation of the configuration register is not performed.
[0077] Optionally, in the case where the depth of the queue for incoming target commands can be determined, this embodiment can also be limited to: within the preset polling time and when the read / write rate is between the first preset rate value and the second preset rate value, the optimal read / write rate corresponding to the configuration register when processing the target command under the configuration of each aggregation parameter combination is detected in sequence, and the corresponding optimal aggregation parameter combination is obtained through the optimal read / write rate matching. That is, when the depth of the queue for incoming target commands is greater than the preset depth threshold, the aforementioned steps S20-S30 are executed, and the optimal read / write rate between the first preset rate value and the second preset rate value is detected correspondingly, so as to match and obtain the optimal aggregation parameter combination with the optimal read / write rate.
[0078] Among them, if after determining the optimal aggregation parameter combination, and it is determined that any one of the following conditions is currently met, the aforementioned steps S20-S30 are re-executed; among them, condition one, the read and write rate of the configuration register is less than the first preset rate value and greater than the second preset rate value; condition two, the preset polling time is reached.
[0079] The following is an example to illustrate the above register configuration parameter optimization process.
[0080] Among them, for NVME hard drives, when the hard drive enters random read and write, the number of commands issued by the host can be counted, and then the dynamic interrupt aggregation algorithm of the controller can be used to configure the register parameters of the interrupt aggregation function to improve the random read and write performance of the storage device.
[0081] For example, when the depth of the queue for storing the target command is 1, dynamic interrupt aggregation is not performed to avoid reducing the interrupt aggregation performance of the register; if the depth of the queue is greater than 1, when the detection of the read and write rates corresponding to the aggregation parameter combination is turned on, the aggregation time is set to 40us; during the detection process, polling is performed approximately every 3s, and an aggregation parameter combination is switched every 50ms during a polling process for detection. When the read and write rate corresponding to the previous aggregation parameter combination is lower than the read and write rate of the current aggregation parameter combination, the optimal aggregation parameter combination continues to be searched; and when the read and write rate corresponding to the next aggregation parameter combination is lower than the read and write rate corresponding to the current aggregation parameter combination, polling is stopped, the current aggregation parameter combination is used as the optimal aggregation parameter combination, and the next polling is performed after the polling time (i.e., 3s) is reached; optionally, in this process, if the current read and write rate of the storage device is greater than the third preset rate value, multiple aggregation parameter combinations are not set; wherein the value of the third preset rate value can be set accordingly according to actual needs, and is not limited here. For example, the third preset rate value can be set to 5000Mb / s, etc.
[0082] In the above example, the corresponding read and write rate comparisons before and after running the dynamic interrupt aggregation parameter optimization test are shown in Tables 1 and 2 below; it can be seen that if the read and write rate optimization test is performed in advance by setting multiple aggregation parameters to find the optimal aggregation parameters for register configuration, the read and write performance of the storage device can be significantly improved.
[0083]
[0084] Table 1
[0085]
[0086] Table 2
[0087] In this embodiment, by pre-optimizing the aggregation parameters of the configuration registers to match the optimal aggregation parameters, and then configuring the register parameters based on the optimal aggregation parameters, the read and write performance of the storage device can be significantly improved, which helps to improve the efficiency and reliability of the interrupt aggregation function, and at the same time can also improve the random read and write performance under a variety of read and write command combinations.
[0088] like Figure 3 As shown, the embodiment of the present application also provides a register configuration parameter optimization device, the device comprising:
[0089] A determination module 110, configured to determine the depth of a queue for incoming target commands when receiving a target command to be processed;
[0090] The polling module 120 is used to set a plurality of aggregation parameter combinations when the depth is greater than a preset depth threshold, and sequentially detect the corresponding read and write rates of the configuration register when processing the target command under the configuration of each aggregation parameter combination within a preset polling time;
[0091] The matching module 130 is used to match the optimal aggregation parameter combination from each aggregation parameter combination according to the detected read and write rate results; the optimal aggregation parameter combination is used to configure the parameters of the configuration register so that the configuration register achieves the interrupt aggregation function.
[0092] It can be understood that the register configuration parameter optimization device of this embodiment corresponds to the register configuration parameter optimization method of the above embodiment, and the options in the above embodiment are also applicable to this embodiment, so they will not be described repeatedly here.
[0093] The embodiment of the present application also provides a storage device, which can be a device with storage function such as a hard disk, a solid-state hard disk, or an optical disk, for example; the storage device includes a register, a processor, and a memory, wherein the memory stores a computer program, and the processor runs the computer program to enable the storage device to execute the register configuration parameter optimization method of the present application, wherein the method includes: if a target command to be processed is received, determining the depth of the queue of the incoming target command; when the depth is greater than a preset depth threshold, setting multiple aggregation parameter combinations, and within a preset polling time, sequentially detecting the corresponding read and write rates of the configuration register when processing the target command under the condition of configuring each aggregation parameter combination; according to the detected read and write rate results, matching the optimal aggregation parameter combination from each aggregation parameter combination; the optimal aggregation parameter combination is used to configure the parameters of the configuration register so that the configuration register achieves the interrupt aggregation function; further, by performing optimization of the aggregation parameters on the configuration register in advance to match the optimal aggregation parameters, when the parameters of the register are configured based on the optimal aggregation parameters, the read and write performance of the storage device can be significantly improved, which helps to improve the efficiency and reliability of the interrupt aggregation function, and can also improve the random read and write performance of the storage device under multiple read and write command combinations.
[0094] Among them, the processor can be an integrated circuit chip with signal processing capabilities. The processor can be a general-purpose processor, including a central processing unit (CPU), a graphics processing unit (GPU) and a network processor (NP), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. At least one of the general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc., which can implement or execute the disclosed methods, steps and logic block diagrams in the embodiments of the present application.
[0095] The memory may be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable read-only memory (EEPROM), etc. The memory is used to store a computer program, and the processor may execute the computer program accordingly after receiving an execution instruction.
[0096] In addition, the present application also provides a computer storage medium for storing the computer program used in the above-mentioned storage device, wherein, when the computer program is executed on a processor, the register configuration parameter optimization method of the above-mentioned embodiment is implemented, and the method includes: if a target command to be processed is received, determining the depth of the queue of the incoming target command; when the depth is greater than a preset depth threshold, setting multiple aggregation parameter combinations, and within a preset polling time, sequentially detecting the corresponding read and write rates of the configuration register when processing the target command under the configuration of each aggregation parameter combination; according to the detected read and write rate results, matching the optimal aggregation parameter combination from each aggregation parameter combination; the optimal aggregation parameter combination is used to configure the parameters of the configuration register so that the configuration register achieves the interrupt aggregation function.
[0097] It can be understood that the options in the register configuration parameter optimization method of the above embodiment are also applicable to this embodiment, so they will not be described repeatedly here.
[0098] The computer storage medium may be a non-volatile storage medium or a volatile storage medium. For example, the computer storage medium may include, but is not limited to, a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.
[0099] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and structure diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in an alternative implementation, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the structure diagram and / or the flow diagram, and the combination of boxes in the structure diagram and / or the flow diagram, can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0100] In addition, the functional modules or units in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
[0101] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a storage device (which can be a smart phone, a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the various embodiments of the present application.
[0102] The above description is only a specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application.
Claims
1. A register configuration parameter optimization method, characterized in that: include: If a target command to be processed is received, determining the depth of the queue for incoming target commands; When the depth is greater than a preset depth threshold, multiple aggregation parameter combinations are set, and within a preset polling time, the corresponding read and write rates of the configuration register when processing the target command under the configuration of each aggregation parameter combination are detected in sequence; According to the detected read and write rate results, an optimal aggregation parameter combination is matched from each of the aggregation parameter combinations; the optimal aggregation parameter combination is used to configure the parameters of the configuration register so that the configuration register achieves the interrupt aggregation function.
2. The register configuration parameter optimization method according to claim 1, characterized in that: Also includes: If the depth is not greater than the preset depth threshold, the parameter configuration operation of the configuration register is not performed.
3. The register configuration parameter optimization method according to claim 1, characterized in that: Also includes: If the depth of the queue for the incoming target command cannot be determined, and the read and write rate of the configuration register is greater than the first preset rate value and less than the second preset rate value, setting different aggregation parameter combinations; Within the preset polling time, sequentially detecting the corresponding read and write rates of the configuration register when processing the target command within the same time period when different aggregation parameter combinations are configured; If the read / write rate under the subsequent aggregation parameter combination is lower than the read / write rate under the current aggregation parameter combination by a preset ratio value, the current aggregation parameter combination is used as the optimal aggregation parameter combination.
4. The register configuration parameter optimization method according to claim 3, characterized in that: After the current aggregation parameter combination is used as the optimal aggregation parameter combination, the method further includes: If any one of the following conditions is met, jump to the step of sequentially detecting the corresponding read and write rates of the configuration register when processing the target command in the same time period under the condition of configuring different aggregation parameter combinations within the preset polling time, so as to perform the next polling; Condition 1: the read and write rate of the configuration register is less than the first preset rate value and greater than the second preset rate value; Condition 2: the preset polling time is reached.
5. The register configuration parameter optimization method according to claim 1, characterized in that: The step of matching the detected read / write rate results to obtain the optimal aggregation parameter combination from the aggregation parameter combinations includes: If the read / write rate under the next aggregation parameter combination is lower than the read / write rate under the current aggregation parameter combination by a preset ratio value, the current aggregation parameter combination is used as the optimal aggregation parameter combination; Or, when the read / write rate under the last aggregation parameter combination is greater than the read / write rate under each previous aggregation parameter combination, the last aggregation parameter combination is used as the optimal aggregation parameter combination.
6. The register configuration parameter optimization method according to claim 1, characterized in that: The aggregation parameter combination includes an aggregation threshold, or a parameter combination of the aggregation threshold and an aggregation time; If the aggregation parameter combination includes the aggregation threshold, setting multiple aggregation parameter combinations includes: A plurality of aggregation thresholds are set based on the depth, specifically including: The values are taken starting from zero until the last value is equal to the value of the depth, and each selected value is used as the corresponding aggregation threshold.
7. The register configuration parameter optimization method according to claim 1, characterized in that: After matching the optimal aggregation parameter combination from the aggregation parameter combinations according to the detected read / write rate results, the method further includes: If the preset polling time is reached, jump to the step of sequentially detecting the corresponding read and write rates of the configuration register when processing the target command under the configuration of each aggregation parameter combination within the preset polling time to perform the next polling.
8. A register configuration parameter optimization device, characterized in that: include: A determination module, configured to determine the depth of a queue for incoming target commands when receiving a target command to be processed; A polling module, configured to set a plurality of aggregation parameter combinations when the depth is greater than a preset depth threshold, and sequentially detect, within a preset polling time, a corresponding read and write rate when the configuration register processes the target command under the configuration of each of the aggregation parameter combinations; The polling module is used to match the optimal aggregation parameter combination from each aggregation parameter combination according to the detected read and write rate results; the optimal aggregation parameter combination is used to configure the parameters of the configuration register so that the configuration register can achieve the interrupt aggregation function.
9. A storage device, characterized in that: The method comprises a configuration register, a memory and a processor, wherein the memory stores a computer program, and the processor is used to execute the computer program to implement the register configuration parameter optimization method according to any one of claims 1 to 7.
10. A computer storage medium, characterized in that: A computer program is stored therein, and when the computer program is executed, the register configuration parameter optimization method according to any one of claims 1 to 7 is implemented.
