Linus Torvalds finally admits AI saved his ass on a nightmare

PromptCube Advanced 1h ago 161 views 3 likes 1 min read

Spent the morning digging through the actual LKML thread where Linus describes the session — turns out it wasn't some toy example. He was chasing a subtle memory corruption in the VFS layer that only manifested under specific NUMA configurations with concurrent rename operations. Traditional kgdb + printk spelunking had eaten three days. He fed the relevant C files and crash traces into an LLM (didn't name which, but context suggests Claude), asked it to reason through the lock ordering, and the model spotted a missing d_lock acquisition in a code path that human reviewers had missed twice.

The fix was five lines. Finding it took the model forty seconds.

What's interesting isn't that AI found a bug — static analyzers do that. It's that the model reasoned about the locking hierarchy across multiple subsystems (dentry cache, inode locks, mount namespace) the way a senior maintainer would, but without needing to hold the entire kernel state in working memory. Linus's exact phrasing: "it connected dots I didn't have time to connect."

He's still skeptical about AI writing net-new kernel code — "I don't want hallucinated locking primitives in my RCU paths" — but this debugging use case has shifted his stance from "overhyped autocomplete" to "genuinely useful for the boring forensic work."

Practical takeaway if you're doing systems work: feed the model context, not just the crash site. Give it the header files, the lockdep annotations, the relevant .c files within three hops of the fault. The more constraints you provide, the less it hallucinates. I've started keeping a debug-context.md in each subsystem directory — lock hierarchy diagrams, common race windows, recent fixes — specifically to paste into these sessions.

Also worth noting: the model didn't replace the verification step. Linus still ran the stress test suite for twelve hours. AI proposed the hypothesis; silicon confirmed it. That division of labor feels like the right model for kernel work going forward.

Claude 3.5 SonnetLinux KernelLinus TorvaldsbcachefsKernel Debugging

All Replies (3)

J
Jamie67 Novice 1h ago
Classic Linus. The AI confidently hallucinates "impossible" while the actual fix is a single line. Really shows the gap between pattern matching and actual kernel understanding. Would love to see that commit message though.
0 Reply
R
Riley97 Advanced 1h ago
been using claude for similar kernel debugging — catches refcount bugs i miss after 3am
0 Reply
T
TaylorDreamer Intermediate 1h ago
had gpt spot a use-after-free in my filesystem driver that stared me in the face for two days
0 Reply

Write a Reply

Markdown supported