On 03/11/2026 13:23, Arunpravin Paneer Selvam wrote:
Hi Matthew,

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]>
This version brought back a DAL CI failure. when the range allocator wanted a clear (or dirty) block, it would split a mixed block to look for a pure one, throw away the mixed halves, and then use unsplit_block to join them again. Doing this on every allocation was costly: even though the merge cascades back up through all levels, repeating this split-and-unsplit on every allocation added enough overhead on the display hot path that a large scanout buffer eventually failed with -ENOSPC (igt@kms_plane@plane-panning-bottom-right on Radeon RX 9070 XT).

This change relaxes the rule for range allocations only: we just take a mixed block as it is (the caller clears it if needed), so the first pass never splits and never has to undo a split. Large same-class blocks stay whole, so contiguous space is preserved and fragmentation goes down. The behaviour is still correct, unsplit_block is no longer needed, and a KUnit test reproduces the problem (it fails without the fix and passes with it).

Could you please just review v3 of this patch?. It is a bit urgent as we need it to land the base dirty-tracker patch on our internal branch.

I think sashiko is now complaining about the same thing from before?


Thanks,
Arun.

Are you just going to push this one by itself?


Reply via email to