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

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


Jon Tombs <jon@gte.esi.us.es> writes:
>Adam J. Richter said:
>>
>> As my original posting describes, you have not lost the ability
>> to do automatic unloading of modules. You just have to add a line to
>> root's crontab to have "rmmod -a" execute periodically.
>>
>> "rmmod -a" does exactly the same thing as the periodic
>> unloading part of the old kmod deamon. They each execute just one
>> system call: unload_module(NULL). They each unload only the unused
>> automatically loaded modules.

>[...] why don't you strip the module loading part out of kmod, and just leave
>the unloading part. Then anybody who doesn't like the conceptual change,
>or doesn't run cron can use the new kmod (which now only does periodic
>unloads).

People who don't use cron can execute the following line
from a shell script:

(while true ; do sleep 120 ; rmmod -a ; done) &

Alternatively, if they're running just a standalone C
program, they can execute the following code fragment:

if (fork() == 0) {
for(;;) {
sleep(120);
delete_module(NULL);
}
}

A person who just "doesn't like th econceptual change" can
patch the kernel.

The change to kmod is not just aesthetic. It eliminates a
race condition when your initial ramdisk preloads a few modules that
are necessary for the boot process (e.g.., binfmt_aout) and the full
blown set of modules and dependencies and modprobe is not on the ramdisk,
but you do want these modules to eventually be unloaded if they are not
used for a while after the system boots.

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