From owner-freebsd-hackers Mon Aug 4 14:51:31 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id OAA29989 for hackers-outgoing; Mon, 4 Aug 1997 14:51:31 -0700 (PDT) Received: from Octopussy.MI.Uni-Koeln.DE (Octopussy.MI.Uni-Koeln.DE [134.95.166.20]) by hub.freebsd.org (8.8.5/8.8.5) with SMTP id OAA29984 for ; Mon, 4 Aug 1997 14:51:28 -0700 (PDT) Received: from x14.mi.uni-koeln.de (annexr3-5.slip.Uni-Koeln.DE) by Octopussy.MI.Uni-Koeln.DE with SMTP id AA01340 (5.67b/IDA-1.5 for ); Mon, 4 Aug 1997 23:51:25 +0200 Received: (from se@localhost) by x14.mi.uni-koeln.de (8.8.6/8.6.9) id XAA00581; Sun, 3 Aug 1997 23:26:54 +0200 (CEST) X-Face: " Date: Sun, 3 Aug 1997 23:26:54 +0200 From: Stefan Esser To: Peter Mutsaers Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: What is a good SCSI tags value? References: <8767toi0q9.fsf@plm.xs4all.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.74 In-Reply-To: <8767toi0q9.fsf@plm.xs4all.nl>; from Peter Mutsaers on Sun, Aug 03, 1997 at 02:11:58AM +0200 Sender: owner-freebsd-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk On Aug 3, Peter Mutsaers 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