Skip to content
AI

Torvalds Releases AI-Assisted Patches to Fix Linux Cache Contention

Linux creator Linus Torvalds has released an eight-patch series largely written with Anthropic’s Claude Code to resolve a long-standing memory cache bottleneck.

Illustration: A stack of clean white papers lies on a dark wooden desk, representing the new code patches.
AI-generated illustration: BitShield News

Key points

  • The patches address a page cache slowdown affecting multi-core processors.
  • Torvalds confirmed Claude Code generated the code and initial documentation.
  • The fix defers memory reuse to reduce atomic write contention on shared lines.

Linus Torvalds has released a new set of Linux kernel patches that were largely generated by Anthropic’s Claude Code, marking a significant shift in how core infrastructure is developed. According to ZDNET Security, this move represents a turning point in Torvalds’ relationship with artificial intelligence, transitioning from skepticism to active adoption for complex kernel tasks. The change directly impacts organizations relying on Linux for high-performance computing, as it alters the maintenance workflow for one of the world’s most critical operating systems.

By the numbers

  • 8: The number of patches in the series published on the noref-filemap-read-with-llm branch.
  • 99.92%: The share of cross-core load attributed to the shared cache line in Torvalds’ test workload.
  • 16: The byte size of the pread() calls used in the performance testing on the Intel Core i7-8565U.

What the figures mean

The performance data highlights the severity of the underlying issue. Torvalds discovered that when eight threads issued 16-byte reads against the same page, the shared cache line accounted for nearly all cross-core load. This contention arises because reference-count updates require atomic writes, forcing processor cores to compete. The new patches, which Torvalds stated were done under his direction with Claude Code, defer memory reuse until a read-copy-update grace period elapses. This allows data copying without taking folio references, eliminating the bottleneck that had persisted since 2024.

What should you do?

Managed service providers should monitor their Linux server clusters for signs of cache contention, particularly in workloads involving multiple threads reading small amounts of data from the same files. Teams should update their kernel maintenance schedules to include testing of these new patches in staging environments before production deployment. Internal communications should highlight the change in development methodology, ensuring engineering teams understand that AI-assisted code will increasingly appear in core updates. Risk managers should review vendor agreements to account for AI-generated code in critical infrastructure.

Operational impact

Organizations should assess how AI-generated code affects their internal review processes and compliance requirements. Engineering leads need to determine if current testing protocols adequately cover code produced by large language models. Procurement teams should evaluate whether their Linux vendors are adopting similar tools, which may change patch release cadences. Security officers must ensure that source code verification procedures remain robust regardless of the authoring method. Internal audits should verify that all AI-assisted contributions meet existing quality and security standards.

Background: Large language models

The difference between large language models and small language models lies in their parameter counts, training data volumes, and memory footprints. Large models handle complex, open-ended reasoning across many domains, while small models execute narrow tasks efficiently on local hardware with predictable latency and lower resource overhead.

Read the full guide: Difference between large language models and small language models for engineering choice

What to do and how to stay safe: Linux

  • Review current Linux kernel versions to identify if they are affected by the page cache contention issue described in the source material.
  • Test the new eight-patch series in isolated environments to verify performance improvements and stability before wider deployment.
  • Update internal documentation to reflect the use of AI tools in kernel development, ensuring teams understand the origin of recent changes.
  • Monitor vendor announcements for similar AI-assisted updates to other critical infrastructure components that your organization relies upon.

Step-by-step guide: Shadow AI Explained: 8 Questions Answered for Secure Operations

General security guidance from the BitShield News newsroom. It is not confirmed advice from the organisations named in this story.

Frequently asked questions

Did Linus Torvalds write the code himself or use AI?

Torvalds stated that the code, test programs, and first draft of the text were done with Claude Code under his direction.

What specific problem do these patches solve?

They address a memory cache slowdown caused by contention when multiple threads make small reads from the same file.

Is this the first time Torvalds has used AI for kernel work?

No, he has previously used AI for debugging and other tasks outside the main kernel tree, viewing it as a useful tool.

Sources

  1. Phoronix
  2. ZDNET Security
LinuxAnthropicClaude CodeLinus TorvaldsKernel

Related stories

NVIDIA Launches Boro: Rust CLI with Local AI Accelerates Linux Kernel Development

NVIDIA introduces Boro, a new command-line tool written in Rust that uses local AI to help developers work more efficiently on Linux kernel projects.

Your daily threat briefingGet Alerts