Linus Torvalds Uses Claude Code for Linux Kernel Patches

Linus Torvalds has officially crossed a major threshold by using an LLM coding assistant to write code for the Linux kernel. According to ZDNET, Torvalds used Anthropic's Claude Code under his direct supervision to produce an eight-patch series aimed at fixing a memory cache slowdown problem.
How the AI-Assisted Patch Works
The core issue involves contention in Linux's page cache when multiple threads make small reads from the same file. This creates competing updates to a shared cache line, slowing down multi-core processing.
To solve this, Claude Code helped draft an approach that defers memory reuse until an RCU grace period elapses. This allows readers to copy data directly into a user buffer without constantly updating shared reference counters.
The Real Performance Numbers
In benchmark tests on a four-core Intel laptop, the performance gains for specific small-read workloads were dramatic. Eight-thread throughput jumped from roughly 10 million reads per second to between 30 and 33 million reads per second.
Simultaneously, the kernel cycles required per read dropped from about 2,950 down to 725. However, this does not mean the entire operating system runs three times faster; the gains apply strictly to high-contention small-read scenarios.
Trade-offs and Veredito
Delaying memory reclamation introduces engineering risks, such as pages remaining unavailable longer than expected and minor regressions on unmapped user pages. Because of these unresolved trade-offs, the branch remains outside the mainline Linux release.
For developers evaluating AI tools, Torvalds' approach serves as a blueprint: treat the model as an assistant for complex, targeted problem-solving, but maintain rigorous oversight on critical production code.
Sources
Frequently asked questions
- Did Linus Torvalds write Linux code with AI?
- Yes. Torvalds used Anthropic's Claude Code to write an eight-patch series for the Linux kernel, handling code, test programs, and initial drafts under his direction.
- What problem do the new patches solve?
- They target a shared-memory cache bottleneck that occurs when multiple threads repeatedly read small amounts of data from the same cached file.
- Is the AI-generated code already in the main Linux release?
- Not yet. While test benchmarks showed a threefold increase in read throughput, unresolved memory-reclamation trade-offs have kept the branch out of the mainline kernel.
Comments
0 commentsDeixe seu comentário
Be the first to comment.
Continue Lendo

Why Long AI Chats Fail and How Clearing History Fixes It
Clearing chat history boosts AI agent performance

AI in Performance Reviews: What 1,034 Workers Found
78% of managers use AI to write performance reviews, but one-third of employees say the feedback is less useful.

Mac App in 11 Days Without Code Using Claude
Discover how a paid Mac app was built and published in 11 days using Claude, 502 directives, and zero lines of traditional code.