From: Luben Tuikov <luben@splentec.com>
To: James Bottomley <James.Bottomley@steeleye.com>
Cc: SCSI Mailing List <linux-scsi@vger.kernel.org>
Subject: Re: [PATCH / RFC] scsi_error handler update. (1/4)
Date: Mon, 17 Feb 2003 13:29:07 -0500 [thread overview]
Message-ID: <3E5129F3.2040807@splentec.com> (raw)
In-Reply-To: 1045504719.1749.77.camel@mulgrave
James Bottomley wrote:
> On Mon, 2003-02-17 at 12:20, Luben Tuikov wrote:
>
>>There is no ``locking hierarchy'' -- i.e. a lock *only* locks its list
>>manipulation. So, you don't have to have a string of locks to change
>>a scsi_command, for example.
>
>
> If I want to loop over all outstanding commands on a device (say because
> the FC has just got a LIP removal), how do I do it? Your design implies
> I have to loop over all portals, targets and luns. To do this loop, I'd
> have to stabilise all the lists by acquiring the three locks that
> protect them, wouldn't I?
No, not at all. If you know the struct scsi_lu, you can just lock
the pending_cmd_q and loop over the commands.
struct scsi_target is ``locked'' *implicitly* simply by having
atomic_read(&target->lu_q_count) != 0.
struct scsi_portal is ``locked'' *implicitly* simply by having
atomic_read(&portal->target_q_count) != 0.
struct scsi_core is ``locked'' *implicitly* simply by having
atomic_read(&core->portal_q_count) != 0.
You certainly do not need to lock the the whole hierarchy of locks
to loop over all pending commands. Locks protect local data.
I.e. you just want to protect yourself from someone messing the
list up while you're traversing it.
>>When was the last time a SPI HBA set channel/bus to anything different
>>than 0?
>
>
> Channel is a special abstraction for the dual channel chips. It's
> really an extension of host number for drivers that need a channel
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Thus it can be abstracted into a ``portal''.
>>>3. I don't see where the mid-layer has a use for the data. By and
>>
>>Well, how can I contend *that* statement?... This basically means
>>that the whole thing I proposed is cr*p.
>
>
> This is the key issue. Complexity should only be introduced in a design
Well if it were the key issue, you should've just said *that*.
Nicely done.
> when it serves a justifiable purpose. How do the 4 layers you propose
> simplify the design/improve the throughput or in any other way add
> benefit over the two layers (host and device) that we already have?
First of all it's 3 layers -- you're counting scsi_core but you don't
count it in the current structure. (scsi core pointers you can have as
ether-pointers, just as is now the practice)
So there's 3 layers: portal (aka host), target, lu. One more than
the current structure of scsi_core.
Look, you *NEED* the target layer, simply /because/ it exists in
nature. ;-)
I.e. a TARGET is the _addressable_ entity from a portal, i.e.
addressable on the fabric, but a LU is *NOT*.
The reason you get away with it now, is because linux scsi-core
gets help from the LLDDs. But you have to understand that an LU
is a _function_ of the target. So without this help of the LLDDs
the current scsi-core will *NOT* be able to address more than one
LU in a multi-LU target.
Yes, I know there's the old scan for LUs, but this is only
because linux scsi LLDD are SPI centric.
I.e. when you send a scsi command you're sending it to a (target,lu)
pair and this is what the LLDD does for you, i.e. it separates it
to a target, lu.
So, the question is: Is it worth it to abstract Target and LU into
OO design? Or is it better to leave it clunked up together as it is
now (device=(target,LU))?
I'm thinking sysfs here.
> Because the standards say so isn't enough. The Mid-layer's job is to
And I'm not saying that it is enough. I'm just saying that:
> make efficient use of devices which follow the standards as simply and
> elegantly as possible, not mirror the SCSI architecture model.
Right, ``elegantly'' is the key word.
I don't think you can shrink any more from the 3 layer I proposed,
unless you go to the current 2 layer.
Judging from your words, the (host,device) pair is elegant enough?
If not, do you mind telling what is/would be?
--
Luben
next prev parent reply other threads:[~2003-02-17 18:29 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-02-11 8:13 [PATCH / RFC] scsi_error handler update. (1/4) Mike Anderson
2003-02-11 8:15 ` [PATCH / RFC] scsi_error handler update. (2/4) Mike Anderson
2003-02-11 8:17 ` [PATCH / RFC] scsi_error handler update. (3/4) Mike Anderson
2003-02-11 8:19 ` [PATCH / RFC] scsi_error handler update. (4/4) Mike Anderson
2003-02-11 22:38 ` [PATCH / RFC] scsi_error handler update. (3/4) James Bottomley
2003-02-12 7:16 ` Mike Anderson
2003-02-12 14:26 ` Luben Tuikov
2003-02-12 14:37 ` James Bottomley
2003-02-12 22:34 ` James Bottomley
2003-02-13 8:24 ` Mike Anderson
2003-02-11 16:49 ` [PATCH / RFC] scsi_error handler update. (1/4) Luben Tuikov
2003-02-11 17:22 ` Mike Anderson
2003-02-11 19:05 ` Luben Tuikov
2003-02-11 20:14 ` Luben Tuikov
2003-02-11 21:14 ` Mike Anderson
[not found] ` <3E495862.3050709@splentec.com>
2003-02-11 21:20 ` Mike Anderson
2003-02-11 21:22 ` Luben Tuikov
2003-02-11 22:41 ` Christoph Hellwig
2003-02-12 20:10 ` Luben Tuikov
2003-02-12 20:46 ` Christoph Hellwig
2003-02-12 21:23 ` Mike Anderson
2003-02-12 22:15 ` Luben Tuikov
2003-02-12 21:46 ` Luben Tuikov
2003-02-13 15:47 ` Christoph Hellwig
2003-02-13 18:55 ` Luben Tuikov
2003-02-14 0:24 ` Doug Ledford
2003-02-14 16:38 ` Patrick Mansfield
2003-02-14 16:58 ` Mike Anderson
2003-02-14 18:50 ` Doug Ledford
2003-02-14 19:35 ` Luben Tuikov
2003-02-14 21:20 ` James Bottomley
2003-02-17 17:20 ` Luben Tuikov
2003-02-17 17:58 ` James Bottomley
2003-02-17 18:29 ` Luben Tuikov [this message]
2003-02-18 5:37 ` Andre Hedrick
2003-02-18 19:46 ` Luben Tuikov
2003-02-18 22:16 ` Andre Hedrick
2003-02-18 23:35 ` Luben Tuikov
2003-02-17 20:17 ` Doug Ledford
2003-02-17 20:19 ` Matthew Jacob
2003-02-17 21:12 ` Luben Tuikov
2003-02-17 17:35 ` Luben Tuikov
2003-02-14 21:27 ` James Bottomley
2003-02-17 17:28 ` Luben Tuikov
2003-02-16 4:23 ` Andre Hedrick
2003-02-11 18:00 ` Patrick Mansfield
2003-02-11 18:44 ` Mike Anderson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3E5129F3.2040807@splentec.com \
--to=luben@splentec.com \
--cc=James.Bottomley@steeleye.com \
--cc=linux-scsi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox