OSDN Git Service

drm/amdkfd: handle svm partial migration cpages 0
authorPhilip Yang <Philip.Yang@amd.com>
Tue, 5 Oct 2021 15:13:21 +0000 (11:13 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 13 Oct 2021 18:15:46 +0000 (14:15 -0400)
commitca432dcc27a1bca71a5e7b35399617d5efb3af45
treede84d0a6aaef0665bd940140141afb358904e881
parenta273bc9937e64ddb3798ba0fd5c92b5f3fce84c4
drm/amdkfd: handle svm partial migration cpages 0

migrate_vma_setup may return cpages 0, means 0 page can be migrated,
treat this as error case to skip the rest of vma migration steps.

Change svm_migrate_vma_to_vram and svm_migrate_vma_to_ram to return the
number of pages migrated successfully or error code. The caller add up
all the successful migration pages and update prange->actual_loc only if
the total migrated pages is not 0.

This also removes the warning message "VRAM BO missing during
validation" if migration cpages is 0.

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