Emperor Penguin Linus Torvalds banishes a bug – with a bot
The lad himself finds and fixes a tricky one… or does he?
In the ongoing development of the Linux kernel 7.3, an unexpected source has contributed a bug fix: Linus Torvalds himself. The title of the fix is "Don’t hand out the flat CCS storage as usable VRAM." With kernel 7.2 recently released, the team is focused on identifying and resolving numerous bugs for the upcoming kernel 7.3. While Linus Torvalds is generally known for not being an active programmer, this particular case is an exception.
The bug itself is not particularly intricate; it arises from a mistake in the kernel driver for Intel Xe graphics, causing machines to freeze during the boot process when transitioning to graphics mode to display the login screen. This issue stems from the graphics driver allocating memory for Intel's Compute Command Streamer (CCS), which the kernel's Intel i915 driver documentation describes as an engine with access to media and GPGPU pipelines but not the 3D pipeline.
The driver attempts to identify the memory location, take the memory below it, round it up to a multiple of 128 kB, and set it as available video memory. However, this rounding up occasionally leads to marking already-used memory as available. The fix is a one-line change; the complexity lies in identifying the error. The story takes a unique turn in the discovery of the bug.
It was found using a bot, and even the bug report was generated by this bot. This demonstrates the utility of coding bots for developers. The bot wrote 42 test code chunks to aid Linus in pinpointing the bug. Interestingly, this is not the first time Torvalds has used a bot to assist in his work. The issue of modern PC graphics controllers having separate memory chunks, which are not shared by the CPU, is also highlighted.
This is common in most modern PCs but not in Arm64 machines, such as Apple Silicon ones, which share a single pool of RAM. As memory prices rise due to the AI-hyperscaler-induced scarcity, alternative solutions like Sean Lobjoit's NBD-VRAM patch and Valve's Natalie Vock's patch are being explored to optimize VRAM usage in Linux systems.
Written by urgent.news from The Register Science'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