drm/amdkfd: Add SVM range mapped_to_gpu flag
authorPhilip Yang <Philip.Yang@amd.com>
Tue, 19 Apr 2022 01:32:14 +0000 (21:32 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 26 Apr 2022 15:42:44 +0000 (11:42 -0400)
commit6b9c63a6eb540e678504a080865e9d3c716288ed
treed1f89b647efac0a9638ddeec7f9403bd4e2fc417
parent398bb283899b831bea45d639d0d4e0190c9ca305
drm/amdkfd: Add SVM range mapped_to_gpu flag

To avoid unnecessary unmap SVM range from GPUs if range is not mapped on
GPUs when migrating the range. This flag will also be used to flush TLB
when updating the existing mapping on GPUs.

It is protected by prange->migrate_mutex and mmap read lock in MMU
notifier callback.

Signed-off-by: Philip Yang <Philip.Yang@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_svm.c
drivers/gpu/drm/amd/amdkfd/kfd_svm.h