Will it run?
Models

Linus Torvalds posts kernel patches written with Claude Code

By Rae Whitlock Clawpit staff
Linus Torvalds posts kernel patches written with Claude Code

Linus Torvalds has sent a patch series to the kernel tree that was largely authored with Anthropic's Claude Code assistant. In the commit message he noted that the code, test programs, the review behind the changelog, and the first draft of the text were all produced under his direction using a large language model. It marks the first time he has adopted such a tool for actual development work that lands in the official repository, after years of moving from skepticism to acknowledging it as a useful aid for maintainers.

The bottleneck lives in shared memory. The problem, known since 2024, occurs when multiple threads repeatedly read small chunks from the same file cached in the page cache. Each thread takes and releases a reference to the backing folio, and updating that reference count requires atomic writes to the same cache line — forcing CPU cores to fight over it. In Torvalds' test on a four-core, eight-thread Core i7-8565U laptop, 16-byte pread calls to the same page showed that 99.92% of cross-core overhead came from exactly this contention, as measured by HITMs.

The fix defers returning memory to the allocator until an RCU (read-copy-update) grace period ends. This lets a reader inside an RCU read-side critical section copy data directly into the user buffer without taking a folio reference. In the specific test scenario, eight-thread throughput jumped from roughly 9.9–10.4 million reads per second to 30–33 million, and core cycles per read fell from about 2,950 to roughly 725. Single-threaded improvement is more modest: 452–454 cycles down to 408–409. Torvalds himself noted that the benefit should grow on systems with more CPUs or more sockets, but "nothing larger measured."

The series is still outside the Linux 7.3-rc6 mainline, with no guarantee it will be merged or when. The cost of deferring the release is that pages can remain unavailable while the kernel waits for the grace period — Torvalds called this "the least resolved part of the series." There is also a regression when the read targets a user page that isn't mapped yet: the new path incurs an extra failed fault before falling back to the existing implementation. In other words, the impressive numbers from the narrow benchmark come with engineering debts that haven't been paid.