From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Hinds Date: Mon, 22 Jan 2001 06:04:50 +0000 Subject: Re: unloading drivers and usage counters Message-Id: List-Id: References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org 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