drm/amdkfd: Fix mm reference in SVM eviction worker
authorFelix Kuehling <Felix.Kuehling@amd.com>
Mon, 8 Aug 2022 21:00:38 +0000 (17:00 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 16 Aug 2022 22:03:23 +0000 (18:03 -0400)
commitc02895577b834a6148f6d9d0006a6f196511cc79
tree333b61e66796bbc9165685f9cfad65d4667efeec
parentea8793f214ce1e4db205390c0241955f7ff6f383
drm/amdkfd: Fix mm reference in SVM eviction worker

Use the mm reference from the fence. This allows removing the
svm_bo->svms pointer, which was problematic because we cannot assume
that the struct kfd_process containing the svms is still allocated
without holding a refcount on the process.

Use mmget_not_zero to ensure the mm is still valid, and drop the svm_bo
reference if it isn't.

Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: Philip Yang <Philip.Yang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdkfd/kfd_svm.c
drivers/gpu/drm/amd/amdkfd/kfd_svm.h