230:
support first party DMA. Instead of interrupting the CPU before the task to force it to program the host bus adapter's DMA engine, the hard drive tells the host bus adapter which command it wants to execute, causing the host bus adapter to program its integrated first-party DMA engine with the parameters that were included in the command that was selected by the hard drive when it was first issued, and then the DMA engine moves the data needed to execute the command. To further reduce the interrupt overhead, the drive can withhold the interrupt with the task completed messages until it gathers many of them to send at once, allowing the operating system to notify many threads simultaneously that their tasks have been completed. If another task completes after such an interrupt is sent, the host bus adapter can concatenate the completion messages together if the first set of completion messages has not been sent to the CPU. This allows the hard disk firmware design to trade off disk performance against CPU utilization by determining when to withhold and when to send completion messages.
205:
Since responding to interrupts uses CPU time, CPU utilization rose quickly when ATA TCQ was enabled. Also, since interrupt service time can be unpredictable, there are times when the disk is ready to transfer data but is unable to do so because it must wait for a CPU to respond to the interrupt so that the CPU knows that it needs to program the third party DMA engine.
83:
disk drives service the requests in the order received, like an old elevator; queueing drives service requests in the most efficient order. This may improve performance slightly in a system used by a single user, but may dramatically increase performance in a system with many users making widely varied requests on the disk surface.
67:
For increased efficiency the sectors should be serviced in order of proximity to the current head position, not the order received. The queue is constantly receiving new requests, fulfilling and removing existing requests, and re-ordering the queue according to the current pending read/write requests
167:
The SCSI-3 protocol permits 64 bits to be used in the tag field, allowing up to 2 tasks in one task set to be issued before requiring that some of them complete before any more commands be issued. However, different protocols that implement the SCSI protocol might not permit the use of all 64 bits.
82:
If the buttons for floors 5, 2, and 4 are pressed in that order with the elevator starting on floor 1, an old elevator would go to the floors in the order requested. A modern elevator processes the requests to stop at floors in the logical order 2, 4, and 5, without unnecessary travel. Non-queueing
180:
reserved. This flexibility allows the designer of a protocol to trade off queuing ability against cost. Networks that can be large, such as iSCSI networks, benefit from more tag bits to deal with the larger number of disks in the network and the larger latencies such large networks generate, while
204:
engine based on the result of that command, wait for the third party DMA engine to execute the command, and then had to interrupt the CPU again to notify it when the DMA engine finished the task so that the CPU could notify the thread that requested the task that the requested task was finished.
229:
is a modern standard which drastically reduces the number of required CPU interrupts compared to ATA TCQ. Like ATA TCQ, it allows up to 32 outstanding commands per device, but was designed to take advantage of the ability of SATA host bus adapters that are not emulating parallel ATA behavior to
158:
allows for low interrupt overhead. The older ISA bus required a SCSI host adapter to generate an interrupt to cause the CPU to program the third-party DMA engine to perform a transfer, and then required another interrupt to notify the CPU that a task in the queue was finished, causing high CPU
54:
Without TCQ, an operating system was limited to sending one request at a time. To boost performance, the OS had to determine the order of the requests based on its own – possibly incorrect – perspective of the hard drive activity (otherwise known as
200:. When a drive was ready for a transfer, it had to interrupt the CPU, wait for the CPU to ask the disk what command was ready to execute, respond with the command that it was ready to execute, wait for the CPU to program the host bus adapter's
138:
allows tasks to execute in any order that does not violate the constraints on the tasks in the other two modes. After a command in a task is completed, a notification is sent by the device that completed the command to the host bus adapter.
59:). 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). Thus TCQ can improve the overall performance of a hard drive if it is implemented correctly.
68:
and the changing position of the head. The exact reordering algorithm may depend upon the controller and the drive itself, but the host computer simply makes requests as needed, leaving the controller to handle the details.
208:
Therefore, this standard was rarely implemented because it caused high CPU utilization without improving performance enough to make this worthwhile. This standard allows up to 32 outstanding commands per device.
195:
This effort was not very successful because the ATA bus started out as a reduced-pin-count ISA bus. The requirement for software compatibility made ATA host bus adapters act like ISA bus devices without
117:, unique to SCSI TCQ, a task is pushed into the front of a queue, ahead of all other tasks including other pending head of queue tasks. This mode is not used much because it can cause
181:
smaller-scale networks, such as parallel SCSI chains, do not have enough disks or latency to need many tag bits and can save money by using a system supporting fewer bits.
99:
TCQ was the first popular version of TCQ and is still popular today. It allows tasks to be entered into a queue using one of three different modes:
142:
Whether or not SCSI TCQ causes massive interrupt overhead depends on the bus being used to connect the SCSI host bus adapter. On
339:
192:
TCQ was developed in attempt to bring the same benefits as SCSI to ATA drives. It is available in both
Parallel and Serial ATA.
28:
128:, a task must execute after all older tasks have completed and before all newer tasks begin to execute (excluding newer
373:
403:
419:
293:
Dees, Brian (November–December 2005). "Native command queuing - advanced performance in desktop storage".
226:
218:
44:
79:
in a building servicing multiple calls and processing them to minimise travel illustrates the idea well.
251:
201:
155:
429:
118:
310:
302:
143:
72:
36:
56:
424:
413:
346:
255:
247:
197:
189:
173:
314:
151:
223:
48:
40:
24:
306:
76:
51:
drives. SCSI TCQ does not suffer from the same limitations as ATA TCQ.
169:
147:
96:
32:
168:
For example, older parallel SCSI permits 8 bits of tag bits,
43:. ATA TCQ is not identical in function to the more efficient
406:
by
Patrick Schmid, and Achim Roos of Tom's Hardware Guide
374:"1532D: AT Attachment with Packet Interface - 7 Volume 1"
71:
This queuing mechanism is sometimes referred to as "
381:1532D: AT Attachment with Packet Interface - 7
154:, and other buses that permit it, first party
39:to send multiple read and write requests to a
87:Comparison of SCSI TCQ, ATA TCQ, and SATA NCQ
8:
368:
366:
334:
332:
330:
328:
326:
324:
288:
286:
284:
239:
404:Can Command Queuing Turbo Charge SATA?
282:
280:
278:
276:
274:
272:
270:
268:
266:
264:
176:permits up to 16 bits of tag with tag
340:"SCSI Architecture Model - 3 (SAM-3)"
7:
14:
172:permits up to 32 tag bits, and
1:
75:", as the image of a modern
35:hard drives. It allows the
446:
216:
307:10.1109/MP.2005.1549750
219:Native Command Queuing
45:Native Command Queuing
17:Tagged Command Queuing
252:Serial attached SCSI
163:SCSI TCQ Tag Length
119:resource starvation
27:built into certain
115:head of queue mode
437:
391:
390:
388:
387:
378:
370:
361:
360:
358:
357:
351:
345:. Archived from
344:
336:
319:
318:
290:
259:
244:
179:
144:Conventional PCI
73:elevator seeking
37:operating system
445:
444:
440:
439:
438:
436:
435:
434:
410:
409:
400:
395:
394:
385:
383:
376:
372:
371:
364:
355:
353:
349:
342:
338:
337:
322:
295:IEEE Potentials
292:
291:
262:
246:in the form of
245:
241:
236:
221:
215:
202:third-party DMA
198:first party DMA
187:
177:
165:
94:
89:
65:
12:
11:
5:
443:
441:
433:
432:
427:
422:
412:
411:
408:
407:
399:
398:External links
396:
393:
392:
362:
320:
260:
238:
237:
235:
232:
217:Main article:
214:
211:
186:
183:
164:
161:
111:
110:
107:
104:
93:
90:
88:
85:
64:
61:
57:I/O scheduling
47:(NCQ) used by
13:
10:
9:
6:
4:
3:
2:
442:
431:
428:
426:
423:
421:
420:AT Attachment
418:
417:
415:
405:
402:
401:
397:
382:
375:
369:
367:
363:
352:on 2012-03-17
348:
341:
335:
333:
331:
329:
327:
325:
321:
316:
312:
308:
304:
300:
296:
289:
287:
285:
283:
281:
279:
277:
275:
273:
271:
269:
267:
265:
261:
257:
256:Fibre Channel
253:
249:
248:Parallel SCSI
243:
240:
233:
231:
228:
225:
220:
212:
210:
206:
203:
199:
193:
191:
184:
182:
175:
174:Fibre Channel
171:
162:
160:
157:
153:
149:
145:
140:
137:
133:
131:
130:head of queue
127:
122:
121:when abused.
120:
116:
108:
105:
103:head of queue
102:
101:
100:
98:
91:
86:
84:
80:
78:
74:
69:
62:
60:
58:
52:
50:
46:
42:
38:
34:
30:
26:
22:
18:
384:. Retrieved
380:
354:. Retrieved
347:the original
298:
294:
242:
222:
207:
194:
188:
166:
141:
135:
134:
129:
126:ordered mode
125:
123:
114:
112:
95:
81:
70:
66:
53:
20:
16:
15:
152:PCI Express
136:Simple mode
430:Serial ATA
414:Categories
386:2007-01-02
356:2007-02-24
301:(4): 4–7.
234:References
159:overhead.
41:hard drive
25:technology
315:36264057
213:SATA NCQ
132:tasks).
92:SCSI TCQ
77:elevator
63:Overview
185:ATA TCQ
106:ordered
23:) is a
313:
258:drives
254:, and
178:0xFFFF
109:simple
377:(PDF)
350:(PDF)
343:(PDF)
311:S2CID
170:iSCSI
148:PCI-X
425:SCSI
224:SATA
97:SCSI
49:SATA
33:SCSI
31:and
303:doi
227:NCQ
190:ATA
156:DMA
124:In
113:In
29:ATA
21:TCQ
416::
379:.
365:^
323:^
309:.
299:24
297:.
263:^
250:,
150:,
146:,
389:.
359:.
317:.
305::
19:(
Text is available under the Creative Commons Attribution-ShareAlike License. Additional terms may apply.