Development0 views

Linus Torvalds Uses Claude Code to Optimize Linux Kernel Page Cache

Linus Torvalds has submitted eight experimental patches to the Linux kernel developed with direct support from Claude Code, published in the noref-filemap-read-with-llm branch of his personal Git repository. The technical work targets a longstanding bottleneck in the system's page cache, which stores files in memory.

When multiple processor cores perform concurrent short reads from the same file, the traditional system forces intense contention to update reference counters on the same memory line. In isolated tests on an Intel Core i7 notebook, this internal contention represented 99.92% of the overhead between machine cores, causing noticeable performance loss.

To solve this, Torvalds and Claude Code designed a flow that defers memory reuse, allowing direct copies to the application without each thread needing to update the shared counter on every read. In tests with eight concurrent threads, throughput jumped from roughly 10 million to 30–33 million reads per second, while machine cycles per operation dropped from 2,950 to 725. However, the tradeoff is real: temporarily retaining memory pages ties up resources, and performance dips when the read file isn't yet mapped. The patch set remains outside the main Linux 7.3-rc6 tree with no guarantee of inclusion in official code.