IT

kmorph: open-source tool to restore Linux kernel without reboot

The Multikernel team has released kmorph, an open-source project for fast Linux kernel recovery and live updates without a full system reboot.

·2 min read
kmorph: open-source tool to restore Linux kernel without reboot

The Multikernel project development team has introduced an open-source project called kmorph. This solution is designed for fast recovery after a Linux kernel crash, as well as for replacing the Linux kernel in live mode without performing a full reboot.

The kmorph project is being developed by Cong Wang, who also maintains the traffic control (TC) subsystem in the Linux kernel.

  • kmorph was developed by the Multikernel team led by Cong Wang.
  • The tool allows fast recovery from crashes and live kernel updates in seconds.
  • A backup kernel and minimal environment are pre-loaded into system memory.
  • The project supports x86_64 and ARM64 architectures, with RISC-V support in progress.

How kmorph Works and Architecture

The fast restart method in the solution is based on pre-loading a backup Linux kernel into memory. This backup kernel replaces the primary working kernel in the event of a failure or when an update to a new version is required.

Read alsoTurning an Android TV Box into a Linux Mini Server

This approach bypasses the traditional full reboot, which typically takes minutes due to hardware initialization and kernel dump saving procedures. With kmorph, downtime is reduced to absolute minimums.

Software Tools and Integration

The switching process is coordinated using two software tools. The kmorph utility runs in the active environment, builds the backup environment contents, and synchronizes the network state.

Meanwhile, the kmorphd daemon runs in the backup environment and monitors the state of the active environment. Integration into Linux distributions is carried out using standard tools like dracut, initramfs-tools, kernel-install, and systemd.

Kernel Updates and Performance Testing

In addition to crash recovery, kmorph provides the ability to update the kernel without a traditional reboot. To speed up recovery, typical services like nginx can run in standby mode within the backup environment.

During tests conducted by the developers, an nginx server resumed operation approximately two seconds after a kernel crash. In the future, the team aims to achieve instant switching completely transparently to connected clients.

Comparison and Future Outlook

The Linux kernel already includes mechanisms like Kexec HandOver (KHO) and Live Update Orchestrator (LUO), but they cannot be used during kernel panics and lag behind kmorph in switching speed because kmorph already keeps the new kernel in memory.

Currently, kmorph supports x86_64 and ARM64 architectures, with work underway for RISC-V. This tool provides a significant step forward for reliable server infrastructure and minimizing downtime.

Source: Все публикации подряд на Хабре

Related articles