[8184] in linux-scsi channel archive
Re: scatter gather or not to scatter gather
daemon@ATHENA.MIT.EDU (Kurt Garloff)
Wed Feb 23 12:23:03 2000
Date: Wed, 23 Feb 2000 17:56:19 +0100
From: Kurt Garloff <garloff@suse.de>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: mdharm-scsi@one-eyed-alien.net (Matthew Dharm),
linux-scsi@vger.rutgers.edu (The Linux SCSI list)
Message-ID: <20000223175619.M3231@mobil.tue.nl>
Mail-Followup-To: Alan Cox <alan@lxorguk.ukuu.org.uk>,
mdharm-scsi@one-eyed-alien.net (Matthew Dharm),
linux-scsi@vger.rutgers.edu (The Linux SCSI list)
Mime-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-md5;
protocol="application/pgp-signature"; boundary="W4pDZ/VvazBYHhxQ"
In-Reply-To: <E12NaP4-0003gD-00@the-village.bc.nu>; from alan@lxorguk.ukuu.org.uk on Wed, Feb 23, 2000 at 11:56:24AM +0000
--W4pDZ/VvazBYHhxQ
Content-Type: text/plain; charset=us-ascii
On Wed, Feb 23, 2000 at 11:56:24AM +0000, Alan Cox wrote:
> > >From my logs, it seems that the SCSI layer is sending me long
> > scatter-gather chains, where each block is 1K in size, and they tend to be
> > all or mostly adjacent in RAM.
>
> Turn on clustering as well, then you should see a stream of page sized blocks
> typically. Also with the normal 4K file system folks use now. (And with CD
> you'll see 2K blocks clustering into pages)
It's not always that easy. If your controller has hardware or a scripts
processor or whatever to support scatter-gather _without_ generating
interrupts and needing the CPU to set up the next chunk for the host
adapter, I would use that one and _disable_ clustering.
So you save your CPU some work.
> > The question boils down to this: Why would it be bad for me to replace the
> > SG_ALL in the host template with SG_NONE?
>
> scsi generic large requests stop working
> many more scsi command issue/completion cycles occur
Which means a increase in wasted CPU cycles and worse performance ...
The mid-layer will issue one SCSI command for every SG segment, unless it
can do the clustering for you ...
It might not be an issue for your device, but consider that while the data
transfer gets faster and faster (up to 160MB/s with DDR LVD Wide SCSI), the
time needed to arbitrate the bus, select, transfer the command, the messages
and the status, did rarely get faster, so you really want to keep the
number of commands needed to a minimum.
Regards,
--
Kurt Garloff <garloff@suse.de> Eindhoven, NL
GPG key: See mail header, key servers Linux kernel development
SuSE GmbH, Nuernberg, FRG SCSI, Security
--W4pDZ/VvazBYHhxQ
Content-Type: application/pgp-signature
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.1c- (GNU/Linux)
Comment: For info see http://www.gnupg.org
iD8DBQE4tBEyxmLh6hyYd04RATfCAJwI6t2qUwFUhoEADCW7P8d7nRX1FwCeJG+r
kkdSbZF5fX3gLyZSjS3Ki/s=
=7dgW
-----END PGP SIGNATURE-----
--W4pDZ/VvazBYHhxQ--
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.rutgers.edu