]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitf6b189c61700dd133755cfa45eb2adf9026fb1c8
tree333b61e66796bbc9165685f9cfad65d4667efeec
parent524a8ba40c847a3833d38867b2d03b7a5fc77488
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