← Back to AI & Tech AI & Tech

Linus Torvalds Wrote an Experimental Linux Kernel Series With Claude Code

With eight threads hammering one file, reads climb from about 10 million per second to 33 million after Torvalds replaced reference counting with RCU grace periods and let an AI coding agent do the heavy lifting.

A branch literally named for the LLM

Linus Torvalds has pushed an experimental branch to his own Linux repository called noref-filemap-read-with-llm, and the suffix is no joke. In the cover letter of the eight-patch series, he states that Claude Code, Anthropic's command-line coding agent, produced the code, the test programs, the review behind the patch list, and the first draft of the cover text itself, all under his direction. The measurements, he adds, were run on his own machine.

The problem: atomic reference counts on one cache line

The page cache holds file data in memory so reads never hit storage. Each read takes a reference on the folio that holds the data and releases it afterwards. When many threads make small reads of the same file at once, every thread bumps the same atomic counter and the threads trip over each other on a single cache line. Matthew Wilcox first flagged the contention in 2024 from a customer workload, and earlier fixes that copied data into a stack buffer and validated afterwards stalled on races they could not see, such as a page freed and reinserted at the same index.

Remove the race instead of detecting it

Torvalds takes the opposite route. A folio leaving the page cache is returned to the page allocator only after an RCU grace period, so a reader inside an RCU read-side section can copy straight from the page into the user buffer. No reference, no bounce buffer, no limit on the size of the read. The trade-off is that freed pages sit briefly unavailable, which Torvalds calls the least solved part of the series, alongside possible performance regressions that still need addressing.

Roughly triple the throughput on one laptop

All numbers come from that single 4-core, 8-thread laptop with mitigations disabled. With eight threads hammering one file, small reads complete around 33 million per second versus 10 million on the unpatched kernel, and per-read cost drops from about 2,950 to 725 kernel cycles. The series is based on Linux 7.3-rc6 with additional fixes and names no kernel release target, so it is an experiment, not a merge.

What this means for you

This is the strongest evidence yet that an AI coding agent can contribute real performance work at the very bottom of the kernel, not just glue code. The caveats are equally clear: one benchmark, one machine, and open questions about memory reclamation and compatibility must be resolved before this becomes production code. Torvalds' position is consistent either way, he likes using AI, and the branch shows what happens when a top kernel maintainer points it at an eight-year-old scalability problem.

Sources: ZDNET; Linus Torvalds Working On A Hefty Linux Kernel Improvement With Claude Code.

Corrections: Report an error at corrections@wireshaman.com.

More from the wire