mirror of
https://github.com/torvalds/linux.git
synced 2024-11-26 06:02:05 +00:00
drm/ttm: Double check mem_type of BO while eviction
BO might sit in a wrong lru list as there is a small period of memory moving and lru list updating. Lets skip eviction if we hit such mismatch. Suggested-by: Christian König <christian.koenig@amd.com> Signed-off-by: xinhui pan <xinhui.pan@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Link: https://patchwork.freedesktop.org/patch/msgid/20211110043149.57554-2-xinhui.pan@amd.com Signed-off-by: Christian König <christian.koenig@amd.com>
This commit is contained in:
parent
f55aaf63bd
commit
7120a447c7
@ -617,7 +617,8 @@ static bool ttm_bo_evict_swapout_allowable(struct ttm_buffer_object *bo,
|
||||
*busy = !ret;
|
||||
}
|
||||
|
||||
if (ret && place && !bo->bdev->funcs->eviction_valuable(bo, place)) {
|
||||
if (ret && place && (bo->resource->mem_type != place->mem_type ||
|
||||
!bo->bdev->funcs->eviction_valuable(bo, place))) {
|
||||
ret = false;
|
||||
if (*locked) {
|
||||
dma_resv_unlock(bo->base.resv);
|
||||
|
Loading…
Reference in New Issue
Block a user