Commit b049689a authored by Jason Ekstrand's avatar Jason Ekstrand Committed by Dylan Baker
Browse files

anv/allocator: Don't shrink either end of the block pool

Previously, we only tried to ensure that we didn't shrink either end
below what was already handed out.  However, due to the way we handle
relocations with block pools, we can't shrink the back end at all.  It's
probably best to not shrink in either direction.


Tested-by: Eero Tamminen's avatarEero Tamminen <>
Reviewed-by: D Scott Phillips's avatarScott D Phillips <>
(cherry picked from commit 3db93f91)
parent 7ef09330
......@@ -508,12 +508,12 @@ anv_block_pool_grow(struct anv_block_pool *pool, struct anv_block_state *state)
assert(center_bo_offset >= back_used);
/* Make sure we don't shrink the back end of the pool */
if (center_bo_offset < pool->back_state.end)
center_bo_offset = pool->back_state.end;
if (center_bo_offset < back_required)
center_bo_offset = back_required;
/* Make sure that we don't shrink the front end of the pool */
if (size - center_bo_offset < pool->state.end)
center_bo_offset = size - pool->state.end;
if (size - center_bo_offset < front_required)
center_bo_offset = size - front_required;
assert(center_bo_offset % PAGE_SIZE == 0);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment