Files
stambha/crates/stela-linux
Federico Bricca aa9f736345 fix(boot): wait on a contended heap lock in GFP_ATOMIC allocations, fixing amdgpu vblank ENOMEM (#18)
Linux's kmalloc(GFP_ATOMIC) (mm/slub.c) does not sleep or reclaim, but still waits on its spinlock. Registering Heap::try_allocate_zeroed for the Linux GPU heap returned NULL on a single contended lock attempt, causing amdgpu_dm_crtc_set_vblank (amdgpu_dm_crtc.c:370) to fail with -ENOMEM and triggering drm_vblank_put underflow warnings (drm_vblank.c:1271) when dm_arm_vblank_event_pre_programming (amdgpu_dm.c:10491) ignores drm_crtc_vblank_get's return value.

Add Heap::allocate_atomic_zeroed, which serves small size classes from the per-CPU cache when cores are tagged and otherwise waits on the heap spinlock with local interrupts masked, and wire stela-boot's Linux GPU heap callback to it.

Co-authored-by: Federico Bricca <177528604+Cheering19@users.noreply.github.com>
(cherry picked from commit 0ad94f8900feb245663a2c5299ef902ff6634cd0)
2026-11-27 07:49:41 +00:00
..