Strip Out the Kernel's "Toll" and Reads Triple: The 8 Patches Torvalds Had Claude Code Write—and His Caveats
Linux's Linus Torvalds has published eight page-cache patches he had Claude Code write, pushing small 8-thread reads roughly 3x faster. But he also lays out his own caveats—regressions, untested cases, and where accountability lies.
"I Direct, Claude Code Writes the Code"
Linus Torvalds, the creator of Linux, has published a new branch in his own repository. Its name is noref-filemap-read-with-llm.
It is a set of eight patches tackling a page-cache performance problem. The lead commit, "mm: read from the page cache without folio references," is dated October 10, and the series was posted to the kernel mailing list on the 12th.
What drew attention was a single line in the cover letter. Torvalds explicitly stated that "the code, the test programs, the analysis backing the list above, and the first draft of this very text were all done by LLM coding assistance (Claude Code) under my direction."
The "Traffic Jam" of folio Reference Counts
What this work fixes is the handling of the region that holds a file's contents (the folio).
When many threads read small fragments of the same file at once, the kernel atomically increments and decrements that region's reference count every single time. Under high concurrency, this operation makes cores fight over the same cache line, triggering a "pile-up" between cores that slows things down.
The fix performs the read inside an RCU read-side critical section, skipping the reference-count increment and decrement. Freeing the memory is deferred until after the RCU grace period has elapsed.
Reads Roughly 3x Faster with 8 Threads
Here are the results Torvalds measured on his own laptop. The figures have been reconstructed from the sources.
| Metric (8 threads reading the same file in small chunks) | Before | After |
|---|---|---|
| Kernel CPU cycles per read | ~2,950 | ~725 |
| Throughput (reads/sec) | ~10 million | 30–33 million |
| Cross-core contention (load HITMs) | 30,538 | 101 |
Single-threaded reads improve by only about 10% (452–454 → 408–409 cycles).
The measurement was done on a single laptop (4 cores, 8 threads, with some protection features disabled). Multi-socket machines remain untested.
What's New Here
AI-written patches are no longer a novelty in themselves. What stands out is that the person ultimately responsible for the kernel used the tool himself and said so publicly.
Torvalds did not take the output at face value; he backed it up with real measurements and laid out the remaining issues in the cover letter in his own words. It is a case showing that the workflow of "a human directs, the AI drafts, and a human verifies" can work even in a demanding domain.
Lessons for Everyday Development
This approach transfers directly to day-to-day development. There are three key points.
- Humans handle breaking down the task and defining the goal; the agent is left to produce the first implementation and write the tests.
- Always verify performance and behavior through actual measurement and reproduction, and decide whether to adopt based on the numbers.
- Don't hide unresolved issues—spell them out in a form that can be reviewed.
The more a domain is equipped with benchmarks and tests, the better this pattern works. What separates good outcomes isn't the speed of generation but the design of verification and accountability.
The Caveats You Shouldn't Overlook
At the same time, the cover letter itself contains cautious reservations. To avoid overstating anything, here they are as given.
- Because the deferred-freeing approach keeps memory occupied, Torvalds admits this is "the most unresolved part of the whole series."
- Reads to unmapped user pages see a regression, slowing from about 4,150 to about 6,550 cycles.
- In a 2GiB stress test, the OOM killer (the forced termination that kicks in when memory is exhausted) reportedly fired in some configurations.
- The measurements come from just that one machine, the series has not been merged, and it awaits review by maintainers.
The summary "AI made Linux 3x faster" drops all of these conditions. The one who ultimately bears responsibility for a patch is its submitter, and Torvalds declared his use of the tool himself. Alongside the convenience, the question of how to design verification and the locus of accountability has also been raised.
References: It's FOSS / Hardware Busters / Startup Fortune / PBX Science / BigGo Finance


