From: David Brownell <david-b@pacbell.net>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: linux-kernel@vger.kernel.org
Subject: Re: 2.5.47bk2 + current modutils == broken hotplug
Date: Thu, 14 Nov 2002 08:19:20 -0800 [thread overview]
Message-ID: <3DD3CD08.7080003@pacbell.net> (raw)
In-Reply-To: 20021114111904.9A5312C25F@lists.samba.org
This is about another of the limitations/flaws of the current
module framework, which I'm hoping the new one could fix...
>>Is it true that the infrastructure newly in place can easily be
>>made to provide (from user-space) the policy of "driver remains
>>loaded until the devices it's bound to are all unplugged"?
>
>
> That should always be true, unless I'm missing something. What kind
> of devices?
Any device whose driver gets modprobed through hotplug ... it'd
be good to have the module unload automatically when the hardware
is gone. The pcmcia tools do this already, with a more limited
problem domain, by tracking device-to-driver associations in the
kernel. But other hotpluggable frameworks can't do it today, and
it seems to be the module framework which gets in the way.
Consider two instances of such a device. Hotplug one, the driver
is loaded, refcount zero since it's not opened. Then rmmod on
unplug would be appropriate: the hardware is gone.
But instead of unplugging it, plug in a second. Now rmmod is no
longer an appropriate default policy on unplug, even though the
module "refcount" is still zero, since the user could still try
access the other device. (Maybe they were plugging in devices
until they found the one with the data they were after, and just
hadn't looked at that the other one yet.)
It's a case where the current modprobe/rmmod scheme is counting
the wrong kinds of things. Changing module refcounts to track the
device bindings would be a "hard" policy, interfering with driver
developer and sysadmins (gotta reboot or unplug to change drivers).
Tracking such device-to-driver bindings in userland is fragile.
Today's workaround is not to rmmod ... an undesirable answer.
So I keep thinking the right answer is to have a separate count
to track hardware bindings, or at any rate some "soft" policy
hook is needed to prevent rmmod in such cases. Sysadmins and
driver developers would be able to override the policy, but
Joe Tux-user would just stick to the default.
- Dave
>>That'd be a user-friendly policy, but we'd still need to handle
>>today's developer-oriented "sysadmin can always remove module"
>>policy. (Me, I'd run with the "user friendly" policy except
>>when hacking a driver. Then I'd debug/rmmod/update/modprobe.)
>
>
> rmmod -f is about as unfriendly as you can get, really 8)
>
> Cheers,
> Rusty.
> --
> Anyone who quotes me in their sig is an idiot. -- Rusty Russell.
>
next prev parent reply other threads:[~2002-11-14 16:09 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-11-13 20:11 2.5.47bk2 + current modutils == broken hotplug David Brownell
2002-11-13 20:17 ` Greg KH
2002-11-13 20:40 ` David Brownell
2002-11-13 20:59 ` Jeff Garzik
2002-11-13 21:07 ` Greg KH
2002-11-13 22:45 ` David Brownell
2002-11-13 21:24 ` Jeff Garzik
2002-11-13 23:00 ` David Brownell
2002-11-14 3:46 ` Rusty Russell
2002-11-14 8:02 ` David Brownell
2002-11-14 10:01 ` Rusty Russell
2002-11-14 16:19 ` David Brownell [this message]
2002-11-14 17:42 ` Rusty Russell
2002-11-14 10:41 ` Gerd Knorr
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=3DD3CD08.7080003@pacbell.net \
--to=david-b@pacbell.net \
--cc=linux-kernel@vger.kernel.org \
--cc=rusty@rustcorp.com.au \
/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