Cyber Security News

Claude Code Helps Linux Creator Address Longstanding Kernel Memory Performance Bottleneck

Linus Torvalds used Anthropic’s Claude Code to build experimental patches that remove a long-running page-cache scalability bottleneck in the Linux kernel.

The series is not merged. Reviewers have already found a race condition and raised memory-reclamation concerns.

Torvalds pushed a branch named noref-filemap-read-with-llm to his own repository. Phoronix spotted it while the kernel awaited the Linux 7.3-rc7 tag.

Claude Code Helps Fix Linux Kernel Memory Bottleneck

According to the commit published in the Linux kernel Git repository, the eight-patch series sits on Linux 7.3-rc6. It was documented in a commit titled “mm: read from the page cache without folio references.” linuxiac

Torvalds wrote that the code, test programs, review and first draft of the text were done with an LLM coding assistant under his direction. He added that the measurements were run on his machine.

When many threads make small reads of the same cached file, each read takes a reference on the backing folio and drops it afterward. These atomic writes hit one cache line, so the line bounces between CPU cores.

In eight-thread tests on Torvalds’ Core i7-8565U laptop, folio reference-count contention accounted for 99.92% of cross-core load HITMs.

The patches use Read-Copy-Update (RCU). A folio leaving the page cache returns to the allocator only after an RCU grace period. A reader inside an RCU read-side section can therefore copy data straight into the user buffer without taking a reference. zdnet

The cost is that freed memory sits idle briefly before reuse. Two patches add a safety valve that forces an expedited grace period once a CPU has more than 1,024 pages queued. Torvalds called the deferred freeing “the part of this series that is least solved.”

Torvalds warned that real-world gains would be much smaller than the synthetic benchmark suggests. Reads into unmapped user pages also triggered an extra fault, raising a 16-byte single-thread read from about 4,150 to 6,550 cycles. thenewstack

A later 10-patch series, rcu-free-v3, introduced a PG_rcu_free flag and RCU-delayed reclamation. Reviewers then identified a race in filemap_read_rcu_batch(). Folio replacement followed by an extension of i_size could expose data that had never been written. thenewstack

Torvalds suggested reading the file size earlier and consolidating the folio checks. Kiryl Shutsemau, who had worked on the same bottleneck, folded those changes into a revised patch and now carries the work forward. thenewstack

No CVE has been assigned, and none of the sources describe an exploited flaw. The episode matters to defenders because the changes touch memory lifetime and reclamation.

Bugs in that area, such as use-after-free and stale-data exposure, have historically carried security impact. AI-written kernel code therefore still needs the same rigorous human review as any other patch.

Phoronix noted the work could target the Linux kernel 7.4 merge window, though integration remains unresolved.

Kavichselvan

Recent Posts

Microsoft Disrupts CoGUI Phishing Kit Linked to Over 100 Million Malicious Emails a Month

Microsoft and international partners have disrupted infrastructure supporting CoGUI. This phishing kit Proofpoint says generates…

13 minutes ago

Researchers Use AI to Discover Critical Linux Kernel Flaw That Enables Virtual Machine Escape

Researchers at pwn.ai used an AI-assisted research harness to find a critical Linux kernel networking…

34 minutes ago

12 Best Mobile Application Security Testing Tools Compared (2026): Features & Pricing

NowSecure and Data Theorem mobile security lead automated mobile testing, Guardsquare owns shielding/obfuscation, and Corellium’s…

46 minutes ago

12 Best SBOM Tools Compared (2026): Features & Pricing

Anchore’s Syft SBOM generator is the free generation standard, FOSSA and Cybeats lead SBOM management,…

56 minutes ago

12 Best CI/CD Pipeline Security Tools Compared (2026): Features & Pricing

Your CI platform’s native controls (GitHub Advanced Security, GitLab Ultimate) are the baseline, Cycode and…

1 hour ago

Hackers Target Claude, ChatGPT and Cursor Credentials Using Aoki Infostealer

The Aoki infostealer, also known as Aokigahara, has expanded its collection capabilities to steal credentials…

3 hours ago