Re: Linux 1.99.5 module-unloading: Trigger-happy!

Bjorn Ekwall (bj0rn@blox.se)
Fri, 17 May 1996 17:26:38 +0200 (MET DST)


Henrik "Hawkeye" Storner wrote:
> It seems that kerneld will automatically unload *any* module that
> hasn't been used, whether it was loaded by kerneld or not. E.g.
[...]
> Is this intentional ?

No.

Bjorn

--- linux-pre2.0.5/kernel/module.c.ouch Fri May 17 16:56:22 1996
+++ linux/kernel/module.c Fri May 17 16:58:10 1996
@@ -293,7 +293,7 @@
else {
for (mp = module_list; mp != &kernel_module; mp = mp->next) {
if ((mp->ref == NULL) && (mp->state == MOD_RUNNING) &&
- ((GET_USE_COUNT(mp) & ~(MOD_AUTOCLEAN | MOD_VISITED)) == 0)) {
+ ((GET_USE_COUNT(mp) & ~MOD_VISITED) == MOD_AUTOCLEAN)) {
if ((GET_USE_COUNT(mp) & MOD_VISITED)) {
/* Don't reap until one "cycle" after last _use_ */
GET_USE_COUNT(mp) &= ~MOD_VISITED;