[PATCH] drm/amdkfd: handle errors returned by svm_migrate_copy_to_vram/ram

Felix Kuehling felix.kuehling at amd.com
Wed May 5 20:11:26 UTC 2021


Am 2021-05-05 um 1:55 p.m. schrieb Philip Yang:
> If migration copy failed because process is killed, or out of VRAM or
> system memory, pass error code back to caller to handle error
> gracefully.
>
> Signed-off-by: Philip Yang <Philip.Yang at amd.com>

Reviewed-by: Felix Kuehling <Felix.Kuehling at amd.com>


> ---
>  drivers/gpu/drm/amd/amdkfd/kfd_migrate.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_migrate.c b/drivers/gpu/drm/amd/amdkfd/kfd_migrate.c
> index bc2fc528ad58..fd8f544f0de2 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_migrate.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_migrate.c
> @@ -460,8 +460,8 @@ svm_migrate_vma_to_vram(struct amdgpu_device *adev, struct svm_range *prange,
>  	}
>  
>  	if (migrate.cpages) {
> -		svm_migrate_copy_to_vram(adev, prange, &migrate, &mfence,
> -					 scratch);
> +		r = svm_migrate_copy_to_vram(adev, prange, &migrate, &mfence,
> +					     scratch);
>  		migrate_vma_pages(&migrate);
>  		svm_migrate_copy_done(adev, mfence);
>  		migrate_vma_finalize(&migrate);
> @@ -663,8 +663,8 @@ svm_migrate_vma_to_ram(struct amdgpu_device *adev, struct svm_range *prange,
>  	pr_debug("cpages %ld\n", migrate.cpages);
>  
>  	if (migrate.cpages) {
> -		svm_migrate_copy_to_ram(adev, prange, &migrate, &mfence,
> -					scratch);
> +		r = svm_migrate_copy_to_ram(adev, prange, &migrate, &mfence,
> +					    scratch);
>  		migrate_vma_pages(&migrate);
>  		svm_migrate_copy_done(adev, mfence);
>  		migrate_vma_finalize(&migrate);


More information about the amd-gfx mailing list