20-24 September 2021
US/Pacific timezone

Optimizing Linux Kernel with BOLT

24 Sep 2021, 09:35
Microconference1/Virtual-Room (LPC Virtual)


LPC Virtual

Toolchains and Kernel MC Toolchains and Kernel MC


Maksim Panchenko (Facebook)


Previous research has demonstrated that the Linux Kernel can benefit greatly from the latest compiler optimization techniques. Binary Optimization and Layout Tool (BOLT) is successfully used to accelerate large applications compiled with PGO and LTO by further improving the code layout to favor underlying hardware page and instruction caching. However, applying BOLT to the kernel faces multiple hurdles as the tool splits and reorders code sequences across function boundaries. The corresponding metadata used for code patching at boot and runtime needs to be updated accordingly. At the same time, BOLT optimizations have to be tailored to meet certain expectations about the properties of the code. Updating exception-handling and stack-unwinding data present another set of challenges. Even allocating memory for the modified code is not as straightforward as is the case with a typical ELF binary. We'll discuss the possible approaches to optimizing the kernel with BOLT and the project's current status.

I agree to abide by the anti-harassment policy I agree

Primary author

Maksim Panchenko (Facebook)

Presentation Materials