drm/ttm: never consider pinned BOs for eviction&swap
Subsystems (3)
PATCH 1/1 drm/ttm: never consider pinned BOs for eviction&swap
There is a small window where we have already incremented the pin count but not yet moved the bo from the lru to the pinned list.
Signed-off-by Christian König <[email protected]>
--- drivers/gpu/drm/ttm/ttm_bo.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/gpu/drm/ttm/ttm_bo.c +6 -0
@@ -517,6 +517,12 @@ static bool ttm_bo_evict_swapout_allowable(struct ttm_buffer_object *bo, {bool ret = false; +if (bo->pin_count) { + *locked = false; + *busy = false; +return false; + } +if (bo->base.resv == ctx->resv) {dma_resv_assert_held (bo->base.resv);if (ctx->allow_res_evict)
Signature · 1 line
2.34.1
Quoted 5 lines · Christian König
There is a small window where we have already incremented the pin count but not yet moved the bo from the lru to the pinned list.
Signed-off-by Christian König <[email protected]>
Acked-by Alex Deucher <[email protected]>
Quoted 24 lines
--- drivers/gpu/drm/ttm/ttm_bo.c | 6 ++++++ 1 file changed, 6 insertions(+)drivers/gpu/drm/ttm/ttm_bo.c +6
-1@@ -517,6 +517,12 @@ static bool ttm_bo_evict_swapout_allowable(struct ttm_buffer_object *bo, {bool ret = false; +if (bo->pin_count) { + *locked = false; + *busy = false; +return false; + } +if (bo->base.resv == ctx->resv) {dma_resv_assert_held (bo->base.resv);if (ctx->allow_res_evict) --2.34.1