Linus Torvalds has developed a series of eight Linux kernel patches with assistance from Anthropic’s Claude Code AI agent, targeting a page-cache bottleneck that can significantly slow down small file reads under heavy multithreaded workloads.
The changes, published on a development branch in Torvalds’ own Linux repository, reportedly increased throughput by approximately three times in a test involving eight threads reading the same file on his laptop. The series also reduced the number of processor cycles required per read, although it has not yet been merged into the mainline Linux kernel.
The branch, named noref-filemap-read-with-llm, was spotted by Phoronix founder Michael Larabel while monitoring development ahead of the Linux 7.3-rc7 release.

Addressing a Long-Standing Linux Performance Bottleneck
The problem stems from how the Linux page cache manages memory when multiple threads repeatedly read small amounts of data from the same file.
Under the existing approach, each read operation acquires and subsequently releases a reference to the memory page containing the data. These operations require atomic updates to shared memory structures, causing processor cores to compete for access to the same cache line.
According to the patch series’ commit message, Matthew Wilcox originally raised the issue in 2024 after encountering it in a customer workload. In Torvalds’ tests, eight threads performing 16-byte pread() calls against a single page caused the shared cache line to account for 99.92% of cross-core load HITMs, a measure of cache-line transfers associated with contention.
Earlier approaches attempted to avoid reference counting by copying data into a temporary buffer and validating it afterward. However, those methods struggled with race conditions, including situations in which a page could be freed and another inserted at the same index before validation.
Torvalds’ approach changes how the kernel manages page reclamation rather than trying to detect those races after they occur.
Performance Gains Come With Memory Trade-Offs
The patch series uses Read-Copy-Update (RCU), a synchronization mechanism that allows readers to access data safely while updates and reclamation are managed separately.
Under the proposed design, a memory page removed from the page cache is not immediately returned to the allocator. Instead, it remains available until an RCU grace period has passed, allowing readers already operating within an RCU read-side section to copy data directly into the user buffer without acquiring a page reference.
In tests on Torvalds’ four-core, eight-thread Intel Core i7-8565U laptop, the eight-thread workload improved from approximately 9.9 million–10.4 million reads per second to 30 million–33 million reads per second. The reported kernel cycles per read fell from about 2,950 to approximately 725.
Single-thread performance also improved, with the cost per read declining from roughly 452–454 cycles to 408–409 cycles. Measurements using perf c2c showed load HITMs falling from 30,538 to 101.
However, delaying memory reclamation introduces its own risks. Pages can remain unavailable for reuse while waiting for the grace period, potentially increasing memory pressure.
Two patches in the series introduce a safeguard that triggers an expedited grace period when a CPU has more than 1,024 queued pages. In a 2GB virtual-machine stress test, an earlier six-patch version triggered the out-of-memory killer with four and eight CPUs, while the complete eight-patch series finished successfully with configurations ranging from one to eight CPUs.
The changes also introduce a regression for certain reads into user-memory pages that have not yet been mapped. In the reported test, the cost of a 16-byte single-thread read increased from around 4,150 to 6,550 cycles.
Claude Code Receives Credit for Development Work
Torvalds disclosed Claude Code’s involvement in a “Tools” section of the patch series’ cover letter. He credited the AI coding agent with producing the code, test programs, an initial review of outstanding issues and the first draft of the cover letter, all under his direction.
The benchmarks themselves were run on Torvalds’ own machine. Although he has previously used AI tools for kernel debugging, the disclosure highlights a broader role for AI-assisted development in a technically demanding area of operating-system engineering.
The work remains experimental. The branch is based on Linux 7.3-rc6, and the reported performance results come from a single laptop rather than a broad range of server configurations. Torvalds expects systems with more cores, including multi-socket machines, could benefit further, but those gains have not yet been demonstrated.
The next step will depend on feedback from Linux memory-management maintainers and further testing on larger systems. Until the patches are reviewed and accepted, the reported gains should be treated as promising experimental results rather than improvements already available in a standard Linux release.




































