Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amdgpu: add eviction counter

Keep track of the number of evictions since boot.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Christian König and committed by
Alex Deucher
dbd5ed60 0eaeb070

+6
+1
drivers/gpu/drm/amd/amdgpu/amdgpu.h
··· 2042 2042 atomic64_t vram_vis_usage; 2043 2043 atomic64_t gtt_usage; 2044 2044 atomic64_t num_bytes_moved; 2045 + atomic64_t num_evictions; 2045 2046 atomic_t gpu_reset_counter; 2046 2047 2047 2048 /* display */
+5
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
··· 397 397 return -EINVAL; 398 398 399 399 adev = amdgpu_get_adev(bo->bdev); 400 + 401 + /* remember the eviction */ 402 + if (evict) 403 + atomic64_inc(&adev->num_evictions); 404 + 400 405 if (old_mem->mem_type == TTM_PL_SYSTEM && bo->ttm == NULL) { 401 406 amdgpu_move_null(bo, new_mem); 402 407 return 0;