drm/amdkfd: Remove prefault before migrating to VRAM
authorPhilip Yang <Philip.Yang@amd.com>
Tue, 26 Jul 2022 19:13:30 +0000 (15:13 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 13 Sep 2022 16:54:23 +0000 (12:54 -0400)
commitc969c5fd21fd700b126aa139ec57875697946474
tree91985e7bd6a9a223fa924488837281c5204187d8
parente1f84eef313f4820cca068a238c645d0a38c6a9b
drm/amdkfd: Remove prefault before migrating to VRAM

Prefaulting potentially allocates system memory pages before a
migration. This adds unnecessary overhead. Instead we can skip
unallocated pages in the migration and just point migrate->dst to a
0-initialized VRAM page directly. Then the VRAM page will be inserted
to the PTE. A subsequent CPU page fault will migrate the page back to
system memory.

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_migrate.c
drivers/gpu/drm/amd/amdkfd/kfd_svm.c
drivers/gpu/drm/amd/amdkfd/kfd_svm.h