Linux Creator Linus Torvalds Let AI Write Code? Here Are the Results...

Linus Torvalds optimizing Linux kernel source code using an AI coding tool in his development environment
AI Summary

Linux creator Linus Torvalds introduced the AI coding tool 'Claude Code' to resolve performance bottlenecks, but a critical race condition error was discovered in the generated code.

Imagine this: You are about to replace a gear in a sophisticated watch that you have meticulously maintained for decades. What if, instead of repairing it by hand, you entrusted the design to a highly intelligent Artificial Intelligence (AI)? The work speed would be incredibly fast, but could there be small, unforeseen mistakes hiding in the design?

Recently, one of the world’s most famous developers and the creator of Linux (the core of computer operating systems), Linus Torvalds, conducted just such an interesting experiment. He used Anthropic’s AI coding tool, ‘Claude Code’, to write code intended to improve Linux kernel performance. The results were impressive, yet they also clearly demonstrated the practical challenges inherent in the collaboration between artificial intelligence and humans.

Why is this important?

Linux is a core technology that runs everywhere in our daily lives, from Android smartphones to global supercomputers and cloud servers. Therefore, even the smallest performance improvement in the Linux kernel can simultaneously speed up the processing of countless devices around the world.

This attempt was a challenge to the question: ‘Can AI directly modify a complex system created by the best human minds?’ By going beyond just asking for code snippets and entrusting the core task of optimizing performance to AI, it sent shockwaves through the developer community. Source: ZDNET

Simply put

What Torvalds tried to solve with AI this time was the ‘reference-counting bottleneck’ occurring in the Linux kernel’s ‘page cache’ (a technology that temporarily stores frequently used data in memory for faster reading).

To use an easy analogy: When borrowing books at a library, a librarian writes down and verifies the names of the people borrowing them. This is fine when there are only one or two users, but when thousands rush in at once, a long line forms in front of the librarian, creating a bottleneck. In the Linux system, there was a similar problem where the process of checking who is currently using data became slow when multiple programs (processes) tried to read data simultaneously.

Torvalds used ‘Claude Code’ to write code that skips or streamlines this verification process. Source: Linus Torvalds Uses Claude Code to Improve Linux Kernel Surprisingly, the AI performed everything from the specific implementation of this task to writing test code and creating related documentation. Source: Linus Torvalds let Claude Code fix the Linux page cache. Then …

How far has it come?

The experimental results were quite encouraging. In synthetic benchmark tests conducted on Torvalds’ Threadripper (high-performance computer processor) system, read throughput improved by up to 23 times. Source: The New Stack Even in a standard laptop environment, notable results were achieved, with the speed of small-scale read operations nearly tripling. Source: HwBusters

However, that was as far as the optimism went. Less than four hours after Torvalds created a new kernel branch called ‘noref-filemap-read-with-llm’ and shared the work, human developers discovered a critical ‘race condition’ in the code. Source: Verboo.ai

In simple terms, a ‘race condition’ is an error where, when multiple programs try to modify the same data at the same time, the order gets tangled, causing the data to become corrupted or the system to freeze. The code created by the AI looked very fast and performed well, but it had a hole that could compromise the system’s stability. Source: Linus Torvalds let Claude Code fix the Linux page cache. Then …

What will change in the future?

This incident clearly demonstrates that while AI can be an excellent tool for developers, it cannot yet completely replace the meticulous human verification process. Through this experiment, Torvalds confirmed that AI can be a great help in drafting or solving complex problems.

Attempts to optimize performance using AI in development will continue to increase. However, a new principle will likely become common sense in the developer community: ‘The more code is written by AI, the more meticulously humans must review it.’

MindTickleBytes’ AI Reporter Perspective

The speed of technological advancement is much faster than we imagine. But just as the tiniest gear can determine the fate of an entire watch, this case proves that human intuition and sharp verification are not outdated values in the age of AI. AI provides wings, but the steering wheel is still in human hands.

References

  1. Linus Torvalds is using AI to develop Linux kernel code now - ZDNET
  2. Linus Torvalds let Claude Code fix the Linux page cache. Then … - The New Stack
  3. Torvalds and Claude Code on the Linux kernel: the patch and … - Verboo.ai
  4. Linus Torvalds Uses Claude Code to Improve Linux Kernel … - joho-todai.com
  5. Linus Torvalds Uses Claude Code on a New Linux Kernel … - blog.quadmeup.com
  6. Linus Torvalds let Claude Code fix the Linux page cache. Then … - daily.dev
  7. Linus Torvalds Uses Claude Code to Rework the Linux Page … - hwbusters.com
  8. Linus Torvalds Uses Claude Code to Speed Up the Linux Kernel - krasa.ai
AD
Test Your Understanding
Q1. What Linux kernel issue did Linus Torvalds attempt to solve using AI?
  • Fixing security vulnerabilities
  • Page cache reference-counting bottleneck
  • Network speed degradation
Torvalds aimed to improve the reference-counting bottleneck in the Linux kernel's page cache using AI.
Q2. What problem did Linux kernel reviewers discover in the code written by the AI?
  • Memory leak
  • Race condition
  • Incorrect library reference
Within four hours of the code being posted, reviewers found a 'race condition' error that occurs when multiple threads access resources simultaneously.
Q3. Which of the following correctly describes the results of this AI-powered project?
  • Perfect code was generated and integrated immediately.
  • It showed impressive performance in synthetic benchmarks, but bugs were found.
  • The code written by the AI had no performance improvements at all.
It showed up to a 23x increase in read throughput in synthetic benchmarks, but because bugs were found, it was not integrated into the actual kernel.
Linux Creator Linus Torvald...
0:00