cd /news/artificial-intelligence/linus-torvalds-experiments-with-ai-g… · home › topics › artificial-intelligence › article
[ARTICLE · art-149726] src=linuxiac.com ↗ pub= topic=artificial-intelligence verified=true sentiment=· neutral

Linus Torvalds Experiments with AI-Generated Kernel Code, Sees 3x Speedup

Linus Torvalds used Anthropic's Claude Code AI coding assistant to develop eight experimental Linux kernel patches, documented in an October 10 commit titled "mm: read from the page cache without folio references," that raised cached-file read throughput on his Intel Core i7-8565U laptop from about 10 million reads per second to between 30 million and 33 million with eight threads. The patches, based on Linux 7.3-rc6 and published under the name noref-filemap-read-with-llm, use the kernel's Read-Copy-Update mechanism to avoid acquiring extra page references on certain reads, though Torvalds noted the threefold gain applies only to that specific workload and the code adds overhead when reads hit missing memory pages. Torvalds stated in the commit message that the code, test programs, review and first draft of the text were done with Claude Code under his direction, while he ran the measurements himself; the patches remain an experiment and have not been merged into the mainline kernel.

by read2 min views4 publishedOct 12, 2026
Linus Torvalds Experiments with AI-Generated Kernel Code, Sees 3x Speedup
Image: Linuxiac (auto-discovered)

Linus Torvalds, the creator of Linux, has been experimenting with AI-assisted kernel development, using Anthropic’s Claude Code to write patches that improve the Linux kernel’s memory management performance. The results are interesting, with some benchmarks showing more than three times higher read throughput.

The experiment, documented in an October 10 commit titled “mm: read from the page cache without folio references,” consists of eight patches targeting how Linux reads data from its page cache.

The problem Torvalds wanted to address involves how the kernel keeps track of memory pages. Under the existing implementation, reading cached data requires updating reference counters, which can create contention when several threads repeatedly access the same file.

To address this, the experimental patches use the kernel’s Read-Copy-Update mechanism to allow certain reads without acquiring additional page references. And the initial performance numbers are impressive.

On Torvalds’ laptop, with an Intel Core i7-8565U processor having four cores and eight threads, a benchmark with eight threads repeatedly reading 16 bytes from the same cached file improved from about 10 million reads per second to between 30 million and 33 million.

With four threads on separate CPU cores, throughput increased from roughly 9–12 million reads per second to 25–26 million. The single-threaded test showed a smaller improvement, rising from about 8 million to nearly 9 million reads per second.

There are important qualifications. All measurements were done on Torvalds’ laptop using ext4 with some kernel security mitigations disabled. The threefold improvement applies to a specific workload, not general Linux performance. The patches also add overhead in some cases, especially when reads encounter missing memory pages.

But what makes this experiment particularly noteworthy is how the code was developed. In the commit message, Torvalds explicitly acknowledges using Claude Code, Anthropic’s AI coding assistant, for much of the work:

“The code, the test programs, the review behind the list above and the first draft of this text were done with an LLM coding assistant (Claude Code) under my direction. The measurements were run on my machine.”

In other words, Claude Code helped generate the implementation, tests, review, and initial documentation, while Torvalds directed the work and ran the performance measurements himself.

That doesn’t mean AI-generated code is making its way into the Linux kernel without careful review. In fact, Torvalds spends much of the commit message discussing unresolved issues, including memory allocation behavior, compatibility concerns, potential regressions, and the performance impact of delaying memory reuse.

The experimental patches are based on Linux 7.3-rc6 with additional fixes and are available under the name noref-filemap-read-with-llm. For now, though, this remains an experiment rather than an optimization merged into the mainline kernel.

Whether any of these changes eventually make it into Linux remains to be seen.

── more in #artificial-intelligence 4 stories · sorted by recency
── more on @linus torvalds 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/linus-torvalds-exper…] indexed:0 read:2min 2026-10-12 · —