hn.today

Linus Torvalds used Claude Code to rewrite how Linux reads cached files

startupfortune.com12 points0 comments
Screenshot of Linus Torvalds used Claude Code to rewrite how Linux reads cached files

Linus Torvalds posted a kernel patch series named noref-filemap-read-with-llm and openly credited Anthropic’s Claude Code for producing the initial code, tests, and review under his direction. The change addresses contention in the page cache when many threads perform tiny reads: instead of incrementing an atomic folio reference count on every read (which causes cache-line fights under concurrency), reads occur inside an RCU read-side critical section and actual frees are deferred until an RCU grace period. A safety mechanism forces an expedited grace period if more than 1,024 pages per CPU queue up waiting to be freed. On Torvalds’ Core i7-8565U laptop, 16-byte reads across eight threads dropped kernel cycles per read from about 2,950 to ~725 and raised throughput from roughly 10M to 30-33M reads/sec; Load HITM contention events fell from 30,538 to 101. The tradeoff is a small single-thread penalty for touching an unmapped page (cycles rising from ~4,150 to ~6,550).

The branch targets Linux 7.3-rc6 and is a candidate for the 7.4 merge window. Beyond the microbenchmark gains, the real significance is procedural: Torvalds, historically skeptical of AI-assisted development, supervised, validated on real hardware, and attached his name to code initially generated by an LLM, signaling practical acceptance of AI tools for sensitive infrastructure work while still warning about noisy, low-quality AI bug reports. The move is a high-profile demonstration that careful human direction plus measurement can make LLM-produced code credible in core system software, even as prior research has flagged failure modes like hardcoded tests.

Read on startupfortune.com0 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in AI

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.