ByteDance Working To Make It Faster Kexec Booting The Linux Kernel

Written by Michael Larabel in Linux Kernel on 25 July 2022 at 06:40 AM EDT. 59 Comments
LINUX KERNEL
ByteDance as the Chinese company behind TikTok has been working on a number of Linux kernel optimizations the past few years and their most recent work is for faster Kexec rebooting of the kernel. With their massive fleet of servers powering TikTok and other apps, they will do whatever they can to shave milliseconds off the boot/reboot time of their servers and that is what most of their Linux optimizations have been about -- including this newest patch series for faster Kexec reboots.

ByteDance like many other large organizations rely on Kexec reboots to move to a new kernel either for security, maintenance, or optimization reasons. By using Kexec they avoid the more significant downtime of their servers POST'ing and other tasks. But even using Kexec to switch to a new kernel to avoid the hardware initialization and bootloader can still be too much downtime.

With today's "faster kexec reboot" patch series they take aim at around 500 ms that can be optimized out and get the time from the machine kexec to start kernel function down to just 15 ms.


With the popularity of TikTok, Bytedance engineers continue doing whatever they can to optimize Linux kernel performance and reducing downtime of their servers.


The optimizations proposed include supporting the uncompressed kernel on x86/x86_64 to speed up the boot process rather than being a compressed kernel image, avoiding a memory copy when the kernel is uncompressed, and reusing the crash kernel reserved memory for normal kexec operations. Enabling uncompressed kernels on x86 alone shaved over 150 ms off their boot time but meant going from 8.5M to 53M for the kernel image size.

This patch series touching around 100 lines of Linux kernel code is what they are now hoping to upstream for shaving around a half second off their Kexec reboot times.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week