Tuesday, January 6, 2009

Memory Optimizations: Kernel Programming

UNLIKE User-space code/data, kernel code/data reside PERMANENTLY in memory. They are NOT swapped Out.

>>> module_init : RUN Time Optimization. Executed when the associated module is loaded. If the module is statically included in the kernel, the kernel can free the module_init routine right at the boot time, after it runs.

>>> module_exit: LINK Time Optimization. It is never executed if the modules are statically included in the kernel. In such cases, it is not needed to include module_exit routines into the kernel image and are discarded at Link Time.


No comments: