Linus Torvalds posts his first LLM-assisted patch series
Linus Torvalds's first LLM-assisted patch series
At the Maintainers Summit, Linus Torvalds revealed he had used a large language model to develop a patch series addressing a longstanding kernel issue. The ten-patch set enhances folio lookup by marking hot folios and delaying their release until after an RCU period, allowing both lookup and data access under RCU without refcounting on the fast path. This yields an order-of-magnitude speedup for read()-heavy benchmarks. However, review has already identified a race condition, so further work is needed.
The end result is an order-of-magnitude speedup for a read()-heavy benchmark.
- tarkin2
Didn't Linus say he stopped coding a while ago, or at least coding the kernel, and mainly reviews and manages the codebase now? Whether the code comes from a machine or a human, perhaps it matters little to how he's been working for a while.
It's interesting that although I guess he reviewed this LLM generated code, the human review found a race condition.
- tombert
I use AI like most software people do nowadays, but I have to admit that I'm a little surprised that Linus is onboard with it. He always felt like one of the last "old school" developers...he wouldn't even touch C++!
- niemandhier
I looked at the diffs, they are moderately sized and well readable.
Nothing like the 2k loc people tend to commit with LLMs.
One can work with commits and MRs like that.
- dorianniemiec
So what would many anti-AI people say, now that critical infrastructure (Linux, OpenSSL, systemd, MariaDB, and so on) is AI-assisted?
- manbash
> The code, the test programs, the review behind the list above and the
first draft of this text were done with an LLM coding assistant (Claude
Code) under my direction. The measurements were run on my machine.
(From the empty commit message put at the top of the draft LLM branch: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/lin...)
- eikenberry
While I'm not surprised by Linus using AI, I am a bit surprised Linus used Claude and not one of the open weights models. I know he's always been much more pragmatic than Richard but using a fully closed, proprietary system that is actively attempting to lock out the (more) open competition seems to go against his general history and preferences for free software.
- mono442
He could have at least written the commit messages himself. That llm yapping is annoying to read.
- piro0919
Code from Claude Code that looks like it works but is actually broken happens to me all the time. I usually find out when I debug it locally, or when Sentry sends me an error alert.