Open Source

Torvalds deploys first AI-generated patch in Linux kernel, reports 23x synthetic performance gain

The Linux creator has submitted his own LLM-assisted code contribution after months of evolving his stance on artificial intelligence in kernel development.

3 min read
Linus Torvalds posts his first AI-assisted patch to the Linux kernel, synthetic test clocks 23x performance leap

Linus Torvalds has submitted his inaugural patch written with the assistance of a large language model to the Linux kernel, marking a shift from his earlier hesitation about AI-generated contributions. The patch targets a longstanding performance bottleneck involving severe cache contention when multiple processors simultaneously access the same file—a situation that can arise in contexts involving shared libraries, database systems, and web server infrastructure. Prior efforts by other developers to address this problem had produced mixed outcomes, with none emerging as a fully satisfactory universal fix.

Microsoft data center in Mount Pleasant, Wisconsin
(Image credit: Microsoft)

Torvalds had drafted an initial approach to the problem in early 2024 and tested it on his personal machine for several months. He subsequently decided to "try to actually solve this thing using an LLM," according to his own account. The resulting solution, now available in a development branch, demonstrates a 23x performance improvement when measured against a synthetic benchmark. Torvalds cautioned, however, that real-world performance gains would be substantially lower, as "no real load" would achieve such dramatic improvements. Server-oriented workloads would likely see the most tangible benefits from this optimization.

Torvalds has gradually adopted a supportive position regarding LLM tools within the Linux kernel's controlled and review-intensive development process. In July of the previous year, he declared his readiness to "absolutely put [his] foot down" against those opposed to AI, highlighting that an automated code review system employed by the kernel team surpasses human reviewers and catches elementary programming errors that should never reach submission. The kernel project is also revising its guidelines to eliminate the requirement that contributors explicitly state whether they employed AI assistance when creating their code.

Torvalds has maintained a firm position, characterizing LLMs as simply another instrument in a developer's toolkit, comparable to compilers or text editors. He expects that "people do their best and [...] understand what they are doing." The distinction between a highly experienced programmer using LLMs to expedite routine tasks and an inexperienced developer blindly requesting AI assistance without comprehension is substantial, though some observers note that few individuals possess Torvalds's expertise to properly leverage such technology.

The embrace of AI tooling has not proceeded without complications. The Linux security mailing list became "unmanageable" earlier in the year as AI systems grew proficient at identifying common security vulnerability patterns. The project now processes approximately 2,000 CVEs per release at an unprecedented rate. This surge has forced the team to discontinue support for older hardware drivers, which frequently become targets for security reports despite their minimal user base.

Source: Tom's Hardware · Reporting supplemented by The Silicon Ledger staff.