Bug 1963 - /etc/crontab et al has no rmmod -a invocation
/etc/crontab et al has no rmmod -a invocation
Status: CLOSED CURRENTRELEASE
Product: Red Hat Raw Hide
Classification: Retired
Component: modutils (Show other bugs)
1.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Cristian Gafton
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 1999-04-03 05:40 EST by Chris Siebenmann
Modified: 2008-05-01 11:37 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 1999-04-13 12:29:43 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Chris Siebenmann 1999-04-03 05:40:27 EST
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 16:24:59 EDT
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 18:25:59 EDT
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 15:06:59 EDT
Cristian are we going to fix this for the release.
Comment 4 Cristian Gafton 1999-04-09 17:54:59 EDT
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 00:43:59 EDT
I'm not sure this is being understood, from the comments so far,
so:
	- 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 17:25:59 EDT
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
kernel.

cks, can you verify that unused modules are in fact not being
unloaded on your system?
Comment 7 Chris Siebenmann 1999-04-12 02:24:59 EDT
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 13:01:59 EDT
johnsonm is taking care of this
Comment 9 Michael K. Johnson 1999-04-12 13:18:59 EDT
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 12:29:59 EDT
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.