Hard Disk Drive Command Queuing Optimization (NCQ)
NCQ (Native Command Queuing) is a technology designed to increase performance of hard disk drives under certain situations by allowing the individual hard disk to dynamically change the order (according to the current workload) in which received read and write commands are executed by means of special internal buffer. This can reduce the amount of unnecessary magnetic head movement, resulting in increased performance. Increase in performance relatively to TCQ is provided by race-free command status returned by the hard disk drive, interrupt aggregation (integration), and due to the use of First Party DMA. NCQ technology is implemented as an addon to the Serial ATA 1.0 specification and is integral part of the SATA-2 standard. Introduction of NCQ support did not require any changes in basic SATA protocol. FIS structure (Frame Information Structure) is used during the work with NCQ, the primitives that are standard to the SATA specification, and two new commands (Read FPDMA Queued and WriteFPDMA Queued). For using one of these commands with standard SATA ports three requirements must be fulfilled:
- NCQ must be supported by the hard disk drive.
- For performing First Party DMA operations and efficient shutdown after each command the controller of the motherboard must support DMA Setup FIS and Set Device Bits FIS settings.
- Driver supplied by the operating system must detect NCQ support availability and use FPDMA Queued commands.