// ZDNET — INTELLIGENZA ARTIFICIALE
Linus Torvalds is using AI to develop Linux kernel code now
The move is a turning point in the developer's relationship with AI and Linux.
It had to happen. Linus Torvalds announced to the world that he used AI to write code for the Linux kernel. Who’d thought it? Well, me for one. Over the last few years, I’ve seen Torvalds’ attitude change from skeptical to seeing AI as a useful tool for programmers and maintainers.
In his Git submission, he wrote, “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.”
Also: ‘I use AI to do the things that I’m bad at’: Linus Torvalds on why it works for him
His new code consists of an eight-patch series. It’s published on the branch noref-filemap-read-with-llm in Torvalds’s repository. These patches aim to remove a bottleneck that arises when multiple threads make small reads from the same file.
Specifically, the fix addresses contention in Linux’s page cache, which holds file data in memory. When several threads repeatedly read small amounts of data from the same cached file, they take and release references to the folio backing that data. Those reference-count updates require atomic writes to a shared cache line. This in turn forces processor cores to compete over it.
Doesn’t sound like that big a problem, does it? Wrong. In some workloads, it can really slow things down. Torvalds found that when eight threads issued 16-byte pread() calls against the same page on a four-core, eight-thread Intel Core i7-8565U laptop, the shared cache line accounted for 99.92% of the measured cross-core load, according to Hit in Modified cache line (HITMs). That slows work down considerably.
This isn’t just Linus scratching a personal itch. It’s been a known issue since 2024. Earlier attempts to fix it, though, have come to naught.
Torvalds and Claude Code’s proposed patches change when the kernel can reuse memory removed from the page cache. Rather than returning that memory to the allocator immediately, the patches defer reuse until a read-copy-update (RCU) grace period has elapsed. That lets a reader protected by an RCU read-side section copy data directly into a user buffer without taking a folio reference.
Also: Someone made a free Photoshop clone – so I had to try it on Linux