Native Command Queuing

NCQ allows the drive itself to determine the optimal order in which to retrieve outstanding requests. This may, as here, allow the drive to fulfill all requests in fewer rotations and thus less time.

In computing, Native Command Queuing (NCQ) is an extension of the Serial ATA protocol allowing hard disk drives to internally optimize the order in which received read and write commands are executed. This can reduce the amount of unnecessary drive head movement, resulting in increased performance (and slightly decreased wear of the drive) for workloads where multiple simultaneous read/write requests are outstanding, most often occurring in server-type applications.

History

Native Command Queuing was preceded by Parallel ATA's version of Tagged Command Queuing (TCQ). ATA's attempt at integrating TCQ was constrained by the requirement that ATA host bus adapters use ISA bus device protocols to interact with the operating system. The resulting high CPU overhead and negligible performance gain contributed to a lack of market acceptance for ATA TCQ.

NCQ differs from TCQ in that, with NCQ, each command is of equal importance, but NCQ's host bus adapter also programs its own first party DMA engine with CPU-given DMA parameters during its command sequence whereas TCQ interrupts the CPU during command queries and requires it to modulate the ATA host bus adapter's third party DMA engine. NCQ's implementation is preferable because the drive has more accurate knowledge of its performance characteristics and is able to account for its rotational position. Both NCQ and TCQ have a maximum queue length of 32 outstanding commands.[1][2] Because the ATA TCQ is rarely used, Parallel ATA (and the IDE mode of some chipsets) usually only support one outstanding command per port.

For NCQ to be enabled, it must be supported and enabled in the SATA host bus adapter and in the hard drive itself. The appropriate driver must be loaded into the operating system to enable NCQ on the host bus adapter.[3]

Many newer chipsets support the Advanced Host Controller Interface (AHCI), which allows operating systems to universally control them and enable NCQ. DragonFly BSD has supported AHCI with NCQ since 2.3 in 2009.[4][5] Linux kernels support AHCI natively since version 2.6.19, and FreeBSD fully supports AHCI since version 8.0. Windows Vista and Windows 7 also natively support AHCI, but their AHCI support (via the msahci service) must be manually enabled via registry editing if controller support was not present during their initial install. Windows 7's AHCI enables not only NCQ but also TRIM support on SSD drives (with their supporting firmware). Older operating systems such as Windows XP require the installation of a vendor-specific driver (similar to installing a RAID or SCSI controller) even if AHCI is present on the host bus adapter, which makes initial setup more tedious and conversions of existing installations relatively difficult as most controllers cannot operate their ports in mixed AHCI–SATA/IDE/legacy mode.

Hard disk drives

Performance

A 2004 test with the first-generation NCQ drive (Seagate 7200.7 NCQ) found that while NCQ increased IOMeter performance, desktop application performance decreased.[6] One review in 2010 found improvements on the order of 9% (on average) with NCQ enabled in a series of Windows multitasking tests.[7]

NCQ can negatively interfere with the operating system's I/O scheduler, decreasing performance;[8] this has been observed in practice on Linux with RAID-5.[9] There is no mechanism in NCQ for the host to specify any sort of deadlines for an I/O, like how many times a request can be ignored in favor of others. In theory, a queued request can be delayed by the drive an arbitrary amount of time while it is serving other (possibly new) requests under I/O pressure.[8] Since the algorithms used inside drives' firmware for NCQ dispatch ordering are generally not publicly known, this introduces another level of uncertainty for hardware/firmware performance. Tests at Google around 2008 have shown that NCQ can delay an I/O for up to 1–2 seconds. A proposed workaround is for the operating system to artificially starve the NCQ queue sooner in order to satisfy low-latency applications in a timely manner.[10]

On some drives' firmware, such as the WD Raptor circa 2007, read-ahead is disabled when NCQ is enabled, resulting in slower sequential performance.[11]

SATA solid-state drives profit significantly from being able to queue multiple commands for parallel workloads. For PCIe-based NVMe SSDs, the queue depth was even increased to support a maximum of 65,535 queues with up to 65,535 commands each.

Safety (FUA)

One lesser-known feature of NCQ is that, unlike its ATA TCQ predecessor, it allows the host to specify whether it wants to be notified when the data reaches the disk's platters, or when it reaches the disk's buffer (on-board cache). Assuming a correct hardware implementation, this feature allows data consistency to be guaranteed when the disk's on-board cache is used in conjunction with system calls like fsync.[12] The associated write flag, which is also borrowed from SCSI, is called Force Unit Access (FUA).[13][14][15]

Solid-state drives

NCQ is also used in newer solid-state drives where the drive encounters latency on the host, rather than the other way around. For example, Intel's X25-E Extreme solid-state drive uses NCQ to ensure that the drive has commands to process while the host system is busy processing CPU tasks.[16]

NCQ also enables the SSD controller to complete commands concurrently (or partly concurrently, for example using pipelines) where the internal organisation of the device enables such processing.

The NVM Express (NVMe) standard also supports command queuing, in a form optimized for SSDs.[17] NVMe allows multiple queues for a single controller and device, allowing at the same time much higher depths for each queue, which more closely matches how the underlying SSD hardware works.[18]

See also

References

  1. ^ PDF white paper on NCQ from Intel and Seagate
  2. ^ "Volume 1 of the final draft of the ATA-7 standard" (PDF). Archived from the original (PDF) on 2012-02-06. Retrieved 2007-01-02.
  3. ^ "SATA II Native Command Queuing Overview", Intel Whitepaper, April 2003.
  4. ^ Matthew Dillon (2009-06-04). ""Re: DragonFly-2.3.1.165.g25822 master sys/dev/disk/ahci Makefile TODO ahci.c ahci.h ahci_attach.c ahci_cam.c ahci_dragonfly.c ahci_dragonfly.h atascsi.h"".
  5. ^ Matthew Dillon (2009). "ahci(4) — Advanced Host Controller Interface for Serial ATA". BSD Cross Reference. DragonFly BSD.
  6. ^ "Seagate's Barracuda 7200.7 NCQ hard drive - The Tech Report - Page 13". The Tech Report. 17 December 2004. Retrieved 2014-01-11.
  7. ^ "Multitasking with Native Command Queuing - The Tech Report - Page 5". The Tech Report. 3 August 2005. Retrieved 2014-01-11.
  8. ^ a b Yu, Y. J.; Shin, D. I.; Eom, H.; Yeom, H. Y. (2010). "NCQ vs. I/O scheduler". ACM Transactions on Storage. 6: 1–37. doi:10.1145/1714454.1714456. S2CID 14414608. [1]
  9. ^ "hard drive - Poor Linux software RAID 5 performance with NCQ". Server Fault. Retrieved 2014-01-11.
  10. ^ Gwendal Grignou, NCQ Emulation, FLS'08 talk summary (p. 109) slides
  11. ^ "Mark Lord: Re: Lower HD transfer rate with NCQ enabled?". LKML. 2007-04-03. Retrieved 2014-01-11.
  12. ^ Marshall Kirk McKusick. "Disks from the Perspective of a File System - ACM Queue". Queue.acm.org. Retrieved 2014-01-11.
  13. ^ Gregory Smith (2010). PostgreSQL 9.0: High Performance. Packt Publishing Ltd. p. 78. ISBN 978-1-84951-031-8.
  14. ^ http://www.seagate.com/docs/pdf/whitepaper/D2c_tech_paper_intc-stx_sata_ncq.pdf [bare URL PDF]
  15. ^ Jonathan Corbet (2010-08-18). "The end of block barriers". LWN.net. Retrieved 2015-06-27.
  16. ^ Gasior, Geoff (November 23, 2008). "Intel's X25-E Extreme solid-state drive - Now with single-level cell flash memory". Tech Report.
  17. ^ Dave Landsman (2013-08-09). "AHCI and NVMe as Interfaces for SATA Express Devices – Overview" (PDF). SATA-IO. Retrieved 2013-10-02.
  18. ^ "NVM Express Overview". nvmexpress.org. Retrieved 2014-11-26.

Read other articles:

  لمعانٍ أخرى، طالع عزلة الثلث (توضيح). عزلة الثلث  - عزلة -  تقسيم إداري البلد  اليمن[1] المحافظة محافظة حجة المديرية مديرية كعيدنة خصائص جغرافية إحداثيات 15°50′15″N 43°17′35″E / 15.83743°N 43.29304°E / 15.83743; 43.29304  الارتفاع 427 متر  السكان التعداد السكا

 

  لمعانٍ أخرى، طالع بيت المرح (توضيح). بيت المرح بيت المرح:العائلة التراجيدية الهزلية   معلومات الكتاب المؤلف أليسون بيكدل البلد الولايات المتحدة اللغة الإنجليزية الناشر هوتون ميفلين هاركورت  تاريخ النشر 8 يونيو 2006 النوع الأدبي مذكرات الموضوع توجه جنسي،  والأدو

 

Pilar Valero Datos personalesNombre completo María Pilar Valero CebriánNacimiento Zaragoza (España)27 de mayo de 1970Nacionalidad(es) España EspañaFallecimiento Zaragoza (España)7 de noviembre de 2022Altura 1,73 m (5′ 8″)Carrera deportivaDeporte BaloncestoClub profesionalPosición EscoltaSelección nacionalSelección EspañaPart. 106[1]​               Medallero España España Baloncesto femen...

Страта конфедератів 9 травня 1794 року у Варшаві Тарговицька, або Торговицька конфедерація (пол. Konfederacja Targowicka) — змова польських магнатів з Францішеком Ксаверієм Браніцьким, Станіславом Щенсним Потоцьким на чолі з Северином Жевуським (всі з Правобережжя) проти реформ Ч...

 

لانغوبارديا الكبرىمعلومات عامةنسبة التسمية لومبارديون الفترة الزمنية أوائل العصور الوسطى المنطقة شبه الجزيرة الإيطالية التأثيراتفرع من Langobardia (en) تعديل - تعديل مصدري - تعديل ويكي بيانات لانغوبارديا الكبرى هو الاسم الذي أطلق أوائل العصور الوسطى على الأراضي التابعة لمملكة...

 

Coordenadas: 50° 28' 24 N 3° 28' 05 E Nivelle   Comuna francesa    Localização NivelleLocalização de Nivelle na França Coordenadas 50° 28' 24 N 3° 28' 05 E País  França Região Altos da França Departamento Norte Características geográficas Área total 5,92 km² População total (2018) [1] 1 351 hab. Densidade 228,2 hab./km² Código Postal ​59230 Código INSEE 59434 Nivelle é uma comuna francesa na ...

طريق السعادة طريق السعادة  الصنف دراما، تشويق وإثارة تاريخ الصدور 16 مارس 1953 مدة العرض 100 دقيقة البلد  مصر اللغة الأصلية العربية الطاقم المخرج كامل الحفناوي الإنتاج أفلام الحرية الكاتب كامل الحفناوي حوار السيد زيادة البطولة كمال الشناويماجدةفريد شوقيزهرة العلاشكري سر

 

This is the talk page for discussing improvements to the Violence against men template. Put new text under old text. Click here to start a new topic. New to Wikipedia? Welcome! Learn to edit; get help. Assume good faith Be polite and avoid personal attacks Be welcoming to newcomers Seek dispute resolution if needed This template does not require a rating on Wikipedia's content assessment scale.It is of interest to the following WikiProjects: Gender studies This template is part of WikiProject...

 

This article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these template messages) This article includes a list of references, related reading, or external links, but its sources remain unclear because it lacks inline citations. Please help to improve this article by introducing more precise citations. (December 2022) (Learn how and when to remove this template message) This article needs additional citations for verificat...

هذه المقالة يتيمة إذ تصل إليها مقالات أخرى قليلة جدًا. فضلًا، ساعد بإضافة وصلة إليها في مقالات متعلقة بها. (سبتمبر 2021) صمم سابق للنطق prelingual deafness معلومات عامة من أنواع صمم  تعديل مصدري - تعديل   الصمم السابق للنطق أو الصمم ما قبل اكتساب اللغة هو الصمم الذي يحدث قبل تعلم ال...

 

Philippine TV station This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.Find sources: Central Luzon Television – news · newspapers · books · scholar · JSTOR (October 2022) (Learn how and when to remove this template message) Central Luzon Television (DWRW-DTV)Motto: Pusung Makabalen!(lit. 'Patriotic Heart!')Centra...

 

هذه المقالة يتيمة إذ تصل إليها مقالات أخرى قليلة جدًا. فضلًا، ساعد بإضافة وصلة إليها في مقالات متعلقة بها. (سبتمبر 2017) يفتقر محتوى هذه المقالة إلى الاستشهاد بمصادر. فضلاً، ساهم في تطوير هذه المقالة من خلال إضافة مصادر موثوق بها. أي معلومات غير موثقة يمكن التشكيك بها وإزالتها...

Scottish Gaelic-language television series Some of this article's listed sources may not be reliable. Please help this article by looking for better, more reliable sources. Unreliable citations may be challenged or deleted. (March 2020) (Learn how and when to remove this template message) Bannan (English title: The Ties that Bind) is a Gaelic-language television series produced by Young Films and first broadcast by BBC Alba in 2014. It tells the story of the return of Màiri MacDonald from Gl...

 

Indian actor For the Indian politician, see P. Balachandra Menon. This biography of a living person needs additional citations for verification. Please help by adding reliable sources. Contentious material about living persons that is unsourced or poorly sourced must be removed immediately from the article and its talk page, especially if potentially libelous.Find sources: Balachandra Menon – news · newspapers · books · scholar · JSTOR (January 2011) (...

 

British nature documentary series See also: Life (2020 TV series) LifeSeries title card from UK broadcastGenreNature documentaryNarrated byDavid Attenborough (BBC)Oprah Winfrey (Discovery)Juanes (Discovery en Español)ComposerGeorge FentonCountry of originUnited KingdomOriginal languageEnglishNo. of episodes10ProductionExecutive producerMike GuntonRunning time59 minutesProduction companiesBBC Natural History UnitThe Open UniversityDiscovery ChannelSkai tvOriginal releaseNetworkBBC OneRelease1...

1st comic book in the Asterix series Asterix the Gaul (Astérix le Gaulois)Cover of the English editionDate1961Main charactersAsterix and ObelixSeriesAsterixPublisherDargaudCreative teamWriterRené GoscinnyArtistAlbert UderzoOriginal publicationPublished inPilote magazineIssues1–38Date of publication29 October 1959 – 14 July 1960LanguageFrenchTranslationPublisherBrockhampton PressDate1969Translator Anthea Bell Derek Hockridge ChronologyFollowed byAsterix and the Golden Sick...

 

TVRI Sulawesi TengahLPP TVRI Stasiun Sulawesi TengahPalu, Sulawesi TengahIndonesiaSaluranDigital: 35 UHFVirtual: 2PemrogramanBahasaBahasa IndonesiaBahasa KailiBahasa BanggaiAfiliasiTVRI NasionalKepemilikanPemilikLPP TVRIRiwayatSiaran perdana22 Desember 2001Informasi teknisOtoritas perizinanKementerian Komunikasi dan Informatika Republik Indonesia TVRI Sulawesi Tengah merupakan salah satu stasiun televisi daerah yang didirikan oleh Televisi Republik Indonesia untuk wilayah Provinsi Sulawesi Te...

 

Actor, theatre manager, producer and playwright (1873–1933) James Bernard Fagan James Bernard Fagan (18 May 1873 – 17 February 1933) was an Irish-born actor, theatre manager, producer and playwright active in England. After turning from the law to the stage, Fagan began his acting career, including four years from 1895 to 1899 with Herbert Beerbohm Tree's company at Her Majesty's Theatre. He then began to write plays, returning eventually to acting during World War I. In 1920, he took ove...

Roman aristocratic families who sided with the Papacy under Pope Pius IX For the nobility of the Papal states, see Papal nobility. This article is part of a series onVatican City History Duchy of Rome (533–751) Donation of Pepin (750s) Papal States (754–1870) Annates Congregation for Borders Fundamental Statute for the Secular Government of the States of the Church Capture of Rome (1870) Prisoner in the Vatican (1870–1929) Roman Question Law of Guarantees Lateran Treaty (1929) Vatican C...

 

Holiday celebrating Ronald Reagan Not to be confused with Reagan Day. Ronald Reagan DayRonald and Nancy Reagan in California after leaving the White HouseObserved byCalifornia, WisconsinDateFebruary 6FrequencyAnnual Ronald Reagan Day is a day of recognition that occurs every February 6, starting in 2011, in the state of California for Ronald Reagan, who was that state's governor from 1967 to 1975 and President of the United States from 1981 to 1989.[1] Ronald Reagan Day has also ...

 

Strategi Solo vs Squad di Free Fire: Cara Menang Mudah!