Hotswapping Linux kernel modules
Contemporary operating system kernels are able to improve their functionality by installing kernel extensions at runtime. However, when an existing kernel extension needs to be upgraded, it must be completely removed before the new kernel extension is installed. Consequently, the new kernel extension needs to be run from the beginning, which also influences the applications using this kernel extension. This work describes the design and implementation of a Linux module system that supports hotswapping, in which a module can be replaced while it is in use. Rather than completely removing the old module, the new module can inherit the state held by the old module so the dependent applications are not affected. For example, a Linux file system module can be hotswapped without unmounting the corresponding partitions and terminating the applications that use these partitions. The proposed system is implemented on Linux kernel 2.6.11. Existing modules can be loaded into the hotswap system without change and can be hotswapped by changing only a few lines. Additionally, the hotswap system does not impose any runtime overhead on module invocations.