Torvalds' page-cache patches hit 23x on a Threadripper before reviewers found a race
Linus Torvalds submitted Claude Code-assisted patches that lift synthetic page-cache reads 23-fold, to 304 million a second. He warned real workloads will gain far less, and reviewers have since reported a race condition.
The Engineer · Build desk
Key figures: on the 64-thread Threadripper, cycles per read fell from nearly 20,000 to 735. On Torvalds' laptop, eight-thread kernel cycles per read fell from roughly 2,950 to 725. Peak laptop throughput rose by a factor of about 3.3.
| Figure | Value | Note | Claim |
|---|---|---|---|
| Threadripper cycles per read, 64 threads | 735 cycles | down from nearly 20,000 | 11 |
| Laptop kernel cycles per read, eight threads | 725 cycles | down from roughly 2,950 | 12 |
| Laptop peak gain, about | 3.3 times | 20 |
What happened
- Torvalds said Claude Code wrote the implementation, tests and initial documentation for the first eight-patch series and reviewed the code under his direction, and that he ran the benchmarks himself.
- On his laptop, the original eight-patch branch took eight-thread reads from 10 million to as many as 33 million per second.
- On the 64-thread Threadripper, kernel cycles per read fell from nearly 20,000 to 735.
- Kiryl Shutsemau, who had worked on the same bottleneck before, identified a race in filemap_read_rcu_batch(), and Torvalds has handed him further development.
Why it matters
- What it limits constraint Development now sits with Shutsemau, so the 23x is a benchmark result on a series still being revised.
- What it costs cost The first implementation took a 16-byte single-thread read from about 4,150 to 6,550 cycles, roughly 58% more. A single-thread reader has no contention to relieve, so it only sees the extra cost.
- Who has to decide decision Maintainers taking AI-written patches into reclamation code need reviewers who know the subsystem. Here the race surfaced after submission, from a reviewer who had worked on the problem.
The patches remove folio reference-count operations from a common buffered-read path [18]. That path was the cost. In eight-thread tests on Torvalds' laptop, Hardware Busters reports, folio reference-count contention made up 99.92% of cross-core load HITMs [13]. Matthew Wilcox, an Oracle engineer, flagged the bottleneck in 2024 after it surfaced in a customer workload [6].
Dropping the reference count creates its own problem. Something else has to keep the folio from being freed or replaced during the copy. Earlier approaches copied data without holding a reference and checked validity afterward, which left races involving reclamation and replacement [8]. The rcu-free-v3 series sets a PG_rcu_free flag and delays reclamation with RCU, so the folio survives the userspace copy, provided the copy does not fault [9].
The fault case is the seam. In the first implementation, reads into unmapped user pages took an extra fault before falling back to the existing path [21]. Whether that cost persists in rcu-free-v3 is unclear [22].
Divide 304 million by 13.3 million and the factor is 22.9 [19]. Both numbers come from one 64-thread Threadripper under heavy contention [10]. The laptop's first branch went from 10 million to a peak of 33 million, or 3.3x [20]. The machines, thread counts and patch revisions differ, so the pair is not a scaling curve. For 23x to transfer, a workload would need many cores reading the same cached files at once through this path, with destination pages already mapped. The report does not include a measurement from the customer workload that started the work.
The reclamation design drew objections. Wilcox questioned the flag and proposed a page type instead, plus reclaiming inactive-list folios after an RCU grace period [14]. Torvalds rejected both. He argued that the flag has to be in place for as long as userspace can still map the folio, and that truncate and hole-punch operations fall outside what inactive-list reclamation would handle [15]. Hildenbrand, an Arm engineer and memory-management maintainer, supported Shutsemau's suggestion to restrict the flag to 64-bit systems [16].
In our view the evidence supports a narrow reading of the human-review point. The human baseline is not clean: Torvalds spent 18 months running a broken version of his own fix, and other developers hit problems with theirs [5]. Reclamation and replacement races, the class that defeated those attempts, also reached review in this series [3]. The evidence does not show that AI-written code fails more often than human-written code. The report's description of the race breaks off mid-sentence, so how it triggers is not established here.
What to watch
- Whether Shutsemau's revision fixes the race in filemap_read_rcu_batch() and limits PG_rcu_free to 64-bit systems.
- Whether rcu-free-v3 still adds the extra fault cost to single-thread reads into unmapped pages.
- Any measurement on the customer workload Wilcox flagged in 2024, which would show the real-world gain Torvalds said would be smaller.
Clarity's read
What the record supports and how the coverage leans. The claims behind it follow.
Reality
- Evidence50
- Adoption
- Not scored
- Hype gap+30
- Incentives
- Not scored
- Confidence60
Claim ledger
Ranked by verification strength, evidence, and original report placement.
- [1]
Linus Torvalds submitted a 10-patch series that delivered a 23-fold throughput improvement in a synthetic benchmark running on his Ryzen Threadripper.
- [2]
Torvalds warned that the benchmark gains would be considerably smaller in real-world workloads.
- [3]
Reviewers have since identified a race condition and raised concerns about memory reclamation.
- [4]
Torvalds has handed further development to Kiryl Shutsemau, a Linux kernel developer who previously worked on the same bottleneck.
- [5]
Torvalds had spent 18 months running a broken version of his own fix for the page-cache reference-counting bottleneck, while other developers had encountered problems with their approaches.
- [6]
Matthew Wilcox, an Oracle engineer and longtime Linux kernel memory-management developer, flagged the bottleneck in 2024 after it surfaced in a customer workload.
- [7]
Torvalds said the assistant wrote the implementation, tests, and initial documentation of the eight-patch series, and reviewed the code under his direction. He ran the benchmarks himself.
- [8]
Earlier approaches copied data without holding a folio reference and checked its validity afterward, leaving races involving reclamation and replacement.
- [9]
The 10-patch rcu-free-v3 series uses a new PG_rcu_free flag and RCU-delayed reclamation to protect the folio through the userspace copy, provided it does not fault.
- [10]
On Torvalds' 64-thread Threadripper under heavy contention, throughput jumped from 13.3 million to 304 million reads per second.
- [11]
On the 64-thread Threadripper, cycles per read fell from nearly 20,000 to 735.
- [12]
The original eight-patch branch pushed eight-thread performance on Torvalds' laptop from 10 million to as many as 33 million reads per second, cutting kernel cycles per read from roughly 2,950 to 725.
- [13]
On Torvalds' Core i7-8565U laptop, folio reference-count contention accounted for 99.92% of cross-core load HITMs in eight-thread tests.
- [14]
Wilcox questioned the new PG_rcu_free flag and proposed using a page type instead, along with reclaiming inactive-list folios after an RCU grace period.
- [15]
Torvalds rejected both approaches, arguing that the flag must be set while a folio can still be mapped into userspace and that inactive-list reclamation would not cover truncate and hole-punch operations.
- [16]
Shutsemau suggested restricting the flag to 64-bit systems, an approach supported by Arm engineer and Linux memory-management maintainer David Hildenbrand.
- [17]
Shutsemau identified a race in filemap_read_rcu_batch().
- [18]
The new patches eliminate folio reference-count operations from a common buffered-read path.
- [19]
Threadripper throughput rose by a factor of about 22.9.
- [20]
Peak laptop throughput rose by a factor of about 3.3.
- [21]
In the first implementation, reads into unmapped user pages triggered an additional fault before falling back to the existing path, pushing a 16-byte single-thread read from about 4,150 to 6,550 cycles.
- [22]
Whether the single-thread read regression persists in rcu-free-v3 remains unclear.
- [23]
The 16-byte single-thread read cost about 58% more cycles in the first implementation.
Get this ledger inside ChatGPT. Ask about any of our stories and the answer brings its figure, each claim’s verdict and the sources. Free, no account.
Sources
1 independent publisher whose own reporting we read for this story.
- thenewstack.ioLinus Torvalds let Claude Code fix the Linux page cache. Then reviewers found a race.
1 article · October 14, 2026
Topics and entities
Follow any of these and your For You feed starts watching them — no settings page required.