Linus Torvalds uses the AI assistant Claude Code to prepare a Linux kernel improvement
IA en un minuto newsroom · Editor: Jon Elgezabal

In 30 seconds
Linus Torvalds has published a branch that reworks reads from the kernel page cache and states that the code, the tests and the initial draft of its description came from Claude Code while he directed the work. The figures, taken on his laptop alone, point to much cheaper reads when several threads share one file. The message admits known flaws and missing tests, and nobody knows yet whether it will reach the next Linux release.
Linus Torvalds, the creator of Linux, has acknowledged in writing, in a message dated Saturday, October 10, that he used AI to prepare a kernel improvement.
Torvalds has opened a branch in his main repository, named noref-filemap-read-with-llm, with a proposal for the kernel page cache (the memory where Linux keeps file data). The goal is to reduce contention when many threads make small reads from the same file, a problem that, according to the message that accompanies the branch, was already raised in 2024 from a customer workload. At present every read takes and drops a reference on the page it reads, and threads compete for that counter. The proposal allows reading without that reference and, in exchange, delays the release of memory that leaves the cache.
According to that text, the code, the test programs, the review behind its list of problems and the first draft of the message itself were done with Claude Code, an AI coding assistant, "under my direction". The measurements, he adds, were run on his machine.
The measurements were run only on his laptop, a machine with a processor of 4 cores and 8 threads. With eight threads reading 16 bytes of the same file at once, the cost of each read in the kernel drops from between 2,937 and 2,975 processor cycles to 725 or 726. Torvalds expects a machine with more processors to gain more, but notes that nothing bigger has been measured. Not everything improves: a read into a page of program memory that is not yet present costs one extra failed exception per read.
The message also lists ten known problems or points on which he asks others to look. Among them: the memory allocator cannot see the pages waiting to be freed, which in one test ran a virtual machine out of memory (the last two patches in the series avoid it in that test, without solving the underlying issue); a regression in contiguous memory allocation (CMA) as the series stands; and the cost outside the read path has not been measured. It has not been tested on any other machine either, nor with several of the usual kernel verification tools, such as xfstests, lockdep or KASAN.
The Phoronix website, which spotted the branch while waiting for the release of Linux 7.3-rc7, notes that Torvalds does not usually work on branches in his main repository, where he typically hosts only the master branch, and recalls that he had already used AI to help debug the kernel and, outside it, to program with Antigravity, from Google. According to Phoronix, it remains to be seen whether the branch is merged in the Linux 7.4 merge window. The series, of eight patches, is based on version 7.3-rc6 of the kernel plus fixes.
Why it matters · analysis and opinion
What matters is not that a programmer relies on an assistant, but how the creator of Linux reports it. Torvalds does not present the work as finished: he separates what the tool did from what he did, makes clear that the measurements come from a single machine and devotes a good part of the message to what fails or has not been tested. That is the method any team that programs with AI can copy: the tool writes, the person directs, measures and answers for what they sign, and the limits are left in writing for whoever reviews it later. The hardest part is still missing: review by other developers and tests on more machines. Until then it is a proposal on a branch, not a part of Linux.
Source: Linus Torvalds (kernel.org) · Written with the help of AI: how we make the news


