⚡
Brief IA
›

Linux: Torvalds Tests AI-Co-Written Patches with Claude

💻 Code & Dev·Tom Levy·

Linux: Torvalds Tests AI-Co-Written Patches with Claude

Linux: Torvalds Tests AI-Co-Written Patches with Claude
⚡
Key Takeaways
1Linus Torvalds has submitted Linux kernel patches co-written with Claude Code
2Tests on his laptop show significant gains in concurrent reads
3The branch is not integrated into Linux 7.3-rc6 and presents technical trade-offs
💡Why it matters — Torvalds' use of AI to write kernel code marks a milestone in the adoption of these tools for critical projects, while highlighting current limitations.

Linus Torvalds has submitted a series of patches aimed at addressing page cache contention, largely written with the assistance of Claude Code. Tests on his own hardware show marked speedups, but the branch remains outside the mainline, with trade-offs regarding memory reclamation and an identified regression. This choice aligns with an adoption of AI that he advocates for, albeit cautiously.

The branch remains outside of Linux 7.3-rc6 and technical points remain

As of October 13, the experimental branch had not been integrated into Linux 7.3-rc6. It is unclear whether it will be merged or when that might happen. Delaying memory reuse can render pages unavailable during the RCU grace period, and Linus Torvalds considers memory reclamation to be the least developed part of the series. A regression is observed when reading targets an unmapped user page, with an additional failed exception before reverting to the existing path. At this stage, performance gains coexist with these unresolved limitations.

An RCU approach to circumvent reference contention

The patch targets contention within the page cache, which stores file information in memory. When multiple reads of small parts of the same file occur simultaneously, the frequent acquisition and release of references to the folio induce atomic write operations on the same cache line, leading to rivalry among cores. The series modifies the timing of when memory removed from the page cache can be reused: instead of being returned immediately to the allocator, reuse is deferred until the end of an RCU grace period. A reader protected by an RCU read section can thus copy to user space without taking a reference to the folio.

Measured gains on an i7-8565U, in a targeted test

On a laptop equipped with an Intel Core i7-8565U processor featuring four cores and eight threads, running eight threads making pread() calls of 16 bytes on the same page resulted in 99.92% occupancy on a shared cache line, according to HITM measurements. In this scenario, the throughput observed with eight threads increased from about 9.9–10.4 million to 30–33 million reads per second, while the number of kernel cycles per read decreased from about 2,950 to 725. In single-thread mode, cycles per read were reduced from about 452–454 to 408–409. Torvalds believes that a machine with more CPUs or multiple sockets could benefit even more from this improvement, but no tests have been conducted on a larger configuration. These results correspond to a load of small reads on his laptop used in Prague.

⚡Le brief IA que lisent les pros

Le brief IA que les pros lisent chaque soir

Les 7 actus IA du jour, décryptées en 5 min. Gratuit.

Inclus dès l'inscription : notre sélection des meilleurs guides & comparatifs IA.

Choisis ton rythme

Gratuit · Pas de spam · Désabonnement en 1 clic

A problem tracked since 2024, with no previous solution

The contention targeted by the patches has been known since 2024. Previous attempts to address it had not succeeded. The submitted work seeks to mitigate this slowdown observed during multicore and multiprocessor loads.

Torvalds credits Claude Code for writing and testing

Linus Torvalds has published a series of patches and specifies that they were largely written with the coding assistant Claude Code from Anthropic. He notes that the code, test programs, review materials, and the initial draft of his text were produced with this tool under his direction. The assistant contributed to the production of the kernel code, testing, and review materials for this experimentation.

From debugging assistance to cautious adoption of AI

In December 2023, Linus Torvalds explained that he sees AI as a tool to assist developers, with an initial interest in bug detection rather than code writing. By the end of 2025, he presented himself as a convinced user of AI as a tool, expanding his interest to code maintenance and patch review. In January 2026, he experimented with AI-assisted coding on a Python audio visualizer in a personal project. On October 9, in Prague, after a discussion with Dirk Hohndel during the Open Source Summit Europe, he stated that he appreciates the use of AI and considers it a tool that makes programming more enjoyable, while calling for caution in real and important tasks.

⚡

Brief IA — L'actualité IA en français

L'essentiel de l'actualité de l'intelligence artificielle, décrypté et expliqué chaque jour.