Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 15 Aug 1996 11:10:40 -0700
From:      "Justin T. Gibbs" <gibbs@freefall.freebsd.org>
To:        current
Subject:   Large changes to the SCSI system coming down the pipe
Message-ID:  <199608151810.LAA29156@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
If you've already been following this on the freebsd-scsi list, I
appologize in advance for the duplicate information...

I've started work on a large scale clean up of our SCSI system which
includes bug fixes, performance improvements, and driver API changes.
Unfortunately, the changes touch every "type" driver (sd, st, cd, od, etc.)
and every "controller" driver (bt, aic7xxx, ncr, etc) in the system.  Since
I can't test all of these drivers, I've been posting my patch sets into
Freefall's incoming directory so that I can get some test coverage before
committing these to the tree.  If you don't mind the risk of a little
system instability, please help test these changes.

Before I give you the location of the patches, let me give you some
details:

First of all the patches to the NCR driver are not complete.  If you have
an NCR controller, don't even think about trying these changes.  Stefan is
working on completing the changes to the NCR driver and I will release
another patch set once he's done.

What do the patches do?  The main goal of this round of changes is to fix
the "can't sleep when out of resources" problem that has been in the SCSI
system for a long time.  The problem is very pronounced when using a
controller that only has a small number of per transaction resources that
can be easily ehausted (aic7xxx cards with tagged queueing or a large
number of targets for example).  The problem is exposed by the infamous "Oops not queued!" kernel message.  The way that
resources are managed, besides having this problem, is inefficient as
well.  The new strategy incorperates a "per resource pool" device queue
that provides round robin scheduling of devices that share resources
without any sleeping required in the common case.  Controller resources are
also retrieved before a command is dequeued removing the need for any
sleeping code in each controller driver. There is still some
sleeping that occurs for non strategy based requests, but a process context
always exists in these cases and the sleeping is only used to limit the
number of scsi_xfer structures that are allocated.  Since strategy based
I/O is handled via a queue instead of relying on sleep/wakeup, the code
should be much more efficient.  The round robin scheduling also ensures
that any device on the queue can run when resources are freed instead of
only allowing the device that returned the resource to start another
request without doing a wakeup as was the policy of the old code.

While I was in there, I cleaned out unused fields in data structures,
removed a bcopy in the transaction creation path, and fixed the handling of
the target busy case.  There are still lots of other changes on my
whiteboard, but I'd like to get this first round of changes into the tree
before the diffs become too huge.

If you've been able to read through all of this and are still interested,
you can pick up the patch set as:

ftp://Freefall.FreeBSD.org/incoming/scsi-diffs.960815.gz

They have been tested most thoroughly with the aic7xxx driver so far.

Please post any bug reports against these patches to the FreeBSD-scsi list.

Thanks,
--
Justin T. Gibbs
===========================================
  FreeBSD: Turning PCs into workstations
===========================================



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