Dynamic Mixed Command Queues for Low-Latency Peripheral Execution
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing methods for managing command queues in peripherals, such as PCIe devices, face challenges in balancing the use of hardware and software command queues, leading to suboptimal latency and inefficiencies, especially when operations are unpredictable.
Innovation Solution
A dynamic mixed command queue system that combines hardware and software command queues, allowing dynamic switching based on availability and workload, optimizing command management and latency.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Loss of time
If hardware command queues are used, then latency is reduced, but the number of commands that can be contained is limited
Solution Approach 1:
The command queue functionality is segmented into two distinct components: hardware command queues (HCQs) located on the peripheral device and software command queues (SCQs) located in host system RAM. Each type serves a specific purpose - HCQs provide low-latency execution for active commands while SCQs provide extensive storage capacity for command batches, resolving the contradiction between speed and capacity
Solution Approach 2:
A hybrid command queue mechanism acts as an intermediary between the host system and peripheral device. This hybrid system dynamically routes commands between HCQs and SCQs based on device availability and queue status, enabling the system to achieve both low latency (when HCQs are available) and high command capacity (when SCQs are utilized)
2Quantity of substance
If software command queues are used, then the number of commands that can be contained is large, but latency increases
Solution Approach 1:
The command queue system is made dynamic through the hybrid mechanism that can adaptively switch between HCQs and SCQs based on real-time conditions. When the device can quickly process commands from HCQs, the system utilizes HCQs for low latency. When HCQs are full or the device is busy, the system dynamically routes new commands to SCQs, maintaining high command capacity while managing latency through adaptive decision-making
3Quantity of substance
If batch command solution is used, then large number of commands can be processed, but latency is not optimal
Solution Approach 1:
The hybrid command queue system performs preliminary actions by pre-positioning commands in appropriate queues based on predicted device availability. The system can pre-fill SCQs with batches of commands while the device processes HCQ commands, and seamlessly transition between queue types. This preliminary organization of commands in the most appropriate queue type eliminates the latency penalty associated with batch processing while maintaining high command throughput
Data Source
Figure 1
Figure 2
Figure 3
AI summary
One aspect of the invention relates to a method (100) for executing an instance comprising steps of: - initializing (110) a mixed command queue comprising a hardware command queue and a software command queue, - for each command of a set of commands of the instance: - sending (120) by the processor to the library of the peripheral, of said each command to be added to the mixed command queue, - adding (130) by the library of the peripheral of said each command: - in the hardware command queue when the allocated hardware command queue has an available command location and the software command queue is empty, and - in the software command queue when the allocated hardware command queue is full or the software command queue includes a previously added command and has an available command location.