Commit dbd5ed60 authored by Christian König's avatar Christian König Committed by Alex Deucher

drm/amdgpu: add eviction counter

Keep track of the number of evictions since boot.
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 0eaeb070
...@@ -2042,6 +2042,7 @@ struct amdgpu_device { ...@@ -2042,6 +2042,7 @@ struct amdgpu_device {
atomic64_t vram_vis_usage; atomic64_t vram_vis_usage;
atomic64_t gtt_usage; atomic64_t gtt_usage;
atomic64_t num_bytes_moved; atomic64_t num_bytes_moved;
atomic64_t num_evictions;
atomic_t gpu_reset_counter; atomic_t gpu_reset_counter;
/* display */ /* display */
......
...@@ -397,6 +397,11 @@ static int amdgpu_bo_move(struct ttm_buffer_object *bo, ...@@ -397,6 +397,11 @@ static int amdgpu_bo_move(struct ttm_buffer_object *bo,
return -EINVAL; return -EINVAL;
adev = amdgpu_get_adev(bo->bdev); adev = amdgpu_get_adev(bo->bdev);
/* remember the eviction */
if (evict)
atomic64_inc(&adev->num_evictions);
if (old_mem->mem_type == TTM_PL_SYSTEM && bo->ttm == NULL) { if (old_mem->mem_type == TTM_PL_SYSTEM && bo->ttm == NULL) {
amdgpu_move_null(bo, new_mem); amdgpu_move_null(bo, new_mem);
return 0; return 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