Re: rmmod -a does not unload unused modules in 2.2.x

Andrew V. Samoilov (sav@bcs.zp.ua)
Mon, 22 Nov 1999 16:08:07 +0200


Keith Owens wrote:
: On Sun, 21 Nov 1999 21:08:44 +0200,
: "Andrew V. Samoilov" <sav@bcs.zp.ua> wrote:
: >Some time ago here was a discussion about kerneld and Linux 2.2.x kernels.
: >I remember it was proposed to use a 'rmmod -a' from cron to unload unused
: >modules. But it doesn't work at least for 2.2.10 and 2.2.13 kernels.
:
: It works for me on kernel 2.2.12 with modutils 2.1.121. Since kernel
: 2.1.91, rmmod just issues syscall delete_module(NULL) and the kernel
: does all the work. There are a couple of things to watch out for, both
: from the kernel code.
:
: It will not automatically delete an autoclean module unless the module
: has been used at least once. So the sequence insmod -k, rmmod -a
: without using the module will not delete it.
:
: Even after using a module, the first rmmod -a does nothing. The second
: one gets rid of the autoclean modules that have been used.

Thanks to all for advise. It seems it's problem with iBCS module.
Here is an example, that show it:

++ /sbin/lsmod
Module Size Used by
++ some_program_what_need_iBCS
++ /sbin/lsmod
Module Size Used by
iBCS 119100 0 (autoclean)
++ sudo /sbin/rmmod -a
++ sudo /sbin/rmmod -a
++ /sbin/lsmod
Module Size Used by
iBCS 119100 0 (autoclean)
++ sudo /sbin/modprobe -k cdrom
++ sudo /sbin/modprobe -k ide-cd
++ sudo /bin/mount -o ro /dev/hdb /cdrom
++ sudo /bin/umount /cdrom
++ /sbin/lsmod
Module Size Used by
ide-cd 21080 0 (autoclean)
cdrom 12048 0 (autoclean) [ide-cd]
iBCS 119100 0 (autoclean)
++ sudo /sbin/rmmod -a
++ sudo /sbin/rmmod -a
++ /sbin/lsmod
Module Size Used by

# the End

--
Regards,
Andrew.

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/