background image

Serial ATA Native Command Queuing 

Summary

 

Native Command Queuing (NCQ) is among the advanced and most anticipated features 
introduced in the Serial ATA II: Extensions to Serial ATA 1.0 Specification, download available at 
www.serialata.org.  NCQ is a powerful interface/disc technology designed to increase 
performance and endurance by allowing the drive to internally optimize the execution order of 
workloads. Intelligent reordering of commands within the drive’s internal command queue helps 
improve performance of queued workloads by minimizing mechanical positioning latencies on the 
drive.  This paper will provide a basis for understanding how the features of NCQ apply to 
complete storage solutions and how software developers can enhance their applications to take 
advantage of Serial ATA NCQ thereby creating higher performance applications.   

Introduction 

Accessing media on mass storage devices, such as hard disc drives (HDD), can have a negative 
impact on overall system performance. Unlike other purely electrical components in a modern 
system, HDDs are still largely mechanical devices.  Drives are hampered by the inertia of their 
mechanical components which effectively limits the speed of media access and retrieval of data. 
Mechanical performance can be physically improved only up to a certain point and these 
performance improvements usually come at an increased cost of the mechanical components.  
However, intelligent, internal management of the sequence of mechanical processes can greatly 
improve the efficiency of the entire workflow. The operative words are intelligent and internal, 
meaning that the drive itself has to assess the location of the target logical block addresses 
(LBAs) and then make the appropriate decisions on the order that commands should be executed 
in to achieve the highest performance.  

Native Command Queuing is a command protocol in Serial ATA that allows multiple commands 
to be outstanding within a drive at the same time.  Drives that support NCQ have an internal 
queue where outstanding commands can be dynamically rescheduled or re-ordered, along with 
the necessary tracking mechanisms for outstanding and completed portions of the workload.  
NCQ also has a mechanism that allows the host to issue additional commands to the drive while 
the drive is seeking for data for another command.   

Operating systems such as Microsoft Windows* and Linux* are increasingly taking advantage of 
multi-threaded software or processor-based Hyper-Threading Technology.  These features have 
a high potential to create workloads where multiple commands are outstanding to the drive at the 
same time.  By utilizing NCQ, the potential disk performance is increased significantly for these 
workloads.  

Drive Basics 

Hard drives are electromechanical devices, and therefore hybrids of electronics and mechanical 
components. The mechanical portions of drives are subject to wear and tear and are also the 
critical limiting factor for performance.  To understand the mechanical limitations, a short 
discussion of how data on is laid out on a drive may be helpful.   

Data is written to the drive in concentric circles, called tracks, starting from the outer diameter of 
the bottom platter, disc 0, and the first read/write head, head 0.  When one complete circle on one 
side of the disc, track 0 on head 0, is complete the drive starts writing to the next head on the 
other side of the disc, track 0 and head 1.  When the track is complete on head 1 the drive starts 
writing to the next head, track 0 and head 2, on the second disc.  This process continues until the 
last head on the last side of the final disc has completed the first track.  The drive then will start 
writing the second track, track 1, with head 0 and continues with the same process as it did when 
writing track 0.  This process results in a concentric circles where as writing continues the data 
moves closer and closer to the inner diameter of the discs.  A particular track on all heads, or 

 

2

*Other names and brands may be claimed as the property of others.

Содержание ST3250620AS - Barracuda 250GB 7200 RPM 16MB Cache SATA 3.0Gb/s Perpendicular Recording Hard Drive

Страница 1: ...July 2003 Serial ATA Native Command Queuing An Exciting New Performance Feature for Serial ATA A JOINT WHITEPAPER BY Intel Corporation and Seagate Technology www intel com www seagate com...

Страница 2: ...mands to be outstanding within a drive at the same time Drives that support NCQ have an internal queue where outstanding commands can be dynamically rescheduled or re ordered along with the necessary...

Страница 3: ...onal Position Ordering to optimally re order commands to maximize performance Seek Latency Optimization Seek latencies are caused by the time it takes the read write head to position and settle over t...

Страница 4: ...ve almost simultaneously Higher RPM spindles are one approach to reduce rotational latencies However increasing RPM spindle rates carries a substantial additional cost Rotational latencies can also be...

Страница 5: ...nding a DMA Setup FIS Frame Information Structure to the host controller This FIS specifies the tag of the command for which the DMA is being set up Based on the tag value the host controller will loa...

Страница 6: ...s written with the particular register values and then the Command register is written with the command opcode The difference between queued and non queued commands is what happens after the command i...

Страница 7: ...alled Auto Activate which can eliminate one FIS transfer during a write command One important note for HBA designers is that new commands cannot be issued between the DMA Setup FIS and the completion...

Страница 8: ...the drive can return a Set Device Bits FIS without a host handshake it is possible to receive two Set Device Bits FISes very close together in time If the second Set Device Bits FIS arrives before hos...

Страница 9: ...ointer to buffer to place data in 1024 Want to read 1024 bytes from the file numBytesRead Number of bytes read from the file NULL Synchronous so overlapped parameter is NULL Code for checking the stat...

Страница 10: ...50 Wait up to 50 milliseconds for completion could be infinity Check the value of dwResult and also call GetOverlappedResult to ensure that each IO that completed was with good status As can be seen...

Страница 11: ...ntroller Interface AHCI definition Amber holds a BSE in Computer Engineering from the University of Michigan and has been with Intel for 6 years Joni Clark Product Marketing Manager Seagate Technology...

Страница 12: ...Serial ATA Native Command Queuing 12...

Отзывы: