Specifications

D
evice Driver Programming
13-4
NOTE
Loadable high-level drivers (HDRV) cannot be auto loaded.
HDRV drivers can, however, be demand loaded using the
modadmin command, or demand loaded by init(1M) through
the idmodload(1M) command during a system reboot.
Demand Unload 13
A demand unload is a user request, made using the modadmin(1M) command, to
remove a loadable module from the running system.
If the module is not being used when the request is made, and if no other loaded module
depends on the module, DLM unloads it. If the module is being used, DLM does not
unload the module.
Auto Unload 13
The auto-unload daemon wakes up periodically to unload any modules that have become
candidates for unloading. Modules become candidates for auto unloading when they are
inactive, they have not been accessed for some predetermined amount of time, and no
other loadable modules depend on them.
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 modules
can override the value of the global auto-unload delay by specifying their own auto-unload
delay value in their Mtune(4) files, as prefix_UNLOAD_DELAY.
NOTE
On a demand unload request, the auto-unload delay parameter
value is ignored.
If the attempt to auto unload a module is successful, the memory allocated for the module
is reclaimed. Unloading continues until all unloadable candidates are processed.
NOTE
Modules that are demand loaded cannot be auto unloaded. If a
demand-loaded module is no longer needed in the system, it must
be demand unloaded. If the demand unload failed, the module
auto unloads later.