Re: Testers wanted: exorcised kmod.c: no more daemon!

Adam J. Richter (adam@yggdrasil.com)
Tue, 14 Apr 1998 19:25:27 -0700


>> = Adam Richter
> = Sten Eriksson
>Adam J. Richter wrote:
>> As everyone on this mailing list seems to agree, there needs to be
>> a user level method for reading the mixer settings before the module
>> is removed. As far as the kmod/modprobe support goes, that is already
>> present. Just add lines like the following to /etc/conf.modules:
>>
>> pre-remove sound /usr/bin/save_mixer_settings
>> post-install sound /usr/bin/restore_mixer_settings
>>
>> If you want to do something more exotic, you can change the program
>> that request_module invokes (under all the versions of kmod) by writing
>> to /proc/sys/kernel/modprobe.

>Hmm, since modprobe allready implements "-r" and executes stuff by the
>rules specified in /etc/conf.modules, would'nt it be great to implement
>"-r -a" that unloads modules like "rmmod -a", that would solve alot of
>the problems.

Oh, now I understand the problem!

I agree with Sten completely on this. The question is how
to go about implementing "modprobe -r -a".

I believe that somebody else on this list (I think it was
Peter Anvin, but the articles have already expired) suggested
timestamping the modules with their last reference time, exposing
that information through /proc, and then having "modprobe -r -a"
use that information to select stale unreferenced modules. This
would potentially enable more flexible removal policies also. For
example, the cost of reinitializing a scsi driver is high, because
of the four seconds that these drivers seem to take in initially
resetting and scanning the scsi bus, so I would ideally prefer to
have a ten minute timeout for removing scsi host adapter drivers,
while I would be happy to have a two minute timeout on most other
modules.

With such a facility in place, it would be possible
to delete the references to MOD_VISITED in the kernel and
the delete_module(NULL) support, so that in this case the
kernel would provide "mechanism" and not "policy."

On the other hand, I could see a case for keeping
delete_module(NULL) for the kernel to call when it is trying
to stop thrashing. Hmmm.

Adam J. Richter __ ______________ 4880 Stevens Creek Blvd, Suite 205
adam@yggdrasil.com \ / San Jose, California 95129-1034
+1 408 261-6630 | g g d r a s i l United States of America
fax +1 408 261-6631 "Free Software For The Rest Of Us."

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu