linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Hinds <dhinds@sonic.net>
To: linux-hotplug@vger.kernel.org
Subject: Re: unloading drivers and usage counters
Date: Mon, 22 Jan 2001 06:04:50 +0000	[thread overview]
Message-ID: <marc-linux-hotplug-98014347000254@msgid-missing> (raw)
In-Reply-To: <marc-linux-hotplug-98011145918383@msgid-missing>

On Sun, Jan 21, 2001 at 09:28:41PM -0800, David Brownell wrote:

> Sounds like a substantial change in the model for what module use
> counts should be.  Maybe the pcmcia_cs tools have a better model?

For PCMCIA, module use counts are incremented when a device is opened,
and decremented when closed, just like most non-hot-plug modules.
Attaching a driver to a newly hot plugged device does not increment
its use count.

To decide when to unload a module, the cardmgr daemon keeps track of
the number of times a module has been requested in response to new
device insertions; this count can indeed get messed up if people
manually unload modules, or if cardmgr is killed and restarted.  I am
not bothered much by this, because the consequences are mostly
harmless and the user has to go out of their way to mess up the
automatic usage counting.  In practice, no one has ever complained to
me about it.

The PCMCIA subsystem does provide /proc/bus/pccard/drivers, which
lists what drivers are present, which are modules vs. which are static
linked, and the actual number of present devices that are associated
with each driver.  Cardmgr currently only uses the module/static flag
from this file, so that it won't bother trying to remove a static
driver; it would not be much work to also use the usage information
for precise decisions about when to unload modules.

-- Dave

_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

  parent reply	other threads:[~2001-01-22  6:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-01-21 21:12 unloading drivers and usage counters Oliver Neukum
2001-01-22  5:28 ` David Brownell
2001-01-22  6:04 ` David Hinds [this message]
2001-01-22 16:26 ` David Brownell

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=marc-linux-hotplug-98014347000254@msgid-missing \
    --to=dhinds@sonic.net \
    --cc=linux-hotplug@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;
as well as URLs for NNTP newsgroup(s).