On 10/21/2026 6:19 PM, Matthew Auld wrote:
On 21/10/2026 13:18, Arunpravin Paneer Selvam wrote:
From: Arunpravin Paneer Selvam <[email protected]>
Range-restricted allocations (the visible-VRAM aperture) skip
dirty_steer_window() and reach __alloc_range_bias() with no clear/dirty
eligibility guard, so a dirty allocation freely splits clear extents
(and
vice versa), interleaving the two classes until no large same-class run
survives and a 4K scanout pin fails with -ENOSPC. Use a two-pass range
search instead: block_incompatible() rejects opposite-class blocks in
the
strict pass and relaxes only when the strict pass returns -ENOSPC, so a
request still succeeds when only opposite-class space remains. A KUnit
regression test covers the interleaving pattern and fails without the
guard.
v2: the strict pass can split a block and then reject both children, so
a split no longer implies a compatible block exists. Sashiko
reported
the resulting leaked splits; fix as suggested by Matthew:
- Push the parent back on the DFS stack after each split and merge it
back with unsplit_block() if both children are still free.
- Make block_incompatible() judge free blocks only (split nodes keep a
stale clear bit) and take the requested order, so mixed blocks that
can hold a compatible block are descended instead of skipped.
- Extend the KUnit test with a coalesced mixed block and a check that
a rejected split is merged back.
Fixes: 1ad5e807f716 ("gpu/buddy: replace dual-tree/force_merge with
decoupled dirty tracker")
Assisted-by: LLM
Cc: Matthew Auld <[email protected]>
Cc: Christian König <[email protected]>
Signed-off-by: Arunpravin Paneer Selvam
<[email protected]>
Reviewed-by: Matthew Auld <[email protected]>
Are you just going to push this one by itself?
Yes, I am planning to push this one separately. Patch 2 can follow later
after review.
Thanks,
Arun.