[907] in linux-scsi channel archive
Re: Tagging commands
daemon@ATHENA.MIT.EDU (Gerard Roudier)
Sat Nov 9 21:37:06 1996
Date: Sat, 9 Nov 1996 22:46:40 +0000 (GMT)
From: Gerard Roudier <groudier@club-internet.fr>
To: "Dejan 'Svedja' Ilic" <svedja@lysator.liu.se>
cc: linux-scsi@vger.rutgers.edu
In-Reply-To: <Pine.GSO.3.95Lrindlow.961109133533.9124A-100000@tingeling.lysator.liu.se>
On Sat, 9 Nov 1996, Dejan 'Svedja' Ilic wrote:
>
> Hi.
>
> About tagging..
>
> Is there any way of checking how many tagged commands a unit (disc,cdrom
> etc) supports ?
For the moment, I never heard anything about cdroms supporting tagged
commands.
According to scsi-2 specifications, a device must return QUEUE FULL
status when its command queue is full. Seems obvious but it is not.
If the size of the queue is a fixed value, we can use this maximum
without QUEUE FULL problems. However scsi-2 does not say that this queue
depth must be fixed.
I currently use 8, sometimes 12 tagged commands with my hard disks:
(IBM0662S12 and Quantum Atlas XP32150W) and I never got queue full status.
However, it has been reported that some news HDs may return queue full
status in some situations even when fiew commands are queued to them.
I refers to IBM DORS 32160 and Quantum Atlas 4.3 GB.
This status is returned when the system do lots of small IO. My guess is
that the firmware tries lots of optimizations and gets some internal queue
full. Optimizations are probably related to write clustering.
Such queue full statuses are harmless if the system handles correctly this
condition, but may cause crash if not.
The version 1.14 of the BSD NCR driver ported to Linux tries to handle queue
full status with the following heuristic:
- Disable temporalily tagged command queueing
- Let the middle level scsi driver redo the command
- Increase max tagged command every 100 GOOD STATUS received.
I have done some simulations of queue full and it seems to me that it
should work.
The version 1.12c of linux-2.0.X does not implement this heuristic and so
may have problems on queue full status.
A good hard disk which supports tagged commands generally accepts at least
16 commands. You should look at disk manufacturers web server. Lots of
informations are available about disks specifications and features.
> I thought that if that could be known you could have a pre-device
> setting for how many commands to tag. say, 4 for /dev/sda, 8 for sdb
> etc.. Wouldn't that optimize the preformance better ?
The overall performance gain of tagged command is very hard to observe.
Usual benchmarks like Bonnie Iozone on Byte's do most sequential IOs and
tagged command are useless in such condition. It may even happen that
performances decrease with tagged command queueing.
The only benchmark I have found to test tagged command queueing is to
read concurrently severall files.
For example: max tags = 4, read concurrently 3 files of 50 MB.
In such conditions, the hard always have 3 read IOs queued and so can
optimize seeks a lot. Performance improvement can be more than 30%.
I observed a 20 % performance gain with a DEC Hard disk which does not
support write caching with only 4 tagged commands.
A large queue depth for tagged command may increase performances a lot
when disk internal write caching is disabled but not when it is enabled.
So, in order to get maximum performances with hard disks:
- Enable disk internal cache for writing when it is possible.
- Use a small number of tagged commands: 4 is resonnable.
If your disk does not support write caching or if you donnot take the
risk of such caching scheme, use more tagged commands: 8 is reasonnable.
> What happends if I deceide I want to have 12 tagged commands but my
> device supports up to 6 commands ?
It will return QUEUE FULL status when the driver will attempt to queue a
7th command.
> Thanks
>
> Dejan.
Gerard.