AI NewsOpen sourceReported
Torvalds used Claude Code to patch Linux, reviewers found a race
The New Stack reports that Linus Torvalds submitted a 10-patch Linux series written with Anthropic's Claude Code that hit a 23-fold throughput gain on his Threadripper, before reviewers found a race condition.

Image: The New Stack
Why it mattersAn AI assistant produced a patch that read as fast and plausible to the project's lead maintainer and still carried a race nobody spotted until a second pair of eyes looked, which is the shape of the review problem for every team shipping AI-written code.
The person who wrote the Linux kernel in 1991 just submitted a patch series he did not write by hand. The New Stack reports that Linus Torvalds used Anthropic's Claude Code to tackle a page cache contention problem that had sat open for more than two years, delivered a 23-fold throughput gain in a synthetic benchmark on his Threadripper, and then watched reviewers find a race condition before anything could be merged.
Writing in The New Stack on Tuesday, Amanda Caswell says Torvalds submitted a 10-patch series on 13 October. He had been running a broken version of his own earlier fix for the same bottleneck for 18 months, and other kernel developers had hit problems with their tries. On his Core i7-8565U laptop, folio reference-count contention accounted for 99.92% of cross-core load HITMs in eight-thread tests, a figure The New Stack attributes to Hardware Busters. Matthew Wilcox, a longtime kernel memory-management developer at Oracle, flagged the bottleneck in 2024 after it hit a customer workload.
What Claude Code wrote and what Torvalds ran
The New Stack says Phoronix's Michael Larabel spotted an experimental branch called noref-filemap-read-with-llm in Torvalds' tree on Sunday, a tree that rarely holds anything outside the main development branch. Torvalds said in his cover note that Claude Code wrote the implementation, the tests and the initial documentation, and reviewed the code under his direction. He ran the benchmarks himself. That is the same Torvalds who has criticised developers for claiming AI writes 99% of their code, and the point is not lost in the reporting.
The first eight-patch version pushed eight-thread performance on his laptop from 10 million to as many as 33 million reads per second, with kernel cycles per read falling from about 2,950 to 725, according to The New Stack. The revised rcu-free-v3 series went further on the 64-thread Threadripper, from 13.3 million to 304 million reads per second, with cycles per read dropping from nearly 20,000 to 735. Torvalds warned in his own cover note that real-world workloads would see far smaller gains than the synthetic benchmark suggests.
The race the review caught
The design relies on a new PG_rcu_free flag and an RCU-delayed reclamation step that holds the folio through the userspace copy, provided it does not fault. Reads into unmapped user pages trigger an extra fault before falling back to the existing path, which pushed a 16-byte single-thread read from about 4,150 to 6,550 cycles in the first version, The New Stack says. Whether that regression survives in rcu-free-v3 is not yet established.
Wilcox questioned the new flag and proposed a page-type approach instead. Torvalds rejected it, arguing the flag has to be set while a folio can still be mapped into userspace. Then Kiryl Shutsemau, another kernel developer who has worked on this bottleneck, found a race in filemap_read_rcu_batch() where a folio replacement followed by extending i_size could expose data that had never been written. Torvalds has handed further development to Shutsemau, who folded the fix into a revised patch.
The pattern a team shipping AI-written code should expect is right there. The assistant produced patches a careful maintainer judged ready enough to post, with a plausible benchmark attached, and the race was invisible to both of them until a developer with the right history on this subsystem read the code and asked the question it hid. More eyes still caught the fault. A faster first draft did not.
Source
Linus Torvalds let Claude Code fix the Linux page cache. Then reviewers found a race., Amanda Caswell, The New Stack.
This item was written by an AI system from the linked source. Reveneau is responsible for what it publishes.
Get AI News in your inbox
New developer tools, model and agent releases, and how teams are actually using them to release software. Short, and only when there is something worth reading.

