Web Analytics

See also ebooksgratis.com: no banners, no cookies, totally FREE.

CLASSICISTRANIERI HOME PAGE - YOUTUBE CHANNEL
Privacy Policy Cookie Policy Terms and Conditions
Tagged Command Queuing - Wikipedia, the free encyclopedia

Tagged Command Queuing

From Wikipedia, the free encyclopedia

TCQ stands for the Tagged Command Queuing technology built into certain PATA and SCSI hard drives. It allows the operating system to send multiple read and write requests to a hard drive. TCQ is not identical in function to the more efficient Native Command Queuing (NCQ) used by SATAII drives.

Before TCQ, an operating system was only able to send one request at a time. In order to boost performance, it had to decide the order of the requests based on its own, possibly incorrect, idea of what the hard drive was doing. With TCQ, the drive can make its own decisions about how to order the requests (and in turn relieve the operating system from having to do so). The result is that TCQ can improve the overall performance of a hard drive.

[edit] Overview

Typically, sectors nearest the current location of the drive's read/write head are serviced first. The second-nearest location is serviced second, and so on. The queue is constantly being added to and re-ordered based upon new incoming read/write requests and the new position of the read/write head following the last read/write operation. The reordering algorithm is drive-dependent, and may vary from drive to drive. However, the host computer does not need to know what the algorithm is, or how it works.

This queuing mechanism is also sometimes referred to as "elevator seeking", as the image of the metaphorical elevator with a very limited maximum speed, trying to service multiple requests without excessive amounts of going up and down explains the idea rather well.

For example, assume an elevator is servicing a building with five floors, with the elevator currently residing on the bottom floor. Suppose tenants on the second, fourth, and fifth floors push the elevator call button to leave the building, but in the following order: 5-2-4. If the elevator serviced these requests in the order they were received, it would go to the top floor, then back down to the second floor, then back up to the fourth floor, and then finally back to the first floor to deliver the passengers. This is clearly very inefficient, because floors with waiting passengers are bypassed on the way to other floors. Furthermore, the elevator travels much further overall, increasing wear and tear. Modern elevators will realize this and re-order the service queue to a more efficient order such as 5-4-2.

[edit] Comparison of TCQ and NCQ

The principal idea of both TCQ and NCQ is exactly the same, although the two have differing implementations. NCQ is designed with consumers in mind, while TCQ is suited for complicated data storage systems.

Tagged Command Queuing has been available in SCSI drives since mid-1990s, when it was added to the SCSI-2 standard. Command queuing was also included in the ATA-4 standard several years later (under the name TCQ as well). Unlike with SCSI, it failed to get widely adopted into ATA drives.

It is worth noting that TCQ supports a deeper queue than NCQ. TCQ supports as many as 216 queued commands (although it is typical for a drive to only support 64), while NCQ only supports as many as 32. Depending on the drive access pattern, the difference in queue length may not make a great difference in practice.

Tagged Command Queuing also allows a more flexible tagging mechanism than Native Command Queuing. Both NCQ and TCQ support simple tags, which allow the drive to execute command in any order it chooses. The word "native" in the name of NCQ refers exactly to how it is completely up to the individual hard disk to decide the optimal order, all requests being of equal importance. But TCQ supports two other modes in addition to simple tags: The initiator can specify that commands be executed in the order sent by the initiator, or the initiator can send a high-priority command to the head of the queue.

TCQ can cause performance drop in lightly queued workloads where the benefit of queuing is outweighed by the significant overhead of the protocol. NCQ addresses that and some other shortcomings of ATA TCQ.

TCQ protocol requires a handshake between the host and the device for each and every command completion. To complete a command in TCQ, the host actually has to issue a new command, called Service, to the device to determine the command to complete. There is no mechanism in TCQ to complete multiple commands at the same time without host intervention. This overhead adds a significant amount of latency to the TCQ. NCQ on the other hand, has a status return mechanism, working without host handshakes. The drive may issue command completions for multiple commands even at the same time.

TCQ has two interrupts for every command. There is no means to combine these interrupts because each step in the TCQ protocol requires a host handshake. There is one interrupt for setting up the DMA engine for a data transfer and another interrupt for completing the command. NCQ has a maximum of one interrupt per command. The number of interrupts per command is often less than one when interrupts are combined. Interrupts may be combined by the drive if it completes multiple commands at the same time. That means that NCQ has a low interrupt overhead compared to TCQ.

TCQ specifies that the drive causes an interrupt when it is ready to transfer data. The host processes the interrupt and determines that the SERV bit is set in the Status register. This means that the drive is ready to proceed with the data transfer for a particular command. Next the host must issue the Service command to the device to determine the tag of the command the data transfer is for. After the Service command is complete, the host can setup the DMA engine for that command. The interrupt service latency and Service command overhead can be a substantial performance penalty. In NCQ, the drive directly selects the DMA context for a data transfer without host intervention. The drive selects the DMA context by sending a packet to the host controller specifying the tag/identifier of the command that the data transfer is for. The host controller hardware then loads the scatter/gather table pointer for that command (based on the tag value) into the DMA engine. Then the DMA transfer may immediately proceed. TCQ does not support this mechanism for DMA transfers and thus it is slower and inefficient.

For the above mentioned reasons it is quite obvious than NCQ is much better than TCQ. As far as data throughput is concerned in accordance with the above TCQ overheads(handshake and interrupts), it must be noted that their effects are somehow minimized due to the fact that TCQ drives are usually found in SMP servers which have the processing power to manipulate such workload.

Finally NCQ has better Power Efficiency compared to TCQ because it uses less than half interrupts for any given transfer and thus consumes less power.

[edit] External links

In other languages

Static Wikipedia (no images)

aa - ab - af - ak - als - am - an - ang - ar - arc - as - ast - av - ay - az - ba - bar - bat_smg - bcl - be - be_x_old - bg - bh - bi - bm - bn - bo - bpy - br - bs - bug - bxr - ca - cbk_zam - cdo - ce - ceb - ch - cho - chr - chy - co - cr - crh - cs - csb - cu - cv - cy - da - de - diq - dsb - dv - dz - ee - el - eml - en - eo - es - et - eu - ext - fa - ff - fi - fiu_vro - fj - fo - fr - frp - fur - fy - ga - gan - gd - gl - glk - gn - got - gu - gv - ha - hak - haw - he - hi - hif - ho - hr - hsb - ht - hu - hy - hz - ia - id - ie - ig - ii - ik - ilo - io - is - it - iu - ja - jbo - jv - ka - kaa - kab - kg - ki - kj - kk - kl - km - kn - ko - kr - ks - ksh - ku - kv - kw - ky - la - lad - lb - lbe - lg - li - lij - lmo - ln - lo - lt - lv - map_bms - mdf - mg - mh - mi - mk - ml - mn - mo - mr - mt - mus - my - myv - mzn - na - nah - nap - nds - nds_nl - ne - new - ng - nl - nn - no - nov - nrm - nv - ny - oc - om - or - os - pa - pag - pam - pap - pdc - pi - pih - pl - pms - ps - pt - qu - quality - rm - rmy - rn - ro - roa_rup - roa_tara - ru - rw - sa - sah - sc - scn - sco - sd - se - sg - sh - si - simple - sk - sl - sm - sn - so - sr - srn - ss - st - stq - su - sv - sw - szl - ta - te - tet - tg - th - ti - tk - tl - tlh - tn - to - tpi - tr - ts - tt - tum - tw - ty - udm - ug - uk - ur - uz - ve - vec - vi - vls - vo - wa - war - wo - wuu - xal - xh - yi - yo - za - zea - zh - zh_classical - zh_min_nan - zh_yue - zu -

Static Wikipedia 2007 (no images)

aa - ab - af - ak - als - am - an - ang - ar - arc - as - ast - av - ay - az - ba - bar - bat_smg - bcl - be - be_x_old - bg - bh - bi - bm - bn - bo - bpy - br - bs - bug - bxr - ca - cbk_zam - cdo - ce - ceb - ch - cho - chr - chy - co - cr - crh - cs - csb - cu - cv - cy - da - de - diq - dsb - dv - dz - ee - el - eml - en - eo - es - et - eu - ext - fa - ff - fi - fiu_vro - fj - fo - fr - frp - fur - fy - ga - gan - gd - gl - glk - gn - got - gu - gv - ha - hak - haw - he - hi - hif - ho - hr - hsb - ht - hu - hy - hz - ia - id - ie - ig - ii - ik - ilo - io - is - it - iu - ja - jbo - jv - ka - kaa - kab - kg - ki - kj - kk - kl - km - kn - ko - kr - ks - ksh - ku - kv - kw - ky - la - lad - lb - lbe - lg - li - lij - lmo - ln - lo - lt - lv - map_bms - mdf - mg - mh - mi - mk - ml - mn - mo - mr - mt - mus - my - myv - mzn - na - nah - nap - nds - nds_nl - ne - new - ng - nl - nn - no - nov - nrm - nv - ny - oc - om - or - os - pa - pag - pam - pap - pdc - pi - pih - pl - pms - ps - pt - qu - quality - rm - rmy - rn - ro - roa_rup - roa_tara - ru - rw - sa - sah - sc - scn - sco - sd - se - sg - sh - si - simple - sk - sl - sm - sn - so - sr - srn - ss - st - stq - su - sv - sw - szl - ta - te - tet - tg - th - ti - tk - tl - tlh - tn - to - tpi - tr - ts - tt - tum - tw - ty - udm - ug - uk - ur - uz - ve - vec - vi - vls - vo - wa - war - wo - wuu - xal - xh - yi - yo - za - zea - zh - zh_classical - zh_min_nan - zh_yue - zu -

Static Wikipedia 2006 (no images)

aa - ab - af - ak - als - am - an - ang - ar - arc - as - ast - av - ay - az - ba - bar - bat_smg - bcl - be - be_x_old - bg - bh - bi - bm - bn - bo - bpy - br - bs - bug - bxr - ca - cbk_zam - cdo - ce - ceb - ch - cho - chr - chy - co - cr - crh - cs - csb - cu - cv - cy - da - de - diq - dsb - dv - dz - ee - el - eml - eo - es - et - eu - ext - fa - ff - fi - fiu_vro - fj - fo - fr - frp - fur - fy - ga - gan - gd - gl - glk - gn - got - gu - gv - ha - hak - haw - he - hi - hif - ho - hr - hsb - ht - hu - hy - hz - ia - id - ie - ig - ii - ik - ilo - io - is - it - iu - ja - jbo - jv - ka - kaa - kab - kg - ki - kj - kk - kl - km - kn - ko - kr - ks - ksh - ku - kv - kw - ky - la - lad - lb - lbe - lg - li - lij - lmo - ln - lo - lt - lv - map_bms - mdf - mg - mh - mi - mk - ml - mn - mo - mr - mt - mus - my - myv - mzn - na - nah - nap - nds - nds_nl - ne - new - ng - nl - nn - no - nov - nrm - nv - ny - oc - om - or - os - pa - pag - pam - pap - pdc - pi - pih - pl - pms - ps - pt - qu - quality - rm - rmy - rn - ro - roa_rup - roa_tara - ru - rw - sa - sah - sc - scn - sco - sd - se - sg - sh - si - simple - sk - sl - sm - sn - so - sr - srn - ss - st - stq - su - sv - sw - szl - ta - te - tet - tg - th - ti - tk - tl - tlh - tn - to - tpi - tr - ts - tt - tum - tw - ty - udm - ug - uk - ur - uz - ve - vec - vi - vls - vo - wa - war - wo - wuu - xal - xh - yi - yo - za - zea - zh - zh_classical - zh_min_nan - zh_yue - zu

Static Wikipedia February 2008 (no images)

aa - ab - af - ak - als - am - an - ang - ar - arc - as - ast - av - ay - az - ba - bar - bat_smg - bcl - be - be_x_old - bg - bh - bi - bm - bn - bo - bpy - br - bs - bug - bxr - ca - cbk_zam - cdo - ce - ceb - ch - cho - chr - chy - co - cr - crh - cs - csb - cu - cv - cy - da - de - diq - dsb - dv - dz - ee - el - eml - en - eo - es - et - eu - ext - fa - ff - fi - fiu_vro - fj - fo - fr - frp - fur - fy - ga - gan - gd - gl - glk - gn - got - gu - gv - ha - hak - haw - he - hi - hif - ho - hr - hsb - ht - hu - hy - hz - ia - id - ie - ig - ii - ik - ilo - io - is - it - iu - ja - jbo - jv - ka - kaa - kab - kg - ki - kj - kk - kl - km - kn - ko - kr - ks - ksh - ku - kv - kw - ky - la - lad - lb - lbe - lg - li - lij - lmo - ln - lo - lt - lv - map_bms - mdf - mg - mh - mi - mk - ml - mn - mo - mr - mt - mus - my - myv - mzn - na - nah - nap - nds - nds_nl - ne - new - ng - nl - nn - no - nov - nrm - nv - ny - oc - om - or - os - pa - pag - pam - pap - pdc - pi - pih - pl - pms - ps - pt - qu - quality - rm - rmy - rn - ro - roa_rup - roa_tara - ru - rw - sa - sah - sc - scn - sco - sd - se - sg - sh - si - simple - sk - sl - sm - sn - so - sr - srn - ss - st - stq - su - sv - sw - szl - ta - te - tet - tg - th - ti - tk - tl - tlh - tn - to - tpi - tr - ts - tt - tum - tw - ty - udm - ug - uk - ur - uz - ve - vec - vi - vls - vo - wa - war - wo - wuu - xal - xh - yi - yo - za - zea - zh - zh_classical - zh_min_nan - zh_yue - zu