From: Alexey Morozov Date: Tue, 29 Mar 2005 08:00:23 +0000 Subject: a solution for module load on demand problem Message-Id: <42490B17.1040601@idisys.iae.nsk.su> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org Hi! udev's FAQ clearly says that it will never load modules on demand. That in fact is a good thing just because it allows to make udev a pure userland solution w/o unneeded complexity. "Do one task but do it well" and so on... On the other hand, it's a common habit for Linux'ers to load certain kernel modules right when corresponding functionality is need, so called load-on-demand. Yes, I know that the FAQ says that properly configured system has all modules pre-loaded on startup. But there're other points of view on this problem and common practice existed for ~ a decade. Modules can be loaded upon an access to a corresponding device node and there IS a kernel/userland framework to support this functionality. /proc/sys/kernel/modprobe is still in place. But it requires device node to exist before module loaded, thus contradicting the idea of completely dynamic /dev Generally there's no need to waste kernel space w/ unneeded kernel modules especially those crappy ones like buggy drivers for softmodems and greedy drivers for a certain popular graphics cards family. Actually I have a much longer list of such modules, because I tries to support udev subsystem in my distro and users bugreport me about all their problems in this area. So the problem really exists and currently I know several possible ways to solve it. All these methods seem incomplete and failing in some cases. Here they are. 1. Fill on each startup /etc/modules (or its analogue) w/ all modules suitable for a particular system and load all modules from it. This solution doesn't involve any load-on-demand, but not always acceptable (see above). 2. For [certain] static devices nodes for devices /not suitable/ for hotplug system (for different reasons, including system's administrator voluntary decision), create them statically. This buries the idea of a completely dynamic /dev and threatens w/ unexpected problems when Linus make major/minors assignment truly arbitrary as he promised for the future 2.7 branch. 3. Make a /complex framework/ intercepting [certain] types of access to /dev and loading modules upon access to its corresponding device (so called devfsd approach). The FAQ says: "The devfs approach caused a lot of spurious modprobe attempts as programs probed to see if devices were present or not. Every probe attempt created a process to run modprobe, almost all of which were spurious.". I have to agree with this because my distro has an optional analogue for this approach, based on Adam J. Richter's patch for tmpfs (see http://www.ussg.iu.edu/hypermail/linux/kernel/0411.0/1568.html) and a small custom shell script which is called for missing devices. I can see all these problems first-hand (and can describe them if needed) So my questions are. * How other people/distros solve / intend to solve this problem? * Are there better solutions than those I'm familiar with? * And what is The Proclaimed Way (if any) in this area? Thank you for your attention, Alexey Morozov. ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_ide95&alloc_id396&op=click _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel