Linus Torvalds has published his first AI-written Linux kernel patch, marking a turning point in AI's role in kernel development.
Linus Torvalds uses AI to write Linux kernel code
Linus Torvalds, the creator of the Linux kernel, has used an AI tool called Claude Code to write his first patch for the Linux kernel. This marks a significant shift in how he views AI's role in software development.The patch addresses a cache issue
The patch resolves a long-standing problem related to cache contention in the Linux page cache. This issue occurs when multiple threads read small amounts of data from the same file, causing performance bottlenecks.Performance improvements in testing
In a synthetic test, the patch showed a notable increase in performance, with read operations improving significantly. However, the real-world impact is expected to be more modest and primarily benefit servers.AI tools now allowed in kernel contributions
The Linux kernel development team has relaxed its rules regarding AI use. Previously, developers had to formally declare if they used AI tools. That requirement has now been removed.Torvalds' evolving view on AI
Linus Torvalds has become more open to AI's role in programming. Initially skeptical, he now sees AI as a useful tool for developers and maintainers, similar to compilers or text editors.The AI-assisted patch details
The patch, along with seven others, was published on the "noref-filemap-read-with-llm" branch of Torvalds' repository. It aims to reduce contention by delaying the reuse of memory in the page cache.Performance gains in specific tests
In a test using eight threads on a laptop with an Intel Core i7-8565U processor, the patch increased read throughput from 9.9 to 10.4 million to 30 to 33 million reads per second. This shows a significant improvement in that specific scenario.Limitations and trade-offs
The performance gains come with trade-offs. Delaying memory reuse can leave pages unavailable until a grace period ends. Torvalds described this as the "least resolved" part of the patch series.AI's role in code review and maintenance
Torvalds has long supported the use of AI in code review and maintenance. He believes AI can detect basic programming errors more effectively than humans and has become a fervent supporter of its use in software development.Challenges of AI in security management
The increased use of AI in identifying security flaws has overwhelmed the Linux kernel's vulnerability mailing list. This has led to the abandonment of support for some outdated hardware drivers and raised concerns about managing legacy code.