Bug 1963 - /etc/crontab et al has no rmmod -a invocation
Summary: /etc/crontab et al has no rmmod -a invocation
Alias: None
Product: Red Hat Raw Hide
Classification: Retired
Component: modutils
Version: 1.0
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Cristian Gafton
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 1999-04-03 10:40 UTC by Chris Siebenmann
Modified: 2008-05-01 15:37 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 1999-04-13 16:29:43 UTC

Attachments (Terms of Use)

Description Chris Siebenmann 1999-04-03 10:40:27 UTC
2.2.* kernels require 'rmmod -a' to be run periodically
in order to automatically remove autoclean(able) kernel
modules. crontabs-1.7-5 doesn't seem to have any such
invocation; presumably one should be added (at an interval
picked to suit).

 I'd suggest something like:
	*/10 * * * *	root	/sbin/rmmod -as

Comment 1 Preston Brown 1999-04-05 20:24:59 UTC
Periodically removing not-needed kernel modules is debatably a good
thing.  However, it can be a very bad thing.  For instance, for sound
cards (the most common thing to be periodically in use followed by
periods of unuse) unloading the driver causes it to lose current mixer
settings, etc. etc.

Cristian, opinion?

Comment 2 Chris Siebenmann 1999-04-05 22:25:59 UTC
A RedHat 5.2 system will unload unused kernel modules that are
marked as autocleanable (some, eg sound modules and the st module,
are not marked autocleanable when loaded). At the moment, a
Rawhide-based system won't, because of kerneld being replaced by
other things. That's why I suspect that this is a bug.

Comment 3 Preston Brown 1999-04-09 19:06:59 UTC
Cristian are we going to fix this for the release.

Comment 4 Cristian Gafton 1999-04-09 21:54:59 UTC
The kmod is still in its early stages - the kmod will eventually deal
with this. For now, suddenly unloading unused modul;es can be a real
pain - for example my sound card does an ugly noise every time the
sound module is loaded, and I don;t want to hear that every N minutes.

Also, some module loading can cause real problems and delays, like
probing for a scsi card, etc.

So for now we will have to live with it.

Comment 5 Chris Siebenmann 1999-04-10 04:43:59 UTC
I'm not sure this is being understood, from the comments so far,
	- modules can only be removed if they are *both* unused
	  (for a while) *and* marked as autocleanable.
	- modules loaded explicitly, such as sound and SCSI tape
	  and so on, are generally not marked autocleanable unless
	  one takes specific steps to do so.
	- in 2.0.* kernels, ie in RedHat 5.0/5.1/5.2, kerneld
	  periodically removes such modules.
	- in 2.2.* kernels there is no kerneld. In order to duplicate
	  its removal of idle, autocleanable modules one must run an
	  rmmod -a periodically. This has *identical* behavior as
	  kerneld does/did.

 A number of modules will be marked as autocleanable in a normal
configuration: ethernet drivers, PPP and compression methods, all
the various modules associated with alternate filesystems such as
MS-DOS (or NFS), the loopback driver, etc.

 Right now, a RedHat 5.0/5.1/5.2/etc machine will unload these
modules when they haven't been used for a while and are no longer
needed. A Rawhide or Starbuck machine does not; they stick around
to clutter up memory.

 If your RedHat 5.x machine is working fine now, adding 'rmmod -a'
to the crontab of an equivalent Starbuck/Rawhide will just make it
behave the same. Not adding it has the primary effect of cluttering
up memory with currently extraneous modules. Adding the rmmod -a
won't remove any modules that would not have been removed under 5.2
et al.

 If this *really* is what Redhat thinks is the desirable behavior,
I'm puzzled, but it's your call.

(I have already seen another person report this omission on the
Starbuck mailing list, FYI.)

Comment 6 Michael K. Johnson 1999-04-11 21:25:59 UTC
I understand that we are running kerneld regardless of the kernel
version, 2.0 or 2.2, so that it will do all the module loading on
a 2.0 kernel, and will do the equivalent of rmmod -a on a 2.2

cks, can you verify that unused modules are in fact not being
unloaded on your system?

Comment 7 Chris Siebenmann 1999-04-12 06:24:59 UTC
I've let my system sit for an hour and a half and autocleanable
modules haven't unloaded. Two runs of rmmod -a unloaded them all.

 Kerneld is definetly not started on a 2.2 kernel, as per the
code in /etc/rc.d/rc.sysinit; it only tries to start it if there
is no /proc/sys/kernel/modprobe. (And kerneld is not running on
my Rawhide system.)

Comment 8 Cristian Gafton 1999-04-12 17:01:59 UTC
johnsonm is taking care of this

Comment 9 Michael K. Johnson 1999-04-12 17:18:59 UTC
Sorry, things had changed between the installed system that I was
looking at and the current release and I didn't know it.  I'll add
the rmmod -a invocation.  Thanks for finding this.

Comment 10 Michael K. Johnson 1999-04-13 16:29:59 UTC
modutils as of 2.1.121-11 installs an /etc/cron.d/kmod that does
all kernel module related stuff; so far, rmmod -a.

Note You need to log in before you can comment on or make changes to this bug.