drm/amdkfd: Add VRAM accounting for SVM migration
authorMukul Joshi <mukul.joshi@amd.com>
Thu, 18 Apr 2024 19:13:58 +0000 (15:13 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 26 Apr 2024 21:22:38 +0000 (17:22 -0400)
commit63335b383a0a52643fa5080d5bcef4e06c90213f
treefa9888160548ad23e4c849a9a6c4c94866db3032
parentfa7bb2cac0f7dae4604214cf547322c55975a9e8
drm/amdkfd: Add VRAM accounting for SVM migration

Do VRAM accounting when doing migrations to vram to make sure
there is enough available VRAM and migrating to VRAM doesn't evict
other possible non-unified memory BOs. If migrating to VRAM fails,
driver can fall back to using system memory seamlessly.

Signed-off-by: Mukul Joshi <mukul.joshi@amd.com>
Reviewed-by: Felix Kuehling <felix.kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdkfd/kfd_migrate.c
drivers/gpu/drm/amd/amdkfd/kfd_svm.c