Repository navigation
p14s-personal: backport amdgpu/TTM lockup fix - #86
Conversation
Closing multiple GPU apps at once (Firefox, Chrome, then Telegram)
hung the whole system three times (2026-09-11, 2026-09-12,
2026-09-14), requiring a hard power cycle each time. journalctl
showed CPUs livelocked in ttm_resource_manager's spinlock, reached
via amdgpu_cs_ioctl / GEM-close ioctls.
Root cause: upstream commit b2ed01e7ad3d ("drm/ttm: Fix
ttm_bo_swapout() infinite LRU walk on swapout failure") moved TTM's
bulk-move bookkeeping under `if (!ret)` in ttm_bo_swapout_cb(), but
ttm_tt_swapout() never returns 0 on success -- so the bookkeeping is
skipped on every successful swapout, leaving a stale cursor in the
resource manager's LRU list that later teardown livelocks on.
The 1-line upstream fix (Closes:
https://gitlab.freedesktop.org/drm/amd/-/issues/5387) hasn't shipped
in any released kernel as of 7.2.6, and nixpkgs' own kernel-bump PR
(NixOS/nixpkgs#563193) only reaches 7.2.6 via a staging branch that
can take weeks to reach nixpkgs-unstable. Backport it locally via
boot.kernelPatches until then.
|
(randomly passing by)
That's incorrect. The |
|
Thanks for the correction — you're right, That said, the staging-lag point wasn't actually the blocker here: the upstream TTM fix itself ( Anecdotally, the change in the patch seems to have resolved the issue I was experiencing, though admittedly it has only been a few days of moderate use of the laptop. 🤞 |
Summary
hung the whole system three times (2026-09-11, 2026-09-12,
2026-09-14), each requiring a hard power cycle.
journalctl -b -1showed CPUs livelocked in
ttm_resource_manager's spinlock,reached via
amdgpu_cs_ioctl/ GEM-close ioctls.b2ed01e7ad3d("drm/ttm: Fixttm_bo_swapout() infinite LRU walk on swapout failure") moved
TTM's bulk-move bookkeeping under
if (!ret)inttm_bo_swapout_cb(), butttm_tt_swapout()never returns 0 onsuccess — so the bookkeeping is skipped on every successful
swapout, leaving a stale cursor in the resource manager's LRU list
that later teardown livelocks on.
hasn't shipped in any released kernel as of 7.2.6, and nixpkgs'
own kernel-bump PR (NixOS/nixpkgs#563193)
only reaches 7.2.6 via a staging branch that can take weeks to
reach
nixpkgs-unstable. Backports the fix locally viaboot.kernelPatchesonp14s-personaluntil nixpkgs catches up(comment in the diff notes when to drop it).
Test plan
nix build .#nixosConfigurations.p14s-personal.config.system.build.toplevelsucceeds — kernel compiled from source with the patch applied cleanly (verified against both 7.2.4 and, after a rebase, 7.2.5)nixos-rebuild switch+ reboot into the patched kernel