From: Luben Tuikov <luben@splentec.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: Mike Anderson <andmike@us.ibm.com>, linux-scsi@vger.kernel.org
Subject: Re: [PATCH / RFC] scsi_error handler update. (1/4)
Date: Thu, 13 Feb 2003 13:55:15 -0500 [thread overview]
Message-ID: <3E4BEA13.50402@splentec.com> (raw)
In-Reply-To: 20030213154748.A1965@infradead.org
Christoph Hellwig wrote:
>>If a LLDD drops the lock on entry and gains it again on exit, then clearly
>>it doesn't need it.
>>
>>Else if it doesn't, it then must be relying on it elsewhere, which is
>>asking for trouble from eh_* point of view. A search and replace
>>will do ok, with a local lock,
>
>
> right.
>
>
>>unless it sets the pointer, in which case this is much easier.
>
>
> which pointer? the host lock?
Yes.
[On host_lock be gone:]
> I think it's absolutely worth the effort!
[On new queuecommand() prototype]
> James, any comments on this one? I think it's something that is save for
> 2.5.
Glad to hear that you're agreeing with me, but it doesn't depend on us.
>>>If you have anough time a prototype now won't hurt though - the scsi code
>>>shouldn't really change during early 2.6.
>>
>>Yes, I've been thinking of rewriting SCSI Core completely for 2.7, so maybe
>>this prototype will be its embryonic state?
>
>
> Maybe :)
But of course -- you'll probably just use the idea and rewrite everything. :-)
Anyway, one of my greatest beef with the current SCSI Core is the variable
names. At the bottom I explain/give justification of *why* indeed I have
a problem in general with naming. (I think I gave it away several times before.)
Examples:
scsi_device:
::siblings -- this is NOT a container of siblings, which
are to be the devices themselves, but is an *entry* into a siblings container.
Thus, in the host we have a siblings container and the scsi_device
should have an ``entry'' into this container. Furthermore, I'd not choose
``host::siblings'' but something more approachable like ``host::device_list''.
::same_target_siblings -- this shouldn't exist by design.
::device_busy -- this should probably be atomic_t and its name should
be more descriptive of what it *is* -- something like ``active_cmd_count''.
Ideally when there's a queue for each state of a command, say,
incoming_q, pending_q, done_q, those will have also have their own atomic_t
count, like incoming_q_count, pending_q_count, done_q_count, and maybe their
own locks, like incoming_q_lock, pending_q_lock, done_q_lock.
This and other similar features would make new-scsi-core, completely
re-entrant and multithread capable.
scsi_host:
::sh_list -- this is an entry, but it suggests being a list.
::my_devices -- ``device_list'' would've been so much better.
We know that those *are* going to be the host's devices -- whom else's
are they going to be?
::host_busy -- could this have been ever more ambiguous?
::host_failed -- this suggests a boolean value... but it's
not.
In general if an object should participate in some sort
of a container like a list or queue, it should do so one at a time.
This way a dependency chart is very clear and there's no loops,
which would lead to poor programming design. Everyone should
have taken a course in this during their undergrad years at
college/university.
E.g. scsi_core <- portal <- target <- lun <- command,
where each level to the right is 0/1:N.
In fact, programming is done as soon as the *design* of
the object structure and names is complete. The rest is
just coding the functions to describe the relationships
between the objects.
Blah... blah... blah... am I wasting my time?
>>Some features would be that target/lun scanning will be a completely *distinct*
>>functionality and one can even move it to userspace.
>
>
> James, outlined something similar on the last kernel summit. I think it's
> a worthwile change for 2.7 (let's hope initramfs is useable then)
Yes, I know. But this ``feature'' is *not* the driving force of the
new design of the new-scsi-core. In fact, the other way around.
I.e. since new-scsi-core is jus an *interface* to the Service Delivery
Subsystem (aka LLDD), target/lun scanning is NOT part of it. new-scsi-core
just sits between the application client sending scsi tasks (read/write/etc)
and the LLDD's interface, plus a few minor capabilites.
I.e. target/lun scanning will be an application client sending scsi commands
down the LLDDs, analyzing the results and using a well defined interface
to add/remove devices from new-scsi-core tables (given capabilities).
SCSI scanning could be a kernel module or user space process, XOR both,
depening on how the user felt this morning.
>>Another feature is that new-scsi-core will *not* do any memory allocation
>>for sg lists for commands -- this is the task of the application client
>>(block layer, app, scanning code, etc).
>
>
> i.e. the scsi upper layer driver?
Whoever -- the application client... block layer, etc. new-scsi-core
is not a memory management system, it's just an interface. This will make
it quite *simpler and smaller*, yet powerful.
>>BTW, what kind of prototype are you talking about, functional or non-functional?
>
>
> limited functionality (i.e. just a single driver or so converted)
Time is of the essence and given I've got a lot of my own job-work do to
and catch up with (for which get payed), I'm not sure I can start this now.
I'd need to hear something from the powers that be. Since this is 2.7 work,
I don't expect it until the summer. And summer time is always more relaxed.
--
Luben
P.S. The naming punctuality comes from the fact that symbols themselves
carry meaning -- and a proper name or symbol would dictate its proper
use. As an example I gave Newton's and Leibniz's calculus notations.
For more information one can check out any mathematical philosophy book
or as a start, the Pulitzer prize winner ``GEB''.
next prev parent reply other threads:[~2003-02-13 18:55 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 [this message]
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
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=3E4BEA13.50402@splentec.com \
--to=luben@splentec.com \
--cc=andmike@us.ibm.com \
--cc=hch@infradead.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.