Emperor Penguin Linus Torvalds banishes a bug – with a bot
The lad himself finds and fixes a tricky one… or does he?
Linux kernel 7.3 is currently under development, and a bug fix has arrived from an unexpected source: Linus Torvalds. That's not the whole story, though. The fix is titled "Don't hand out the flat CCS storage as usable VRAM," and it comes from the emperor penguin, Linus Torvalds. While Torvalds is the overall leader of the kernel project, he's not a programmer by profession anymore, a fact mentioned several times, including during a November stage appearance. However, this particular bug is an exception to that rule, but it's still only partly related.
The issue lies in the kernel driver for Intel Xe graphics, which caused machines to freeze during the boot process when switching to graphics mode to display the login screen. Troubleshooting this problem proved challenging due to the driver setting aside memory used by Intel's Compute Command Streamer (CCS). The driver attempts to identify where this memory is, reserves it below, and rounds it up to a multiple of 128 kB, setting it aside as free video memory.
However, rounding up sometimes marks memory as available that's already in use. It should have rounded down instead.
Linus Torvalds addressed the problem with a one-line fix, but discovering the error presented its own challenges. This is where the story becomes intriguing for several reasons. First, Torvalds himself provided the fix. Second, the comment accompanying the fix is unusually lengthy. Lastly, Torvalds employed a bot to help find the bug and write the bug report, which explains why the report appears dull and lifeless.
The patch description mentions that restarting a program – in this case, GDM (GNOME Display Manager) – can resolve the issue, as it gets a different block of memory on the second attempt.
The story highlights the growing relevance of coding bots in software development. While Torvalds didn't use the bot to write the fix, it helped generate 42 chunks of test code, enabling him to identify the issue. Interestingly, modern PC graphics controllers often have separate chunks of RAM not shared by the CPU, a design choice that affects how memory is managed and causes issues for certain Arm64 machines, such as Apple Silicon devices.
This issue has led to other patches aimed at optimizing VRAM usage, such as Sean Lobjoit's NBD-VRAM patch and Natalie Vock's work on AMD GPUs. Apple's recent shift towards closer silicon integration and a single shared memory pool may signal a promising direction for the industry.
Written by urgent.news from The Register's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.
This story
This is one outlet's version. Read the fullest account.
- Emperor Penguin Linus Torvalds banishes a bug – with a bot theregister.com