Home / Blog / Hardware
Hardware สรุปและวิเคราะห์จากข่าวต้นทาง

Analysis and Review: Linus Torvalds Sends the First AI-Assisted Linux Kernel Patch, Synthetic Testing Is 23 Times Faster

Linus Torvalds experimented with using an LLM to solve cache contention in the Linux kernel and reported a 23-fold improvement in synthetic benchmark results, although the real-world improvement may be much lower.

Linus Torvalds Opens Linux Patch Developed with LLM Assistance for the First Time

This patch is in the development branch and aims to address cache contention when multiple CPUs read the same file, which can occur in shared libraries, databases, and web servers. Synthetic test results improved by 23 times, but Linus emphasized that real-world workloads would never see numbers at this level.

The key point is that LLMs can accelerate development, but they still need to be part of a rigorous review process. Developers must understand the code they submit to the kernel themselves. Although AI can help detect errors and vulnerability patterns, it can also generate so many security reports that managing them becomes difficult.

What Problem Is This Patch Solving?

The main problem is cache contention when multiple CPUs attempt to read the same file simultaneously, causing data access to become congested and preventing the system from operating at full capacity.

This situation can occur in shared libraries, databases, and web servers, especially in workloads where multiple CPUs read the same files. This is not a new problem. Many developers have tried to solve it over the years, but each approach has limitations, and there is still no solution that works perfectly for every case.

What to Take Away from the Experimental Patch

This patch is in the development branch and is code that Linus Torvalds developed with the help of an LLM to address cache contention when multiple CPUs read the same file. It should therefore be viewed as experimental work that still requires review, not as a released feature.

The synthetic benchmark improved by 23x, but Torvalds said real-world workloads would see much smaller gains because no real workload would produce results at the same level. The benefits are therefore likely to be more noticeable for server workloads than for desktop machines.

[Illustration: The Linux kernel development branch and multiple CPUs reading the same file]

When the Existing Problem Still Has No Perfect Answer

Imagine a system in which multiple CPUs need to read the same file in shared libraries, databases, or web servers. The problem is severe cache contention, which causes data access to become congested. Many people have tried to solve it, but each approach still has limitations and none provides a perfect answer.

Torvalds had drafted an approach to this problem in early 2024 and had been using it on his own laptop ever since, before deciding to try using an LLM to make further improvements. What makes this interesting is that the LLM helped accelerate the work of someone who already understood the problem and the codebase.

Where This Patch Fits into the Linux Development Process

The patch is still in the development branch, so it is an approach under testing—not a conclusion that AI will replace the entire Linux maintenance process. Before it can be used in practice, it still needs to pass through the project’s rigorous review system.

Torvalds views an LLM as another kind of tool, similar to a compiler or editor. He expects developers to understand what they are doing within a controlled environment and to conduct thorough reviews.

From Earlier Attempts to an LLM-Assisted Approach

ApproachResult Reported by the Source
Many developers tried to solve it over several yearsResults varied, and no comprehensive method was found
Patch drafted by Torvalds in 2024He has used it on his laptop since then
Latest patch developed with LLM assistanceIt is in the development branch and made the synthetic benchmark 23 times faster

The 23x figure comes from a synthetic benchmark. The source emphasized that real-world workloads would produce smaller gains, and there are still no direct comparative figures for the earlier approaches.

What Does 23 Times Faster Mean in Practice?

ItemReported Result
Synthetic benchmarkPerformance improved by 23 times
Real-world workloadTorvalds said it was unlikely to produce results at the same level
Groups that may benefitServer workloads more than desktop machines

This figure should therefore be viewed as the result of a specialized test, not as a speed increase that every system will achieve. Real-world workloads cannot fully match a benchmark, so the actual impact will likely be smaller, especially on desktop systems.

The patch targets cache contention when multiple CPUs read the same file, so it is more likely to be relevant to shared libraries, databases, and web servers than to typical desktop computers.

Strengths of Using AI in Kernel Development and Points to Watch

  • It can reduce tedious work for experienced developers, but the author still needs to understand the code and verify the results personally.
  • The kernel team uses an automated code review tool that performs better than humans in some areas and helps catch basic errors that should never be submitted.
  • The risk is that synthetic test results do not mean real-world workloads will become equally faster, so conclusions should not be based on benchmarks alone.
  • AI is also good at detecting vulnerability patterns, to the point that Linux receives so many security reports that managing them has become more difficult.

Approaches Currently Being Compared

ApproachDevelopment StatusPerformance EvidenceCaveat
Earlier attemptsMany developers have tried to solve it, but results variedNo approach yet covers every caseEach method has limitations
Torvalds’s draft patchUsed on his laptop since early 2024An approach drafted and developed by Torvalds himselfStill a draft patch
Latest LLM-assisted patchIn the development branchSynthetic benchmark improved by 23xReal-world workloads will see much smaller gains

The Cost Is Not Reflected in the Performance Numbers

The real cost is not limited to the time spent having an LLM generate code. It also includes the effort required to review the patch so that people can understand and take responsibility for it, since submitted code may still contain basic errors that should have prevented it from being submitted in the first place.

Another issue is the growing number of vulnerability reports, to the point that the Linux security mailing list is “unable to cope.” Approximately 2,000 CVEs are addressed per release. At the same time, the team has had to stop maintaining some older hardware drivers, even though they have few users, because they often attract a large number of security reports.

What This Patch Tells Us About Torvalds’s Position

Torvalds’s position on AI is becoming increasingly clear. He supports automated code review because he believes it can catch basic errors better than human review in some cases.

Later, the Linux team changed its policy and stopped requiring patch submitters to disclose whether they had used AI. Torvalds views an LLM as simply another kind of tool, like a compiler or editor.

However, using AI does not mean developers can hand over the entire task to it. What he expects is for everyone to do their best and genuinely understand the code they are submitting.

From Impressive Numbers to More Important Questions

The 23x figure comes from a synthetic benchmark, so it does not yet answer whether real-world workloads will become that much faster. Torvalds himself stated that no real workload was likely to see results at the same level, and the benefits may be more apparent on servers than on desktops.

What remains to be seen is whether the patch will pass review by the kernel team and how effectively it will help with workloads involving shared libraries, databases, or web servers. For now, it remains in the development branch rather than being a final conclusion.