Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 3 Aug 1997 23:26:54 +0200
From:      Stefan Esser <se@FreeBSD.ORG>
To:        Peter Mutsaers <plm@xs4all.nl>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: What is a good SCSI tags value?
Message-ID:  <19970803232654.23196@mi.uni-koeln.de>
In-Reply-To: <8767toi0q9.fsf@plm.xs4all.nl>; from Peter Mutsaers on Sun, Aug 03, 1997 at 02:11:58AM %2B0200
References:  <8767toi0q9.fsf@plm.xs4all.nl>

next in thread | previous in thread | raw e-mail | index | archive | help
On Aug 3, Peter Mutsaers <plm@xs4all.nl> wrote:
> I noticed (though LINT and ncrcontrol) that I can set the number of
> tags used. I have a NCR board and used to have the FAILSAFE option
> set. This reduces SCSI_NCR_DFLT_TAGS to 0.
> 
> One of my 3 disks seems to support tags. Now I wonder:
> 
> - What exactly are these tags? I think it is something like number of
>   concurrent disk operations, is that correct?

The tag is sent together with the command.

When the disk drive knows it won't have to
send data for the next few micro-seconds 
(or even a shorter time), it will give up
SCSI bus ownership, and will reselect the 
initiator (SCSI controller) again, when 
there is data or a result to transfer.

If a tag has been sent with the command,
it will be sent back on each reselect, and
the host adapter knows on which command to
continue.

The drive is free to change the order of
commands, as long as the final state of the
data on the media is the same as had resulted
from the original sequence of commands.
(There exists an "ordered" tag, which will
imply a "barrier": All earlier commands will
be completed before this command is started,
and no later command will be started before
it completes.)

The drive can not only read data in the most
appropriate order, but can also start another
transfer of data on writes, and signal success
later, if working with tags. This gives the 
same effect as "early return" on writes, where
a success status is returned when all data is
in the drive's cahce, but with no risk that the
data may still be lost by a hard drive failure.

> - I can set it to 16, maximum. What is a good value?

I've performed quite some tests, and found a 
value of 4 to 8 to be optimal. One of the 
reasons is, that the NCR driver keeps all the
command control blocks in a linear list, and
has to search that list for a matching CCB in
a number of situations. Increasing the number
of tags makes this list grow, and the system
time per command goes up. 

With 16 tags, I found reduced throughput at
higher CPU load, in my tests. But it is well 
possible, that a system that is I/O bound will 
take more advantage of the drive optimizing
accesses than lost because of higher CPU load.

And: There appears to be no "fairness count",
and some SCSI commands may be delayed by more
than 5 seconds. This can cause a command to 
be aborted because of a timeout, but will also
possibly affect user perceived latencies.

I'm using a setting of 4 tags myself, BTW.

Regards, STefan



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19970803232654.23196>