AI Fixes Linux Bottlenecks Using “Hideous” Code

Sep 10, 2026

A Linux developer used AI to fix bottlenecks that caused problems when building the kernel. The resulting AI-generated code needed a lot of work.

Most people assume AI makes life easier. Sometimes, that's the case – other times, not so much. Such was the case when Linux developer Lorenzo Stoakes of Arm decided to fix a few single-thread bottlenecks that caused a typical kernel build to "consist of a frustratingly large amount of time," Stoakes reported in a kernel.org email. By fixing those bottlenecks, Stoakes found that "allmodconfig builds up to 36% faster, incremental builds up to ~70% faster, and noop builds up to ~90% faster."

In that same email, Stoakes stated that he used an LLM to determine where the bottlenecks were and how to improve them. He then said that the LLM generated a lot of code, "much of it hideous."

"The patches work to parallelize a lot of single-threaded tasks and improving the efficiency of the build process," a Phoronix report stated. "Areas such as Kbuild, kallsyms, modpost, objtool, mksysmap, and the Rust build system were all affected by this work."

Stoakes had to audit and rewrite much of it and heavily edit commit messages, the cover letter, and comments.

Although the AI code required a lot of extra work, it did manage to fix the bottlenecks. After manual verification, the performance improvements were found to be legitimate.

Do note that since an LLM was used extensively to solve the bottleneck problem, each associated commit carries an Assisted-by tag.
 
 

 
 
 

Related content

  • Kernel Hacks Intro

    If you get right down to it, the Linux kernel is the real Linux. This month we focus on tools for tuning and tailoring the kernel.

  • Optimizing Linux Performance

    When you're tuning up Linux performance, you need to keep an eye on a number of components and parameters. This article describes some techniques for optimizing performance by tuning TCP/IP, reducing latency, and configuring NUMA-aware systems. You'll also learn about CPU scheduling and memory management tuning.

  • An Enterprise Distro for Server, Cloud, and AI

    Inheriting native SuperPoD support from SP3, openEuler 24.03 LTS SP4 delivers a tailor-made solution for server, cloud, and AI scenarios while further enhancing system reliability and usability.

  • Kernel News

    Chronicler Zack Brown reports on the latest news, views, dilemmas, and developments within the Linux kernel community.

  • Kernel News

    Chronicler Zack Brown reports on the little links that bring us closer within the Linux kernel community.

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More

News