From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Brownell Date: Mon, 22 Jan 2001 16:26:36 +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 > From: David Hinds > Sent: Sunday, January 21, 2001 10:04 PM > > 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. Hmm, so maybe a pure user-mode solution isn't so brittle as that. That's been in use how many years now? :-) This is stuff that could clearly be handled in some /sbin/hotplug policy code, saving state in some file. > 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. Sounds like this is something that the "linux hotplug" system should perhaps consider providing in a more general way, for all levels of the driver stacks. - 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