native-command-queuing · shipping · also NCQ

Native Command Queuing

Native Command Queuing (NCQ) allows multiple tagged ATA commands to be outstanding so a supporting device can schedule their execution.

Related Observatory article: Read on hesela.com

Tagged commands let a supporting drive choose execution order instead of completing every request in submission order. On an HDD this can reduce head movement, but gains depend on concurrent work and support in the device, host controller and software. NCQ support alone is not a performance measurement. [4]

AHCI supports command lists of up to 32 entries per port, but a controller can implement fewer slots. The host's command-list capacity and the device's NCQ capability must both be checked. [5]

Linux's documented NCQ error path uses log page 0x10 to identify the failed tag, while other affected commands may be retried. In v6.12, attribution is conditional on a readable log, an active tag and the port state. Several recovery messages do not establish several independent device failures. NCQ is not a write-durability guarantee. [1] [2]

Queue capacity is not achieved depth or a latency target. Riska et al. (2007) found workload- and cache-dependent scheduling effects on SCSI HDDs, not SATA NCQ measurements; use that study as historical mechanism evidence, not a promised speedup. [6]

In Linux v6.12, reducing a libata device's configured queue depth from above 1 to 1 disables libata's use of NCQ, not the device's advertised capability. With NCQ enabled, the read/write builder selects FPDMA commands even with only one outstanding request. [7] [8] [9] fio 3.41's iodepth is a workload setting, not this device setting; achieved depth can be lower than requested. [10]

With command-based port-multiplier switching, NCQ may queue work for one target; switching targets waits for that queue to drain. [11]

Relations

related
Serial ATA (SATA), AHCI, I/O timeout, Queue depth, Command-based switching (SATA), FIS-based switching (SATA)

Citations

  1. Linux v6.12: libata device, NCQ and bus error documentation (accessed 2026-10-15)
  2. Linux v6.12: ata_eh_analyze_ncq_error and failed-tag attribution (accessed 2026-10-15)
  3. Seagate: SATA Native Command Queuing requirements (accessed 2026-10-17)
  4. Intel: AHCI 1.3.1 overview and optional command-list support (accessed 2026-10-17)
  5. Riska, Larkby-Lahet and Riedel (USENIX ATC 2007): Evaluating Block-level Optimization through the IO Path, sections 2, 5 and 6 (accessed 2026-10-17)
  6. Linux v6.12 libata-sata.c: ata_change_queue_depth and sysfs callback (accessed 2026-11-08)
  7. Linux v6.12 libata.h: ata_ncq_supported and ata_ncq_enabled (accessed 2026-11-08)
  8. Linux v6.12 libata-core.c: ata_build_rw_tf and FPDMA command selection (accessed 2026-11-08)
  9. fio 3.41 HOWTO: iodepth and achieved I/O-depth distribution (accessed 2026-11-08)
  10. Intel AHCI 1.3.1, sections 3.1.1, 3.3.7, 3.3.16 and 9: capabilities and port-multiplier operation (accessed 2026-10-19)

Further reading

JSON: /data/terms/native-command-queuing.json

Published by Hesela team · Updated

Report a correction · Editorial standards · Reuse guidance

Cite this page
Hesela team. Native Command Queuing. Hesela. 2026-11-12. https://hesela.dev/terms/native-command-queuing/