Latest

Technology

Igalia explains what it contributed to Linux 7.3 and why your GPU performs better

Igalia lands 69 patches in Linux 7.3, the kernel with 18,765 commits: less CPU load in amdgpu, VRAM with cgroup and the deprecation notice for V3D 3.3.

Igalia explains what it contributed to Linux 7.3 and why your GPU performs better
Igalia explains what it contributed to Linux 7.3 and why your GPU performs better

A kernel is not measured by the number of commits, but by who signs each patch and for which specific hardware. Linux 7.3 was tagged on Sunday, October 18, with 18,765 non-merge commits from 3,021 developers, 807 of them first-timers, according to Linus Torvalds' announcement, the largest volume of work in the project's history. Eight days later, Igalia publishes its summary of the cycle: 69 patches of its own and 59 reviews, almost all in graphics drivers and in the scheduler.

Igalia is a Galician free software consultancy owned by its workers, founded in September 2001 in A Coruña and with more than a hundred employees; the cooperative itself states on its website how it is organized. His name does not appear on the case of any computer, but it does appear in the code that drives the GPU of a Raspberry Pi, AMD graphics cards and a good part of the browsers you use every day.

Three changes that show up on a home team come out of this cycle's list. The Raspberry Pi GPU driver unifies the way work is sent to the hardware, the AMD one cuts the CPU cost per submitted job, and the per-cgroup VRAM limit stops failing silently when you lower it below what is already in use.

Sixty-nine patches that don't make the headline

The Linux 7.3 balance that Igalia publishes this Monday breaks down into 69 patches written and 59 reviewed, concentrated in graphics, device memory and the scheduler. Maíra Canal and Iago Toral sign almost everything for the Raspberry Pi; Ursulin handles amdgpu and Min the scheduler. That continuity allows a 2019 card to keep receiving fixes.

Who signs Subsystem What changes for the user
Maíra Canal V3D and VC4, Raspberry Pi GPU A single job submission path and reliable performance counters
Tvrtko Ursulin amdgpu Buffer contexts and lists with XArray, less CPU per job
Melissa Wen AMD display End of color banding in HDR and of blending warnings in the register
Thadeu Cascardo cgroup dmem VRAM reclaim when lowering the maximum and new `dmem.peak` file
Changwoo Min sched-ext Fewer copies of the arena spinlock and hooks that can now sleep

Read cold, the table allows for a less friendly reading. Almost everything is leak fixes, robustness and cleanup, with no star feature that justifies upgrading just for it. The gain shows up a few months later, when the team stops freezing mid-game.

A single job chain for the Raspberry Pi GPU

The V3D driver had been accumulating submission types as it grew and the code kept using the abstractions from the beginning. In 7.3 Igalia introduces `struct v3d_submit`, which represents the job chain as an ordered array, and moves render, texture and compute submissions onto that common path, as detailed in the refactor breakdown.

The second change in that area affects the performance monitor. The new lock management allows jobs to be serialized between queues when a counter is attached, so the figures stop getting mixed up. Anyone profiling a game or a graphics engine on the board gets numbers they can trust.

The least-read item on the list is a removal. This is the last version with support for V3D 3.3 and 4.1, two generations with no users in the tree since Mesa stopped supporting them with the arrival of 7.1. It does not affect any Raspberry Pi, because those are the Broadcom 7268 and 7278, reference boards, and the Pi 4 uses 4.2.

Starting with the next version, the kernel will drop support and those boards will stay on 7.3 if they want a GPU. It is the usual way of closing a door in the kernel. First a warning in advance, then the removal, and in between the possibility that someone with a real interest in maintaining the code will show up.

The AMD driver drops IDR and uses less CPU

The AMD block is broad and mixes several different things. GPU contexts and buffer lists abandon the inherited IDR and move to XArray, with code paths simplified. In addition, several hundred kilobytes leave the binary by moving decisions from macros to checks performed only once.

On the job submission path, the savings come from the CPU. The buffer list mutex, which no longer protected anything, is gone, several hardware block checks are replaced by a cached condition, and idle workers are rearmed far less often. On an old card with few cores, that background work is noticeable.

There is also security in the package. Igalia fixes possible use-after-free and null pointer dereferences in context pstate handling, where the driver stores the stable power state of each GPU context. These are fixes that do not appear in the release notes but do reach the stable kernels.

Per-cgroup VRAM caps are now enforced

The cgroup dmem controller was born in 6.14 for Intel graphics chips, arrived in amdgpu in 6.15 and in 7.3 is also adopted by nouveau. It allows setting how much video memory a group of processes can spend, something useful when a game, a browser and the compositor compete for the same VRAM, according to the explanation of the controls.

Until now, lowering `dmem.max` below what the group had already been allocated failed without saying anything. In 7.3, that write triggers a reclaim that moves objects from VRAM to GTT, the system memory the GPU also uses, and waits for usage to drop below the new ceiling.

The change also brings a read-only file, `dmem.peak`, with peak usage, and a stricter rule for writing limits, one region per write. Previously several could be touched at once and left half-done without anyone noticing. For those who partition the machine into cgroups, as in Bazzite, the limit starts to mean something.

An extensible scheduler that already stacks by cgroups

The other major block of the cycle is not signed off by Igalia, although two of its patches are included there. sched-ext, the framework that allows CPU schedulers to be written in BPF, closes out support for sub-schedulers in 7.3: a root scheduler can hand a subtree of cgroups to another nested one with revocable CPU grants, according to Tejun Heo's pull request.

Igalia's detail in that area is smaller and more useful than it seems. Duplicate copies of the arena spinlock nodes are removed, so the scheduler uses less memory per instance, and `ops.cgroup_set_bandwidth()` becomes sleepable. That allows it to call blocking operations, such as allocating memory, without breaking the hook.

What a changelog tells you when it is signed by a cooperative

The 7.4 merge window opened on Monday, October 19, with Linus Torvalds on family leave and a warning that the schedule could stretch. The list of what goes in is being written these days, with the changes for the next cycle still not closed. What lands will depend, once again, on who is willing to review it.

For anyone who uses Linux and does not write it, the conclusion is practical. None of these improvements arrive by installing 7.3 by hand on the same Monday, but when your distribution packages and tests it. The VRAM and scheduler ones are only noticeable if you spread processes across cgroups; the rest is plumbing that is appreciated all the same.

José Maldonado

Author

José Maldonado

Activist and blogger on technology, free software and blockchain.

The latest
From Huang to Botín, from Zara to Byron: corporate responsibility in global capitalism

Keep reading