4.11 Command Arbitration

4.11 Command Arbitration
For NVMe over PCIe, a command is submitted to the controller when a Submission Queue Tail Doorbell write by the host moves the Submission Queue Tail Pointer past the slot containing the corresponding Submission Queue entry. For NVMe over Fabrics, refer to section 1.4.14 in the NVMe over Fabrics 1.0 specification for the definition of command submission. The controller transfers submitted commands into the controller for subsequent processing using a vendor specific algorithm.
A command is being processed when the controller and/or namespace state is being accessed or modified by the command (e.g., a Feature setting is being accessed or modified or a logical block is being accessed or modified).
A command is completed when a Completion Queue entry for the command has been posted to the corresponding Completion Queue. Upon completion, all controller state and/or namespace state modifications made by that command are globally visible to all subsequently submitted commands.

A candidate command is a submitted command which has been transferred into the controller that the controller deems ready for processing. The controller selects command(s) for processing from the pool of submitted commands for each Submission Queue. The commands that comprise a fused operation shall be processed together and in order by the controller. The controller may select candidate commands for processing in any order. The order in which commands are selected for processing does not imply the order in which commands are completed.
Arbitration is the method used to determine the Submission Queue from which the controller starts processing the next candidate command(s). Once a Submission Queue is selected using arbitration, the Arbitration Burst setting determines the maximum number of commands that the controller may start processing from that Submission Queue before arbitration shall again take place. A fused operation may be considered as one or two commands by the controller.
All controllers shall support the round robin command arbitration mechanism. A controller may optionally implement weighted round robin with urgent priority class and/or a vendor specific arbitration mechanism. The Arbitration Mechanism Supported field in the Controller Capabilities register (CC.AMS) indicates optional arbitration mechanisms supported by the controller.
In order to make efficient use of the non-volatile memory, it is often advantageous to execute multiple commands from a Submission Queue in parallel. For Submission Queues that are using weighted round robin with urgent priority class or round robin arbitration, host software may configure an Arbitration Burst setting. The Arbitration Burst setting indicates the maximum number of commands that the controller may launch at one time from a particular Submission Queue. It is recommended that host software configure the Arbitration Burst setting as close to the recommended value by the controller as possible (specified in the Recommended Arbitration Burst field of the Identify Controller data structure in Figure 109), taking into consideration any latency requirements. Refer to section 5.21.1.1.

4.11命令仲裁
对于基于PCIe的NVMe,当主机编写的“提交队列尾部门铃”将“提交队列尾部指针”移到包含相应“提交队列”条目的插槽后,就会向控制器提交命令。对于基于结构的NVMe,请参阅基于结构的NVMe 1.0规范中的1.4.14节,以获取命令提交的定义。控制器使用特定于供应商的算法将提交的命令传输到控制器中以进行后续处理。
当命令正在访问或修改控制器和/或名称空间状态时(例如,正在访问或修改功能设置或正在访问或修改逻辑块),正在处理命令。
将命令的“完成队列”条目发布到相应的“完成队列”后,命令即完成。完成后,该命令进行的所有控制器状态和/或名称空间状态修改对于所有后续提交的命令都是全局可见的。

候选命令是已提交到控制器的已提交命令,控制器认为该命令已准备好进行处理。控制器从每个提交队列的已提交命令池中选择要处理的命令。包含融合操作的命令应由控制器一起处理并按顺序处理。控制器可以选择候选命令以任何顺序进行处理。选择命令进行处理的顺序并不意味着命令完成的顺序。
仲裁是用于确定提交队列的方法,控制器从该队列开始处理下一个候选命令。一旦使用仲裁选择了提交队列,仲裁突发设置将确定控制器可以从该提交队列开始处理的最大命令数,然后再次进行仲裁。控制器可以将融合操作视为一个或两个命令。
所有控制器均应支持循环命令仲裁机制。控制器可以可选地用紧急优先级和/或卖方特定的仲裁机制来实现加权轮询。控制器功能寄存器(CC.AMS)中的“支持仲裁机制”字段指示控制器支持的可选仲裁机制。
为了有效利用非易失性存储器,并行执行来自提交队列的多个命令通常是有利的。对于使用加权循环和紧急优先级或循环仲裁的提交队列,主机软件可以配置仲裁突发设置。仲裁突发设置指示控制器一次可以从特定的提交队列中启动的最大命令数。建议主机软件将仲裁突发设置配置为尽可能接近控制器的建议值(在图109中的“识别控制器”数据结构的“推荐仲裁突发”字段中指定),同时考虑到所有延迟要求。请参阅第5.21.1.1节。

4.11.1 Round Robin Arbitration
If the round robin arbitration mechanism is selected, the controller shall implement round robin command arbitration amongst all Submission Queues, including the Admin Submission Queue. In this case, all Submission Queues are treated with equal priority. The controller may select multiple candidate commands for processing from each Submission Queue per round based on the Arbitration Burst setting.

4.11.1轮循仲裁
如果选择了循环仲裁机制,则控制器应在所有提交队列(包括管理提交队列)之间实施循环命令仲裁。 在这种情况下,所有提交队列都具有相同的优先级。 控制器可以基于仲裁突发设置从每轮每个提交队列中选择多个候选命令进行处理。

 

4.11.2 Weighted Round Robin with Urgent Priority Class Arbitration

In this arbitration mechanism, there are three strict priority classes and three weighted round robin priority levels. If Submission Queue A is of higher strict priority than Submission Queue B, then all candidate commands in Submission Queue A shall start processing before candidate commands from Submission Queue B start processing.

The highest strict priority class is the Admin class that includes any command submitted to the Admin Submission Queue. This class has the highest strict priority above commands submitted to any other Submission Queue.
The next highest strict priority class is the Urgent class. Any I/O Submission Queue assigned to the Urgent priority class is serviced next after commands submitted to the Admin Submission Queue, and before any commands submitted to a weighted round robin priority level. Host software should use care in assigning any Submission Queue to the Urgent priority class since there is the potential to starve I/O Submission Queues in the weighted round robin priority levels as there is no fairness protocol between Urgent and non Urgent I/O Submission Queues.
The lowest strict priority class is the Weighted Round Robin class. This class consists of the three weighted round robin priority levels (High, Medium, and Low) that share the remaining bandwidth using weighted round robin arbitration. Host software controls the weights for the High, Medium, and Low service classes via Set Features. Round robin is used to arbitrate within multiple Submission Queues assigned to the same weighted round robin level. The number of candidate commands that may start processing from each Submission Queue per round is either the Arbitration Burst setting or the remaining weighted round robin credits, whichever is smaller.

4.11.2具有紧急优先等级仲裁的加权轮循

在这种仲裁机制中,存在三个严格的优先级类别和三个加权的循环优先级。如果提交队列A的严格优先级比提交队列B的严格优先级高,则提交队列A中的所有候选命令应在开始处理来自提交队列B的候选命令之前开始处理。

严格优先级最高的类是Admin类,其中包括提交给Admin Submission Queue的任何命令。此类具有比提交给任何其他提交队列的命令更高的严格优先级。
第二个严格优先级最高的类别是紧急类别。分配给紧急优先级类的所有I / O提交队列都将在提交给Admin提交队列的命令之后,提交给加权循环优先级的任何命令之前进行服务。主机软件在将任何提交队列分配给紧急优先级类别时应格外小心,因为在加权循环优先级中可能会饿死I / O提交队列,因为在紧急和非紧急I / O提交队列之间没有公平协议。
最低的严格优先级等级是加权循环等级。此类包含三个加权循环优先级(高,中和低),它们使用加权循环仲裁共享剩余带宽。主机软件通过“设置功能”控制“高”,“中”和“低”服务类别的权重。轮询用于在分配给相同加权轮询级别的多个提交队列中进行仲裁。每轮可以从每个提交队列开始处理的候选命令的数量是仲裁突发设置或剩余的加权轮循信用额中的较小者。

 

 In Figure 40, the Priority decision point selects the highest priority candidate command selected next to start processing.

在图40中,优先级决策点选择在开始处理之后选择的最高优先级候选命令。

4.11.3 Vendor Specific Arbitration
A vendor may choose to implement a vendor specific arbitration mechanism. The mechanism(s) are outside the scope of this specification.

4.11.3供应商特定的仲裁
卖方可以选择实施卖方特定的仲裁机制。 该机制不在本说明书的范围内。

posted @ 2020-04-09 20:29  话说吴语  阅读(784)  评论(0编辑  收藏  举报