public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Erik Andersen <andersen@codepoet.org>
To: James Bottomley <James.Bottomley@steeleye.com>,
	linux-scsi@vger.kernel.org
Subject: Re: [PATCH] SCSI hotplug support
Date: Mon, 14 Oct 2002 23:25:22 -0600	[thread overview]
Message-ID: <20021015052521.GA1967@codepoet.org> (raw)
In-Reply-To: <20021014222515.GD1274@redhat.com>

On Mon Oct 14, 2002 at 06:25:15PM -0400, Doug Ledford wrote:
> On Mon, Oct 14, 2002 at 03:54:17PM -0600, Erik Andersen wrote:
> > 
> > I have a 4 slot firewire RAID system with 4 hotswapable 120 GB
> > drives in it connected via a single firewire cable.  This is very
> > small compared to the potential size.  Imagine someone plugs in a
> > 63 device firewire RAID box.  Then nodemgr.c determines if the
> > device being hotplugged is an SBP-2 device and if so execs
> > /sbin/hotplug with some extra SBP-2 specific arguments.  Then
> > /sbin/hotplug writes some junk into /proc/scsi/scsi 63 times, and
> > so 63 times we context switch back into kernel space to
> > register/unregister a device and then 63 times we context switch
> > back into user space so we can continue doing the hotplug thing.
> > 
> > And the point of this exercise again was?  Its not like userspace
> > is setting policy -- the sbp2.c driver knew exactly what the
> > Right Thing(tm) was all along.  I think using the function calls
> > per my patch is a far cleaner solution,
> 
> First, 63 context switches is a red herring.  The total amount of work
> required to attach a scsi disk is high enough that a context switch per
> disk is totally lost noise.

Ok, I'll agree that the overhead is small compared to the rest of
the process.  Though I contend that it is still needless additional 
overhead.

>                              Second, user space *does* set policy.  The
> hot plug manager can end up doing things like changing the ownership of
> the newly added device to that of the current console owner and then
> automatically mounting it on /mnt/camera_drive (just an example).  IOW,

I suppose hotplug _could_ do these things.  It currently doesn't
do anything of the sort.  If someone wishes to modify
/etc/hotplug/ieee1394.agent to do these things, thats fine.  It
sounds to me like you are wishing for /sbin/hotplug to take on
some sortof devfsd type role.  If that is what you want to build,
thats up to you I suppose.  I really don't need or want that.  So
sure, I'll also agree with you that user space does set policy.

I personally perfer a policy of minimalism.  I'd prefer the
kernel continue to allocate SCSI drives (/dev/sdXXX) on a
first-come-first-served basis as it currently does and then use
things like UUIDs to keep mount points consistant.  That seems
far more palatable then to having /sbin/hotplug mounting things
and mucking with perms.

> user space hot plug *needs* to be involved whether you make the kernel hot
> plug work or not.  Secondly, once you accept that user space hot plug
> *needs* to be involved, then letting it take care of the hot plugging for
> you instead of writing a kernel patch makes more sense.

I'll grant that having /sbin/hotplug load needed kernel modules
is a good thing.  With some hacking I suppose it could muck about
with your device nodes if you are into that sortof thing.  But I
still have not conceeded that we need /sbin/hotplug involved in
registering and unregistering devices with the SCSI subsystem.

When I plug a Adaptec 1480 Cardbus SCSI adaptor into my laptop, I
don't need /sbin/hotplug to register the drives.  They just
magically get registered.  Similarly, if I have 3 SBP-2 drives
plugged into an Adaptec AFW-1430 card when I plug in the card,
the 3 SBP-2 drives are magically registered with the SCSI
subsystem.  So if we require /sbin/hotplug to be involved, we
will need to unify the coldplug and hotplug cases to ensure
identical behavior....

> Also, it's likely that calling in from the hot plug manager is *much*
> better from the kernel perspective for one very important reason, user
> context.  The add_single_device operation will not be done from an
> interrupt/tasklet/softirq/etc. context if the hot plug manager does it,
> making sleeping, memory allocation, and such easier to get right.  What
> context does the 1394 code call the scsi code from in your patch?

It is called from within the insmod's context.

 -Erik

--
Erik B. Andersen             http://codepoet-consulting.com/
--This message was written using 73% post-consumer electrons--

  reply	other threads:[~2002-10-15  5:25 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-14  5:40 [PATCH] SCSI hotplug support Erik Andersen
2002-10-14  7:06 ` Matthew Dharm
2002-10-14  7:12   ` Erik Andersen
2002-10-14 15:47     ` Kurt Garloff
2002-10-14 16:19       ` Mike Anderson
2002-10-14 20:41         ` Erik Andersen
2002-10-14 22:10           ` Mike Anderson
2002-10-14 20:46       ` Erik Andersen
2002-10-14 15:57 ` James Bottomley
2002-10-14 17:22   ` Mike Anderson
2002-10-14 17:30   ` Matthew Dharm
2002-10-14 17:39     ` James Bottomley
2002-10-14 19:11       ` Oliver Xymoron
2002-10-15  0:42       ` Kurt Garloff
2002-10-14 20:37   ` Erik Andersen
2002-10-14 21:07     ` James Bottomley
2002-10-14 21:54       ` Erik Andersen
2002-10-14 22:25         ` Doug Ledford
2002-10-15  5:25           ` Erik Andersen [this message]
2002-10-15 15:33             ` Doug Ledford
2002-10-15 18:18               ` Erik Andersen
2002-10-15 18:22             ` Doug Ledford
2002-10-15 18:45               ` Erik Andersen
2002-10-15 19:13                 ` Doug Ledford
2002-10-15 19:32                   ` Erik Andersen
2002-10-15 19:45                     ` James Bottomley
2002-10-15 19:50                     ` Scott Merritt
2002-10-15 19:55                     ` Doug Ledford
2002-10-15 22:07                       ` Erik Andersen
2002-10-16  2:40                         ` Doug Ledford
2002-10-18 11:28                           ` Erik Andersen
2002-10-15 21:43                 ` Oliver Neukum
2002-10-15 22:07                   ` Erik Andersen
2002-10-14 22:19       ` Oliver Neukum
2002-10-15  0:22         ` Doug Ledford
2002-10-15  7:53           ` Oliver Neukum
2002-10-15 14:35             ` Doug Ledford
2002-10-15 15:19               ` Oliver Neukum
2002-10-15 15:40                 ` James Bottomley
2002-10-15 17:47               ` Erik Andersen
2002-10-15 18:34                 ` Doug Ledford
2002-10-15 18:22               ` Scott Merritt

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=20021015052521.GA1967@codepoet.org \
    --to=andersen@codepoet.org \
    --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