Linus Torvalds Confirms Claude AI Contributed to Linux Kernel Patches

Linus Torvalds has revealed that OpenAI’s Claude Code played a role in authoring Linux kernel patches, test software, review materials, and even early drafts of technical documentation. This collaboration focused specifically on improving page-cache read performance—a vital part of how Linux handles cached file reads under high concurrency. The initiative was carried out under Torvalds’ direction, highlighting both AI’s growing role in foundational systems and the limitations that still accompany such tools.

What Was Improved, and How

The core issue addressed involves how repeated small read operations from the same cached file force processor cores into contention over folio reference counts. A folio groups memory pages together, and updating its reference count every time a read occurs causes overhead and inefficiency. Claude Code–assisted patches propose delaying reuse of freed page-cache memory until after an RCU grace period ends. This approach gives active reading threads time to complete before that memory is reused, allowing a new, faster read path that avoids the costly folio reference updates. If conditions disallow this optimized path—such as missing cache data or user-buffer faults—the system falls back to the standard method.

Performance Gains & Caveats

On Torvalds’ four-core, eight-thread Intel laptop, the updated approach yielded a threefold increase in throughput—about 30–33 million 16-byte reads per second versus 9.9–10.4 million under the traditional method. These numbers, however, reflect a narrow benchmark: using a cached file, running on ext4, with certain security mitigations in place and CONFIG_HARDENED_USERCOPY turned off. Other tests—especially those involving missing user memory pages—saw slower performance.
Memory pressure remained a concern. Delayed frees risk holding onto freed memory longer than expected if the allocator isn’t correctly tracking the backlog. Later patches trimmed down the backlog, but unresolved allocation issues persist. The testing also didn’t cover several architectures or stress conditions, nor were tools like KASAN, lockdep, or hardened usercopy utilized.

This isn’t the first time Claude or similar AI tools have been leveraged for Linux development. Previous efforts include bug hunts and vulnerability discovery. What’s noteworthy here is that this work isn’t framed as autonomous AI replacing human developers—it’s AI-assisted, under tightly controlled supervision and review.

What this means: we’re seeing a shift. Core systems like the Linux kernel—long considered too sensitive for AI involvement—are now experimenting with trusted AI contributions. The results so far are promising, but the untested corners remain wide. The next steps will be more extensive benchmarks across architectures, wider feature coverage, and rigorous validation under production workloads. If those succeed, this could become a template for future kernel work with AI.