Linus Torvalds uses Claude Code for 23x kernel speedup, hits race condition
An AI-assisted patchset supercharged Linux cache reads, but core maintainers caught a memory hazard before merge.
Linus Torvalds turned to Claude Code to untangle a long-standing performance bottleneck in the Linux kernel's page cache. Under high parallel loads, threads contended heavily for memory block reference counters—known as folios—wasting up to 99.92% of CPU time on cache-line synchronization.
Using an experimental patchset developed with the AI assistant, cache read performance on a 64-core AMD Ryzen Threadripper surged from 13.3 million to 304 million reads per second in a synthetic benchmark, dropping CPU cycles per operation from roughly 20,000 down to 735. The solution bypasses reference counting in frequent read paths by employing Read-Copy-Update synchronization and a new folio flag.
However, maintainers reviewing the code flagged significant hurdles. Kiryl Shutsemau discovered a race condition in filemap read routines where parallel operations could pull stale or unwritten memory blocks. Reviewers also questioned memory management edge cases, pushing the work back into an RFC review cycle with an expanded 18-patch series.
Source: habr
Comments
Help shape the next version: Add context or suggest a correction. AI review can add points toward a rewrite. Reviews and updates may take time; a full meter does not guarantee a new version.