Hard Disk Drive Command Queuing Optimization (NCQ)
NCQ (Native Command Queuing) is a technology designed to increase the performance of hard disk drives under certain situations by allowing the individual hard drive to dynamically change the order (according to the current workload) in which received read and write commands are executed by means of a 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 HDD, interrupt aggregation (integration), and due to the use of "First Party DMA". NCQ technology is implemented as an add-on to the "Serial ATA" 1.0 specifications and is an integral part of the SATA-2 standard. The 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 "Write FPDMA Queued"). For using one of these commands with standard SATA ports three requirements must be fulfilled:
- NCQ must be supported by the hard 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".