HDD 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 hard drive to change the order dynamically (according to the current workload) in which received read and write commands are executed using a particular internal buffer. It reduces the amount of unnecessary magnetic head movement, resulting in increased performance. Growth in performance relative 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 the 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:

  • The hard drive must support NCQ.
  • 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".
  • The driver supplied by the operating system must detect NCQ support availability and use "FPDMA Queued commands".