Linus Torvalds does not hand out praise lightly, and he has spent years as one of the more pointed skeptics of letting machines write systems code. So a branch quietly appearing in his personal kernel repository this week is worth a second look. It is called noref-filemap-read-with-llm, it contains eight patches, and in the cover letter Torvalds says the code, the test programs, the review and the first draft of that very letter were produced with Claude Code under his direction. He ran the measurements himself.
The target is a narrow but genuinely annoying problem. When many threads each read a small amount from the same cached file, every read takes and releases a reference on the same page of memory. Those are atomic writes to one cache line, so the line ping-pongs between CPU cores and the cost piles up. The issue was first raised back in 2024 off a real customer workload. Earlier attempts to fix it by copying data without a reference and checking afterward kept tripping over races that validation cannot catch.
The approach on this branch sidesteps the reference count rather than guarding it. It leans on RCU grace periods, a long-standing kernel mechanism, to make the counting unnecessary in the hot path. As reported by Phoronix and Linuxiac, the numbers on Torvalds' own laptop are striking: raw throughput climbed from roughly 10 million reads per second to somewhere between 30 and 33 million, kernel cycles per read fell from about 2,950 to 725, and contention events on the troublesome cache line dropped from more than 30,000 to around 100.
Read the fine print
There is a cost, and Torvalds flags it rather than burying it. A single-threaded read touching an unmapped page gets slower, rising from about 4,150 cycles to 6,550. The benchmark was one machine, a Core i7-8565U laptop with security mitigations switched off, running a workload built to stress exactly this path. This is not a blanket three-times speedup for Linux, and nobody involved is claiming it is.
The branch targets the 7.4 merge window but has not landed in mainline, and experimental kernel work from Torvalds often stays experimental for a while. What makes the episode interesting is less the patch than the bookkeeping around it. A developer famous for his caution used an AI coding tool on a real piece of infrastructure, kept himself firmly in the loop, and documented the division of labor line by line. That is roughly the posture other serious users have been settling into, from the Harvard physicist who built an open-source harness to put Claude to work on scientific computation to Anthropic's own experiments with one agent directing a thousand.
Use the machine for the grind, check everything, and own the result. Coming from Torvalds, that is close to an endorsement.
Sources
- i. www.phoronix.com
- ii. linuxiac.com
- iii. hwbusters.com
Commentarii · 0