|
|
The kernel periodically wakes up the auto-unload daemon to unload any modules that have become candidates for unloading. Modules that were autoloaded become candidates for auto-unloading when they are inactive, they have not been accessed for a predetermined amount of time, and no other loadable modules depend on them.
If the attempt to auto-unload a module is successful, the memory allocated for the module is reclaimed. Unloading continues until all the unloadable modules are unloaded. (These unloaded modules remain on the disk, ready to be reloaded whenever necessary.)
For example, a loadable device driver would become a candidate for auto-unloading on the last close of all its configured devices, and a loadable STREAMS module would become a candidate for auto-unloading on its last I_POP. The amount of time that must elapse before inactive modules are considered candidates for auto-unloading is controlled by the value of the global tunable parameter DEF_UNLOAD_DELAY. Individual ``old style'' modules can override the value of the global auto-unload delay by specifying their own value for the auto-unload delay tunable parameter, PREFIX_UNLOAD_DELAY, in their Mtune(4dsp) file (but this is not true for ``new style'' modules such as DDI8 device drivers). The name of the module's unload delay tunable must begin with the ``prefix'' field from /etc/conf/mdevice.d/device converted to upper case letters. See Master(4dsp) for the structure of the files in mdevice.d.