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 Boost Linux Kernel Reads 3x(4 posts)→
More from coding & agent
- Dev ships throwaway Postgres for agents: pg19 via pglite on Cloudflare DO over raw TCP — ritakozlov · 2026-11-29
- Product idea: cloud Android VMs and home WiFi proxies to make agents look human — Darpinian · 2026-11-29
- 38 free agent skills distilled from shipping three live AI products — PawelHuryn · 2026-11-29
- Step 5: run evals on synthetic data pre-launch, watch real traces after — PawelHuryn · 2026-11-29
- Break your agent before attackers do: 6 tests mapped to OWASP LLM Top 10 — PawelHuryn · 2026-11-29
- PM shares playbook for shipping 4 customer-facing Claude agents into production — PawelHuryn · 2026-11-29