Linus Torvalds lands kernel patch written with Claude Code, embracing AI coding
mark_k · x · 2026-10-12
Linus Torvalds has merged a Linux kernel patch optimizing page cache reads and openly stated that "the code, the test programs, the review... and the first draft of this text were done with an LLM coding assistant (Claude Code) under my direction" — a landmark acknowledgment of AI-assisted kernel development.
Key technical details:
- The patch tackles contention on the folio refcount during small multi-threaded reads: each read takes and drops a reference via cmpxchg/decl, writing the same cache line twice; on his 4-core laptop, 8 threads doing 16-byte preads of one page put 99.92% of load on HITMs for that line
- The idea: pages evicted from the page cache survive until an RCU grace period passes, so under rcureadlock() the kernel can copy straight from the page cache to the user buffer with no reference, no on-stack bounce buffer, and no post-copy validation
- The commit message walks through why earlier attempts failed: same-index free/reuse/re-insert, page migration, secretmem, unaccepted memory
- The branch is even named noref-filemap-read-with-llm
For someone historically skeptical of AI coding, Torvalds personally shipping an LLM-assisted kernel optimization marks a notable shift for the kernel community.
Related event: Linus Torvalds Uses Claude Code to Speed Up Linux Kernel Reads(2 posts)→
More from coding & agent
- Harness learning: frozen-weight agents improve by rewriting their own harness code, 32%→62% — mark_k · 2026-10-12
- 15 role-based prompts claim to replace a $114,500 ML education, from theory to MLOps — bigaiguy · 2026-10-12
- Use small models for grunt work, save SOTA for orchestration, says agentic engineering practitioner — petergyang · 2026-10-12
- Screego: open-source self-hosted screen sharing for devs with 10.5k GitHub stars — thisguyknowsai · 2026-10-12
- Grok app adds Bots: users can now build custom bots like Trader inside Grok — nima_owji · 2026-10-12
- Moli: open-source headless browser for AI agents renders pixels only on demand — abhishek__AI · 2026-10-12