Microsoft optimizes Linux kernel for ARM server





At the Linux Plumbers Conference 2020, Microsoft developers talked about their experimental project - optimizing the Linux kernel for ARM server processors. Chief Software Development Manager Jan Birman made a presentation.



According to the specialist, the project started at the company's internal request. Linux is already being used in projects like Azure Cloud, Azure Sphere, and Windows Subsystem for Linux. Bierman's team was tasked with maximizing cloud service performance on Linux using 64-bit ARM or x86 processors. The developers were allowed to compile the kernel for the operating system with their own parameters and flags.







The original distribution is Ubuntu 19.10 with GCC 9.2.1, binutils 2.33 and kernel 5.3 preinstalled. Server processor - 64-bit ARM Marvell Thunder X2. After brainstorming, the team decided to use LTO and PGO optimizations to build the kernel.







Profiling optimization (PGO or FDO) and communication time optimization (LTO or LTCG) significantly slow down the build process and require more RAM for the compiler to work, but in theory they give an increase in the command execution speed by 10-20%. PGO is rarely used by developers, and LTO has recently been used to build kernels and other packages. Previously, developers were wary of using link time optimization due to compatibility issues in the GCC and LLVM compilers. Birman's team turned to an experienced Linux kernel developer Andy Klin for help, who released a patch to make LTO work correctly with ARM processors. To make PGO work, the developers studied the documentation and achieved stable work by trial and error.







After completing the kernel build, the team tested the performance on the open source redis NoSQL resident database management system. After executing various commands, the developers reported an increase in the speed of command execution by 5-20%. Data obtained from internal redis benchmark test.











By the way, not so long ago Microsoft released the KB4566116 update for Windows 10. The update adds support for the Windows Subsystem for Linux 2 (WSL 2) in the 1909 and 1903 OS versions. This makes it possible to use a full fledged Linux kernel. In WSL2, it is not part of Windows by default, but is loaded dynamically and updated using the tools built into the OS.



All Articles