CN115686369A - Multi-queue arbitration method, system, device and medium for storage device - Google Patents

Multi-queue arbitration method, system, device and medium for storage device Download PDF

Info

Publication number
CN115686369A
CN115686369A CN202211354484.0A CN202211354484A CN115686369A CN 115686369 A CN115686369 A CN 115686369A CN 202211354484 A CN202211354484 A CN 202211354484A CN 115686369 A CN115686369 A CN 115686369A
Authority
CN
China
Prior art keywords
priority
instruction
queue
instructions
instruction queue
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211354484.0A
Other languages
Chinese (zh)
Inventor
郝鹏
王磊
孙明刚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shandong Yunhai Guochuang Cloud Computing Equipment Industry Innovation Center Co Ltd
Original Assignee
Shandong Yunhai Guochuang Cloud Computing Equipment Industry Innovation Center Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shandong Yunhai Guochuang Cloud Computing Equipment Industry Innovation Center Co Ltd filed Critical Shandong Yunhai Guochuang Cloud Computing Equipment Industry Innovation Center Co Ltd
Priority to CN202211354484.0A priority Critical patent/CN115686369A/en
Publication of CN115686369A publication Critical patent/CN115686369A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Advance Control (AREA)

Abstract

The invention belongs to the field of computer storage, and particularly relates to a multi-queue arbitration method for storage equipment, which comprises the following steps: initializing an instruction queue according to a preset priority and the weight corresponding to each priority, taking out instructions from the instruction queue based on the priority of the instruction queue to execute, and recording the execution time; and taking out the instruction with the corresponding weight number from the instruction queue with the high and low priority level based on the weight in response to the execution time exceeding a preset time slice threshold value and executing. The invention provides a multi-queue arbitration method for storage equipment, which adopts an arbitration mechanism combining priority and priority with weight, wherein the switching of the two arbitration mechanisms takes an execution time slice threshold of a high-priority queue as a trigger condition, and dynamically switches the two arbitration strategies in the running process, thereby ensuring that the instruction of the high-priority queue can be quickly executed, preventing the low-priority queue from being starved, and effectively ensuring the service quality of the SSD hard disk to the key service.

Description

Multi-queue arbitration method, system, device and medium for storage device
Technical Field
The invention belongs to the field of computer storage, and particularly relates to a multi-queue arbitration method, a multi-queue arbitration system, multi-queue arbitration equipment and a readable storage medium of storage equipment.
Background
Currently, SAS (Serial Attached SCSI. SAS hard disk) and SATA (Serial ata. SATA hard disk) hard disks based on SCSI protocols can only support a single command queue and the depth of each command queue is also relatively low. Resulting in the IOPS and bandwidth of the hard disk being limited by the transport protocol. The design of the NVME protocol is to solve the problem, and the NVME (Non Volatile Memory express. NVME storage protocol) is composed of a CQ (Completion queue of protocol instruction) and an SQ (Completion queue of protocol instruction), which are paired, host software puts a command to be executed into the SQ, an SSD controller reads the command from the SQ, executes the command in an SSD (Solid State disk (SSD), and finally puts the State of the executed command into the corresponding CQ to complete IO interaction. The maximum number of queues supported by NVME may be 64K (65535 IO (Input/output. In output) queues and 1 control queue), while the depth of each queue may be up to 64K. And the concurrent execution of multiple queues is supported, so that the performance requirement of high-bandwidth high IOPS (Input/Output Operations Per second Input and Output quantity of various hard disks) is realized.
The controller reads a command from the SQ queue of the host and executes the command inside the SSD every time, when a plurality of queues exist, the controller needs to acquire the command from different queues in sequence according to a certain rule to execute, and the rule is called a multi-queue arbitration mechanism. Currently, the NVME protocol defines two arbitration mechanisms, namely round-robin arbitration and weighted round-robin arbitration with an urgent priority.
Polling arbitration mechanism as shown in fig. 5, this arbitration mechanism polls all the SQ (including the control command queue and the IO command queue), reads and executes the commands from each queue in sequence, all queues are processed with equal priority, and the controller selects one queue at a time, and takes out a certain number of commands from the queue to execute.
Weighted Round-Robin arbitration with urgent priority as shown in fig. 6, the Weighted Round-Robin arbitration with urgent priority has four priority levels and two levels of arbitration, the priority levels are High > Medium > Low, the Round-Robin arbitration mechanism with RR (Round Robin arbitration) is used between queues with the same priority level, wherein WRR (Weighted Round Robin arbitration mechanism) is used between High, medium and Low for the first level of arbitration, and the weights of the three priority levels can be configured by NVME commands, which represents the number of commands obtained from the queues at a time. The second level arbitration adopts priority arbitration, wherein the priority1 is the highest, the priority2 is the second, the priority3 is the lowest, the priority of the admin control instruction queue is priority1, the priority is the highest, the second is the queue with the priority of the empty, the priority of the admin control instruction queue is priority2, and the last is the queue with the priority of 3 after the arbitration of the WRR by the three queues of High, medium and Low.
At present, an RR mechanism adopts a polling mode to sequentially read instructions in each queue, no priority is assigned, and all queues are scheduled according to the same probability. The method has the disadvantages that all queues cannot embody the priority, and the delay-sensitive key service and the non-key service cannot be treated differently, so that the key service cannot be processed in time. Weighted round robin arbitration with urgent priority although the second stage has three priority queues to ensure that the high priority queue is sufficiently scheduled, there is no fair agreement between the priorities, and if the high priority queue continues to execute instructions, the low priority queue is easy to starve.
Disclosure of Invention
In order to solve the above problem, the present invention provides a method for arbitrating multiple queues of a storage device, comprising:
initializing an instruction queue according to a preset priority and a weight corresponding to each priority, taking out instructions from the instruction queue based on the priority of the instruction queue to execute, and recording execution time;
and taking out instructions with the corresponding weight number from the instruction queue with the high and low priority levels based on the weight in response to the execution time exceeding a preset time slice threshold value and executing the instructions.
In some embodiments of the present invention, fetching instruction execution from the instruction queue based on the priority of the instruction queue and recording execution time comprises:
judging whether the instruction queues with instructions have different priorities, taking out the instructions from the instruction queues with higher priorities to execute in response to the instruction queues with different priorities, and recording the instruction time in the instruction queues with higher priorities through a timer.
In some embodiments of the invention, the method further comprises:
in response to the instruction queues having instructions with the same priority, the instructions are fetched from the instruction queues in sequence and executed.
In some embodiments of the invention, the method further comprises:
and in response to the instruction execution time recorded by the timer when the instruction execution is taken out from the instruction queue with the high priority and completed is lower than the preset time slice threshold value, clearing the execution time of the timer.
In some embodiments of the present invention, fetching a corresponding weighted number of instructions from an instruction queue with a higher priority based on the weight and executing in response to the execution time exceeding a preset time slice threshold comprises:
and distributing weights based on the priority levels of the instruction queues, and respectively reading and executing the instructions meeting the weight proportion from the corresponding instruction queues.
In some embodiments of the present invention, initializing the instruction queue according to the preset priority and the weight corresponding to each priority includes:
in response to priority confirmation of an instruction queue, setting the priority of a predetermined number of instructions in the instruction queue to a high priority according to the weight of the priority to which the instruction queue of which the priority has been confirmed belongs.
In some embodiments of the invention, the method further comprises:
and in response to the fact that the execution time exceeds a preset time slice threshold value, taking out the high-priority instructions in each instruction queue from each instruction queue according to the priority of the instructions in the instruction queue and executing.
Another aspect of the present invention further provides a storage device multi-queue arbitration system, including:
the initialization module is configured to initialize the instruction queue according to preset priorities and weights corresponding to the priorities, take out instructions from the instruction queue to execute based on the priorities of the instruction queue and record execution time;
and the instruction arbitration module is configured to take out instructions with the corresponding weight quantity from the instruction queue with the high and low priority levels based on the weight in response to the execution time exceeding a preset time slice threshold value and execute the instructions.
Yet another aspect of the present invention also provides a computer apparatus, including:
at least one processor; and
a memory storing computer instructions executable on the processor, the instructions when executed by the processor implementing the steps of the method of any of the above embodiments.
Yet another aspect of the present invention further provides a computer-readable storage medium, which stores a computer program, and the computer program realizes the steps of the method of any one of the above embodiments when executed by a processor.
The invention provides a multi-queue arbitration method for storage equipment, which realizes a brand-new weight arbitration mechanism, adopts an arbitration mechanism combining priority and weighted priority, switches the two arbitration mechanisms by taking an execution time slice threshold of a high-priority queue as a trigger condition, and dynamically switches two arbitration strategies in the operation process, thereby ensuring that the instruction of the high-priority queue can be quickly executed, preventing the low-priority queue from being starved, effectively realizing the guarantee of the SSD hard disk on the service quality of key services, and simultaneously ensuring the stable and continuous uninterrupted operation of non-key services. The method has a certain priority strategy, and can ensure that the critical service or instruction can be executed quickly. Compared with the traditional weighted polling arbitration mechanism with the emergency priority, the arbitration mechanism can ensure that the low-priority queue has certain instruction execution opportunity, and ensures that other normal services of the SSD disk are not influenced while the high-priority instruction is continuously executed. The operation reliability and stability of the hard disk are improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a flowchart of a method for arbitrating multiple queues of a storage device according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a multi-queue arbitration system for a storage device according to an embodiment of the present invention;
FIG. 3 is a schematic structural diagram of a computer device according to an embodiment of the present invention;
FIG. 4 is a schematic structural diagram of a computer-readable storage medium according to an embodiment of the present invention;
FIG. 5 is a diagram illustrating a polling arbitration mechanism in a conventional implementation according to an embodiment of the present invention;
fig. 6 is a schematic diagram of a weighted round robin arbitration scheme in a conventional implementation according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the following embodiments of the present invention are described in further detail with reference to the accompanying drawings.
The invention aims to solve the problem of execution efficiency of protocol instruction submission queues in NVME solid state disks, the traditional implementation mode is mostly implemented by adopting a polling arbitration mechanism and a weighted polling arbitration mechanism, the RR mechanism adopts a polling mode to sequentially read instructions in each queue at present, priority is not divided, and all queues are scheduled according to the same probability. The defects are that all queues can not represent priorities, and the delay-sensitive key service and the non-key service can not be treated differently, so that the key service can not be processed in time. Weighted round robin arbitration with urgent priority although the second stage has three priority queues to ensure that the high priority queue is sufficiently scheduled, there is no fair agreement between the priorities, and if the high priority queue continues to execute instructions, the low priority queue is easy to starve.
As shown in fig. 1, to solve the above problem, the present invention provides a method for arbitrating multiple queues of a storage device, including:
s1, initializing an instruction queue according to a preset priority and a weight corresponding to each priority, taking out instructions from the instruction queue to execute based on the priority of the instruction queue, and recording execution time;
and S2, taking out instructions with the corresponding weight quantity from the instruction queue with the high and low priority based on the weight and executing the instructions in response to the fact that the execution time exceeds a preset time slice threshold value.
In the embodiment of the invention, the instruction queue refers to a protocol instruction commit queue (SQ) in the solid state disk, and the solid state disk of the NVME protocol supports 64K SQ queues at maximum. The priority refers to the priority of the SQ queue, and the higher the priority is, the earlier the instruction in SQ is processed by the controller on the solid state disk. The weight corresponding to each priority level is a ratio of a plurality of preset priority levels, for example, 80% of high priority level and 20% of low priority level.
Therefore, in step S1, after the main controller of the NVME solid state disk is started, the corresponding command queue is initialized, and different priorities are assigned to the corresponding command queue. And meanwhile, setting the occupied weight of different priorities.
Further, according to the priority of the instruction queue, reading the instructions in the instruction queue from the high-priority instruction queue and executing. And simultaneously recording the execution time consumed by the high-level priority instruction queue when the instruction is read.
In step S2, the time consumed for reading the instruction according to the high-level priority instruction is compared with a preset time slice threshold time, and if the time consumed for reading the instruction by the high-level priority instruction is greater than the time slice threshold time, it indicates that the high-level instruction queue occupies an IO channel of the hard disk for a long time, which may cause "starvation" of instructions in some low-level instruction queues.
Therefore, when the above situation occurs, according to the weights of different priorities, the instructions with the number matched with the weights are taken out from the corresponding instruction queue and are executed by the main controller. Specifically, assume that the priorities are two, i.e., high priority and low priority, and the weights are: high priority 80%, low priority 20%. If the number of the instruction queues is 10, 8 instruction queues are high-priority queues, 2 instruction queues are low-priority queues, when the 8 high-priority instruction queues occupy the main controller for processing the instructions in the queues for a long time, and the 2 instruction queues with the low priority cannot be processed, the instructions are stopped to be processed according to the priority mechanism at the moment, the instructions in the corresponding instruction queues are processed in a priority weight mode instead, the weight of the high priority is 80%, 80% of the instructions are taken out from the high-priority instruction queues in a certain time or in a certain number of instruction processing ranges, and 20% of the instructions are taken out from the instruction queues with the low priority.
Specifically, an instruction reading mode based on the instruction number may be adopted according to the condition of the instruction queue, that is, when the queue is small, the corresponding instruction queue may be switched after every certain instruction number. When there are many queues, a certain number of instructions may be predetermined, and if 1000 instructions are provided, for example, 10 queues in the above embodiment, and 8 queues are high priority queues, 100 instructions may be read from each of the 8 high priority queues for execution, and then 100 instructions may be read from each of the 2 low priority queues for execution, and of course, 20 instructions may be read from each instruction queue to complete the reading of 1000 instructions in 5 rounds. Similarly, time can be used as a control condition for reading the instructions, a certain time is set, the certain time is distributed to the corresponding instruction queue according to the weight, the instructions in the corresponding queue are read and executed in the corresponding belonged time, and the number of the executed instructions does not need to be concerned. In a specific situation, a proper strategy can be selected according to the specific number of the instruction queues in the NVME solid state disk and the time consumed for switching the instruction queues.
In some embodiments of the present invention, fetching instruction execution from the instruction queue based on the priority of the instruction queue and recording execution time comprises:
judging whether the instruction queues with instructions have different priorities, in response to the instruction queues with different priorities, taking out the instructions from the instruction queues with higher priorities for execution according to the priorities, and recording the instruction time in the instruction queues with higher priorities through a timer.
In this embodiment, when reading an instruction in a corresponding instruction queue from an instruction queue according to priority, it is first determined whether the priority of the instruction queue with the instruction currently in the NVME solid state disk is consistent, because there may be 65536 instruction queues at most in the solid state disk of the NVME protocol, and there may be a case that a large number of queues are idle when the IO activity of the solid state disk is low, there may be instructions in some instruction queues and some instruction queues are empty. If the priorities of the instruction queues with instructions are not all the same, taking out the instructions from the instruction queue with high priority according to the order of low priority for execution, and recording the instruction execution time of the instruction queue with high priority through a timer.
In some embodiments of the invention, the method further comprises:
in response to the instruction queues having instructions with the same priority, the instructions are fetched from the instruction queues in sequence and executed.
In this embodiment, if the priority of the current instruction queue with instructions is the same, the polling mode polls the read instructions from multiple instruction queues of the same priority for execution, as in the conventional implementation.
In some embodiments of the invention, the method further comprises:
and responding to the condition that the instruction execution time recorded by the timer when the instruction execution is finished is taken out from the instruction queue with high priority and is lower than the preset time slice threshold value, and clearing the execution time of the timer.
In this embodiment, as described above, when instructions in the high-priority instruction queue are read and executed, the timer records the instruction execution time of the corresponding high-priority instruction queue, and if the instruction execution time is lower than the set time slice threshold, it indicates that the execution of the high-priority instruction queue does not consume too much time to complete the processing, and then the corresponding timer is cleared.
In some embodiments of the present invention, fetching a corresponding weighted number of instructions from an instruction queue with a higher priority based on the weight and executing in response to the execution time exceeding a preset time slice threshold comprises:
and distributing weights based on the priority levels of the instruction queues, and respectively reading and executing the instructions meeting the weight proportion from the corresponding instruction queues.
In some embodiments of the present invention, initializing the instruction queue according to the preset priority and the weight corresponding to each priority includes:
in response to the priority confirmation of the instruction queue, setting the priority of a predetermined number of instructions in the instruction queue to be high priority according to the weight of the priority to which the instruction queue of which the priority has been confirmed belongs.
In some embodiments of the invention, the method further comprises:
and in response to the fact that the execution time exceeds a preset time slice threshold value, taking out the high-priority instructions in each instruction queue from each instruction queue according to the priority of the instructions in the instruction queue and executing.
In this embodiment, the present invention proposes a priority control strategy of instruction level. And setting the priority of part of instructions in the instruction queue as high priority according to the priority weight of the instruction queue to which the instruction belongs. And when the execution time occupied by the instruction reading strategy based on the priority of the instruction queue exceeds a time slice threshold value, switching to the instruction priority strategy.
Also according to the weight of the instruction queue priority, if the high level priority is 80% and the low level priority is 20%, to ensure that the instructions in the low level instruction queue can be executed, 80% and 20% are allocated to specific instructions in the plurality of instruction queues, and continuing with the above example, 10 instruction queues, 8 high priority queues and 80% high priority queues are assumed. When the overtime phenomenon occurs in the priority strategy, 80% of the number of executed instructions in a certain time is distributed to 8 high-priority instruction queues, 20% of the number of executed instructions is distributed to 2 low-priority queues, and assuming that 1000 instructions are taken as an example, the instruction priority of 800 instructions in the 8 high-priority instruction queues is set as the high priority, and the priority of 200 instructions in the 2 low-priority instruction queues is set as the high priority. And after 1000 instructions are executed, returning to the scheduling mechanism with the instruction queue priority strategy.
The embodiment is as follows:
1. the host configures a high priority execution time slice threshold of priority when initializing the SSD disk.
2. The host configures the weighted priority ratio, e.g., 80% high priority, 20% low priority, when initializing the SSD disk
3. The host needs to specify a strict priority and a weighted priority for the SQ queue when initializing the queue.
And 4, the SSD controller initially adopts an arbitration strategy of the priority of the queues, and selects and executes the instructions from the queues.
5. When there are instructions in the queue with only one priority (only high priority or only low priority queue), no arbitration is needed, and the controller directly fetches the instructions from the queues with the priority according to the RR and executes the instructions.
6. When the SSD controller has instructions in the high-priority queue and the low-priority queue, the arbitration is needed, the controller takes out the instructions from the high-priority queue to execute, and a timer is started to record the time when the controller continuously reads the instructions from the high-priority queue with the priority.
7. If the time for the controller to continuously read the instructions from the high-priority queue does not exceed the time slice threshold value for high-priority execution, the high-priority queue or the low-priority queue instructions are completely executed and arbitration is not needed, and at the moment, the controller clears the timer for high-priority execution
8. If the time for the controller to continuously read the instructions from the high-priority queue reaches the time slice threshold value for high-priority execution, the controller switches the arbitration mechanism at the moment, the priority arbitration strategy is switched to the priority arbitration strategy with the weight, and the arbitration of the high-priority queue and the low-priority queue reads the commands according to the configured weight value.
9. The controller reads the command from the high-priority queue according to the weighted priority strategy, wherein the reading times are the times designated by the high-priority weight value, then reads the command from the low-priority queue, and the reading times are the times designated by the low-priority weight value, and so on.
10. In the weighted priority execution process, the high-priority or low-priority queue instructions are read out, no command needs to be executed any more, at the moment, arbitration is no longer needed, and the controller restores the arbitration policy to be a strict arbitration policy.
The invention provides a multi-queue arbitration method for storage equipment, which realizes a brand-new weight arbitration mechanism, adopts an arbitration mechanism combining priority and weighted priority, switches the two arbitration mechanisms by taking an execution time slice threshold of a high-priority queue as a trigger condition, and dynamically switches two arbitration strategies in the operation process, thereby ensuring that the instruction of the high-priority queue can be quickly executed, preventing the low-priority queue from being starved, effectively realizing the guarantee of the SSD hard disk on the service quality of key services, and simultaneously ensuring the stable and continuous uninterrupted operation of non-key services. The method has a certain priority strategy, and can ensure that the critical service or instruction can be executed quickly. Compared with the traditional weighted polling arbitration mechanism with the emergency priority, the arbitration mechanism can ensure that the low-priority queue has a certain instruction execution chance, and ensures that other normal services of the SSD disk are not influenced while the high-priority instruction is continuously executed. The operation reliability and stability of the hard disk are improved.
The arbitration mechanism combining the priority and the priority with the weight is adopted, the switching of the two arbitration mechanisms takes the execution time slice threshold of the high-priority queue as a trigger condition, and the two arbitration strategies are dynamically switched in the operation process, so that the condition that the instruction of the high-priority queue can be quickly executed is met, meanwhile, the condition that the low-priority queue is starved is prevented, the guarantee of the SSD hard disk on the service quality of the key service is effectively realized, and meanwhile, the stable continuous uninterrupted operation of the non-key service is ensured.
As shown in fig. 2, another aspect of the present invention further provides a storage device multi-queue arbitration system, including:
the initialization module 1 is configured to initialize an instruction queue according to a preset priority and a weight corresponding to each priority, take out instructions from the instruction queue based on the priority of the instruction queue and execute the instructions and record execution time;
and the instruction arbitration module 2 is configured to take out instructions with the corresponding weight quantity from the instruction queue with the high and low priority levels based on the weight in response to the execution time exceeding a preset time slice threshold value and execute the instructions.
As shown in fig. 3, another aspect of the present invention also provides a computer device, including:
at least one processor 21; and
a memory 22, the memory 22 storing computer instructions 23 executable on the processor 21, the instructions 23 when executed by the processor 21 implementing a storage device multi-queue arbitration method comprising:
initializing an instruction queue according to a preset priority and a weight corresponding to each priority, taking out instructions from the instruction queue based on the priority of the instruction queue to execute, and recording execution time;
and taking out the instructions with the corresponding weight number from the instruction queue with the high and low priority levels based on the weight in response to the execution time exceeding a preset time slice threshold value and executing.
In some embodiments of the present invention, fetching instruction execution from the instruction queue based on the priority of the instruction queue and recording execution time comprises:
judging whether the instruction queues with instructions have different priorities, in response to the instruction queues with different priorities, taking out the instructions from the instruction queues with higher priorities for execution according to the priorities, and recording the instruction time in the instruction queues with higher priorities through a timer.
In some embodiments of the invention, the method further comprises:
and in response to the instruction queues with the instructions having the same priority, taking the instructions out of the instruction queues in sequence and executing the instructions.
In some embodiments of the invention, the method further comprises:
and responding to the condition that the instruction execution time recorded by the timer when the instruction execution is finished is taken out from the instruction queue with high priority and is lower than the preset time slice threshold value, and clearing the execution time of the timer.
In some embodiments of the present invention, fetching a corresponding weighted number of instructions from an instruction queue with a higher priority based on the weight and executing in response to the execution time exceeding a preset time slice threshold comprises:
and distributing weights based on the priority levels of the instruction queues, and respectively reading and executing the instructions meeting the weight proportion from the corresponding instruction queues.
In some embodiments of the present invention, initializing the instruction queue according to the preset priority and the weight corresponding to each priority includes:
in response to priority confirmation of an instruction queue, setting the priority of a predetermined number of instructions in the instruction queue to a high priority according to the weight of the priority to which the instruction queue of which the priority has been confirmed belongs.
In some embodiments of the invention, the method further comprises:
and in response to the fact that the execution time exceeds a preset time slice threshold value, taking out the high-priority instructions in the instruction queues from the instruction queues according to the priorities of the instructions in the instruction queues and executing the high-priority instructions.
As shown in fig. 4, a further aspect of the present invention also provides a computer-readable storage medium 401, where the computer-readable storage medium 401 stores a computer program 402, and the computer program 402 when executed by a processor implements a storage device multi-queue arbitration method, including:
initializing an instruction queue according to a preset priority and the weight corresponding to each priority, taking out instructions from the instruction queue based on the priority of the instruction queue to execute, and recording the execution time;
and taking out the instructions with the corresponding weight number from the instruction queue with the high and low priority levels based on the weight in response to the execution time exceeding a preset time slice threshold value and executing.
In some embodiments of the invention, fetching instruction execution from the instruction queue and recording execution time based on the priority of the instruction queue comprises:
judging whether the instruction queues with instructions have different priorities, in response to the instruction queues with different priorities, taking out the instructions from the instruction queues with higher priorities for execution according to the priorities, and recording the instruction time in the instruction queues with higher priorities through a timer.
In some embodiments of the invention, the method further comprises:
in response to the instruction queues having instructions with the same priority, the instructions are fetched from the instruction queues in sequence and executed.
In some embodiments of the invention, the method further comprises:
and in response to the instruction execution time recorded by the timer when the instruction execution is taken out from the instruction queue with the high priority and completed is lower than the preset time slice threshold value, clearing the execution time of the timer.
In some embodiments of the present invention, fetching a corresponding weighted number of instructions from an instruction queue with a higher priority based on the weight and executing in response to the execution time exceeding a preset time slice threshold comprises:
and distributing weights based on the priority levels of the instruction queues, and respectively reading the instructions meeting the weight proportion from the corresponding instruction queues and executing the instructions.
In some embodiments of the present invention, initializing the instruction queue according to the preset priority and the weight corresponding to each priority includes:
in response to the priority confirmation of the instruction queue, setting the priority of a predetermined number of instructions in the instruction queue to be high priority according to the weight of the priority to which the instruction queue of which the priority has been confirmed belongs.
In some embodiments of the invention, the method further comprises:
and in response to the fact that the execution time exceeds a preset time slice threshold value, taking out the high-priority instructions in each instruction queue from each instruction queue according to the priority of the instructions in the instruction queue and executing.
The foregoing is an exemplary embodiment of the present disclosure, but it should be noted that various changes and modifications could be made herein without departing from the scope of the present disclosure as defined by the appended claims. The functions, steps and/or actions of the method claims in accordance with the disclosed embodiments described herein need not be performed in any particular order. Furthermore, although elements of the disclosed embodiments of the invention may be described or claimed in the singular, the plural is contemplated unless limitation to the singular is explicitly stated.
It should be understood that, as used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly supports the exception. It should also be understood that "and/or" as used herein is meant to include any and all possible combinations of one or more of the associated listed items.
The numbers of the embodiments disclosed in the above embodiments of the present invention are merely for description, and do not represent the advantages or disadvantages of the embodiments.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the storage medium may be a read-only memory, a magnetic disk or an optical disk.
Those of ordinary skill in the art will understand that: the discussion of any embodiment above is meant to be exemplary only, and is not intended to intimate that the scope of the disclosure, including the claims, of embodiments of the invention is limited to these examples; within the idea of an embodiment of the invention, also technical features in the above embodiment or in different embodiments may be combined and there are many other variations of the different aspects of an embodiment of the invention as described above, which are not provided in detail for the sake of brevity. Therefore, any omissions, modifications, substitutions, improvements, and the like that may be made without departing from the spirit and principles of the embodiments of the present invention are intended to be included within the scope of the embodiments of the present invention.

Claims (10)

1. A storage device multi-queue arbitration method, comprising:
initializing an instruction queue according to a preset priority and a weight corresponding to each priority, taking out instructions from the instruction queue based on the priority of the instruction queue to execute, and recording execution time;
and taking out instructions with the corresponding weight number from the instruction queue with the high and low priority levels based on the weight in response to the execution time exceeding a preset time slice threshold value and executing the instructions.
2. The method of claim 1, wherein fetching instruction execution from the instruction queue and recording execution time based on the priority of the instruction queue comprises:
judging whether the instruction queues with instructions have different priorities, taking out the instructions from the instruction queues with higher priorities to execute in response to the instruction queues with different priorities, and recording the instruction time in the instruction queues with higher priorities through a timer.
3. The method of claim 2, further comprising:
in response to the instruction queues having instructions with the same priority, the instructions are fetched from the instruction queues in sequence and executed.
4. The method of claim 2, further comprising:
and responding to the condition that the instruction execution time recorded by the timer when the instruction execution is finished is taken out from the instruction queue with high priority and is lower than the preset time slice threshold value, and clearing the execution time of the timer.
5. The method of claim 1, wherein fetching a corresponding weighted number of instructions from an instruction queue having a lower priority based on the weight and executing in response to the execution time exceeding a preset time slice threshold comprises:
and distributing weights based on the priority levels of the instruction queues, and respectively reading and executing the instructions meeting the weight proportion from the corresponding instruction queues.
6. The method of claim 1, wherein initializing the instruction queue according to the preset priority and the weight corresponding to each priority comprises:
in response to priority confirmation of an instruction queue, setting the priority of a predetermined number of instructions in the instruction queue to a high priority according to the weight of the priority to which the instruction queue of which the priority has been confirmed belongs.
7. The method of claim 6, further comprising:
and in response to the fact that the execution time exceeds a preset time slice threshold value, taking out the high-priority instructions in each instruction queue from each instruction queue according to the priority of the instructions in the instruction queue and executing.
8. A storage device multi-queue arbitration system, comprising:
the initialization module is configured to initialize the instruction queue according to a preset priority and the weight corresponding to each priority, take out instructions from the instruction queue based on the priority of the instruction queue and record execution time;
and the instruction arbitration module is configured to take out instructions with corresponding weight quantity from the instruction queue with high and low priority levels based on the weight in response to the execution time exceeding a preset time slice threshold value and execute the instructions.
9. A computer device, comprising:
at least one processor; and
a memory storing computer instructions executable on the processor, the instructions when executed by the processor implementing the steps of the method of any one of claims 1 to 7.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 7.
CN202211354484.0A 2022-11-01 2022-11-01 Multi-queue arbitration method, system, device and medium for storage device Pending CN115686369A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211354484.0A CN115686369A (en) 2022-11-01 2022-11-01 Multi-queue arbitration method, system, device and medium for storage device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211354484.0A CN115686369A (en) 2022-11-01 2022-11-01 Multi-queue arbitration method, system, device and medium for storage device

Publications (1)

Publication Number Publication Date
CN115686369A true CN115686369A (en) 2023-02-03

Family

ID=85048725

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211354484.0A Pending CN115686369A (en) 2022-11-01 2022-11-01 Multi-queue arbitration method, system, device and medium for storage device

Country Status (1)

Country Link
CN (1) CN115686369A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116301644A (en) * 2023-03-24 2023-06-23 四川水利职业技术学院 Data storage method, system, terminal and medium based on multi-hard disk coordination
CN117055820A (en) * 2023-10-09 2023-11-14 苏州元脑智能科技有限公司 Command processing method of solid state disk, solid state disk and storage medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116301644A (en) * 2023-03-24 2023-06-23 四川水利职业技术学院 Data storage method, system, terminal and medium based on multi-hard disk coordination
CN116301644B (en) * 2023-03-24 2023-10-13 四川水利职业技术学院 Data storage method, system, terminal and medium based on multi-hard disk coordination
CN117055820A (en) * 2023-10-09 2023-11-14 苏州元脑智能科技有限公司 Command processing method of solid state disk, solid state disk and storage medium
CN117055820B (en) * 2023-10-09 2024-02-09 苏州元脑智能科技有限公司 Command processing method of solid state disk, solid state disk and storage medium

Similar Documents

Publication Publication Date Title
CN115686369A (en) Multi-queue arbitration method, system, device and medium for storage device
JP5752267B2 (en) Simultaneous request scheduling
US6301639B1 (en) Method and system for ordering priority commands on a commodity disk drive
US6434630B1 (en) Host adapter for combining I/O completion reports and method of using the same
RU2599967C2 (en) Application lifecycle management
US8893146B2 (en) Method and system of an I/O stack for controlling flows of workload specific I/O requests
US20070156955A1 (en) Method and apparatus for queuing disk drive access requests
US8606992B2 (en) Dynamically switching command types to a mass storage drive
EP2466824A1 (en) Service scheduling method and device
EP1508850A2 (en) Continuous media priority aware storage scheduler
US20070169125A1 (en) Task scheduling policy for limited memory systems
CN107579926A (en) The QoS methods to set up of Ceph cloud storage systems based on token bucket algorithm
CN103631661A (en) Internal storage management method and device
US11093352B2 (en) Fault management in NVMe systems
US10884667B2 (en) Storage controller and IO request processing method
CN107515781B (en) Deterministic task scheduling and load balancing system based on multiple processors
WO2022227693A1 (en) Command distribution apparatus and method, chip, computer device, and medium
CN107977269B (en) Method, device and equipment for processing timeout event in message forwarding system
WO2022042127A1 (en) Coroutine switching method and apparatus, and device
CN114461365A (en) Process scheduling processing method, device, equipment and storage medium
CN114500401A (en) Resource scheduling method and system for dealing with burst traffic
CN117251275A (en) Multi-application asynchronous I/O request scheduling method, system, equipment and medium
CA3238254A1 (en) Storage control method, storage controller, storage chip, network card, and readable medium
CN115981893A (en) Message queue task processing method and device, server and storage medium
CN115766612A (en) Scheduling method based on weight conversion probability and corresponding device

Legal Events

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