Shared Memory

John Macdonald john-Z7w/En0MP3xWk0Htik3J/w at public.gmane.org
Tue Feb 1 16:17:28 UTC 2005


On Tue, Feb 01, 2005 at 09:09:11AM -0500, Lennart Sorensen wrote:
> On Tue, Feb 01, 2005 at 11:43:39AM +0200, Peter L. Peres wrote:
> > I thought ncq was beneficial on scsi because several devices share the 
> > bus. On sata there is only one per bus. How would they benefit from ncq 
> > ?
> 
> No the idea is to issue multiple commands to each device in a queue and
> letting the device schedule which order to serve them in based on where
> it's head is and which order will get all the data the fastest.  Old
> scsi disks might only have had an 8 command queue, while many newer
> drives have 256 command queues.

This does put a higher urgency to an application's need
to ensure that critically ordered I/O actually happens in
order, though.  If multiple I/Os are issued at the same time
(the next one started before the previous one has completed)
the large queue means that there is a greater chance of the
second being completed significantly earlier than the first.
A power failure at the wrong time, and that can be catastrophic.
For example, a database program will often have to ensure that
a log write is fully complete before it can safely proceed
with committing a transaction - otherwise it could partially
process the transaction, have a system crash lose the rest
*and also prevent the completion of the log write*, and then
on restart not have the log record to let it know that the
partially completed transaction has to either be completed or
rolled back.  (Of course, you'd really want a UPS to prevent
a power failure from causing an immediate failure.)

(An application that carelessly uses overlapping I/O is already
broken, but with small queues it may have been "getting away"
with its broken behaviour because there is a small window for
critical failure; the larger window can make the code that is
broken in theory be more likely to fail in practice.)

-- 
--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list