2000-11-29 01:09:39

by Kurt Garloff

[permalink] [raw]
Subject: 2.4.0-test: rmmod -a without effect

Hi,

this is a 2.4.0-test11 system;
rmmod -a (modutils-2.3.21) fails to unload unused autocleanable modules:
modprobe -r behaves the same, BTW

root@cantaloupe:~ > lsmod
Module Size Used by
ppp_deflate 44736 0 (autoclean) (unused)
ppp_generic 25728 0 (autoclean) [ppp_deflate]
root@cantaloupe:~ > rmmod -a
root@cantaloupe:~ > lsmod
Module Size Used by
ppp_deflate 44736 0 (autoclean) (unused)
ppp_generic 25728 0 (autoclean) [ppp_deflate]

As the binary does just a syscall delete_module(0), I guess it's the
kernel's fault. Same behaviour with 2.4.0-test9 and -test11-ac2.

Is this known and to be expected?

Regards,
--
Kurt Garloff <[email protected]> Eindhoven, NL
GPG key: See mail header, key servers Linux kernel development
SuSE GmbH, Nuernberg, FRG SCSI, Security


2000-11-29 04:50:53

by Keith Owens

[permalink] [raw]
Subject: Re: 2.4.0-test: rmmod -a without effect

On Wed, 29 Nov 2000 01:37:22 +0100,
Kurt Garloff <[email protected]> wrote:
>this is a 2.4.0-test11 system;
>rmmod -a (modutils-2.3.21) fails to unload unused autocleanable modules:

Designed behaviour. sys_delete_module only removes autoclean modules
that have been used at least once, either they have been used or some
other module has a reference to them. Otherwise you get nasty races
like this

cpu 0 cpu 1
request_module(foo)
modprobe -k foo
insmod -k foo
foo is loaded, unused
kernel sees foo has loaded
rmmod -a
kernel uses foo