Linus Torvalds’ Linux kernel repository recently showed a new branch called noref-filemap-read-with-llm. The branch name itself makes the point clear: an LLM was involved in the work.

In the latest patch notes, Torvalds said the core code, test cases, review work and draft documentation were all produced with Claude Code under his direction. The reported result was striking. In a specific test where eight threads read the same file, throughput reached roughly three times the previous level.
The change targets a core memory-management path in Linux
The work focuses on Linux memory management, specifically the way the kernel’s page cache handles file data.
In common concurrent workloads, multiple threads may perform small reads against the same file at the same time. Under the existing mechanism, each read has to modify an atomic reference count on the corresponding memory block, or folio. That leads CPU cores to repeatedly execute lock cmpxchg and lock decl, creating heavy cache-line bouncing at the hardware level.

Kernel developer Matthew Wilcox had already pointed to this as a real production issue seen at a customer site in 2024. On Torvalds’ own test machine, the bottleneck accounted for 99.92% of all Load HITMs overhead in an eight-thread small-read test, nearly saturating total bus bandwidth.
Claude Code was used across implementation, testing and patch drafting
According to the patch description, Claude Code was not limited to filling in a few lines. It helped with implementing the approach, writing programs to validate it and organizing possible problem areas.
Taken together, that looks more like a full engineering pass than a narrow coding assist. The code had to run. The results had to be measurable. The gains had to be explained. The patch notes also mattered because other maintainers need to know why the change is being made, which paths are affected and what cases were checked.

Even after AI produced a draft, the write-up still had to match the code and the test data. That is where Torvalds’ wording, saying the work was done under his guidance, carries weight.
Throughput rose to about 3x in the eight-thread same-file read test
Torvalds ran the test on a laptop powered by an Intel Core i7-8565U, a 4-core, 8-thread chip, using the ext4 file system. The setup repeatedly had multiple threads read the same one-page file, with each read pulling only 16 bytes.
The patch notes said eight-thread throughput was about three times the previous level, while single-thread performance improved by about 10%.
The reason the gap is so large lies in the shared-file access pattern. Linux keeps file data in memory through the page cache, so later reads can come straight from memory instead of storage. But cached memory can also be reclaimed. The kernel has to ensure that while a thread is still reading, that memory is not freed or reassigned.

In the old read path, the kernel increments a reference count on the folio that holds the cached data, then decrements it after the read completes. When several threads hit the same file at once, they all keep updating the same counter. To preserve consistency, CPU cores must pass around the cache line containing that counter. Since each read is only 16 bytes, the data copy is fast and the accounting overhead becomes the bottleneck.
The patch tries to remove that point of contention from the read path
The idea in Torvalds’ patch set is to avoid that step during reads.
Instead of returning removed cached memory to the allocator right away, the kernel delays the handoff and uses RCU so reads that have already started can finish. That lets threads copy data directly inside a protected read section, cutting down contention on the shared reference count.

That also explains why the gain is especially visible when many threads read the same file.
A second branch led to four bugs traced back to 2013
The day after noref-filemap-read-with-llm appeared, Torvalds’ repository also showed an assoc-array-fixes branch. Assoc-array is a data structure used to organize and look up objects by key, and its original implementation dates back to 2013.
Days earlier, developer Nils Ollrogge had submitted a bug report along with a fix. After reviewing it, Torvalds ran into another issue: the code was difficult to follow. He then used a large model to help untangle the logic, split up some large and hard-to-read functions and make the boundaries between operations clearer. The code was then run inside a user-space test framework.
That testing confirmed the issue reported by Nils and uncovered three additional bugs. All four could be traced back to the original 2013 commit that first merged the library into the kernel.

One example could be triggered with just 18 keys
The patch notes included a concrete case. When a certain root-node structure was split, the bit field used for indexing could become misaligned, making previously inserted objects unreachable.
According to the description, the bug could be triggered with only 18 keys. After the operation, three objects could no longer be found. Reinserting the same keys would create new objects instead of correctly replacing the originals.
Another issue was hidden in the memory-allocation failure path. Under normal execution it might stay quiet, but if an allocation failed, cleanup logic could follow pointers into an old tree that was still in use and trigger kernel sanity checks. The related test exposed this by forcing each allocation in turn to fail and checking the exceptional paths one by one.

The emphasis is still on verification
Across both branches, the role of AI here was not to independently land kernel changes. It was used to help explain difficult code, split apart dense functions, generate tests and draft patch text, while the maintainer still had to line up code, measurements and documentation.
Torvalds is widely known for the line, “Talk is cheap. Show me the code.” This time, by putting an “llm” suffix directly into a branch in his main repository, he showed a practical use case for these tools: the valuable part is knowing what code should be written and being able to judge whether the result is correct.
The cited reference in the source material was a Phoronix report on Linus Torvalds and Claude Code. The original article also said it came from the WeChat account “新智元,” authored by ASI启示录.

