[PATCH] drm/amdkfd: retry after EBUSY is returned from hmm_ranges_get_pages

Felix Kuehling felix.kuehling at amd.com
Thu Aug 17 19:54:43 UTC 2023


On 2023-08-16 14:44, Alex Sierra wrote:
> if hmm_range_get_pages returns EBUSY error during
> svm_range_validate_and_map, within the context of a page fault
> interrupt. This should retry through svm_range_restore_pages
> callback. Therefore we treat this as EAGAIN error instead, and defer
> it to restore pages fallback.
>
> Signed-off-by: Alex Sierra <alex.sierra at amd.com>

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


> ---
>   drivers/gpu/drm/amd/amdkfd/kfd_svm.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_svm.c b/drivers/gpu/drm/amd/amdkfd/kfd_svm.c
> index 93609ea42163..3ebd5d99f39e 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_svm.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_svm.c
> @@ -1685,6 +1685,8 @@ static int svm_range_validate_and_map(struct mm_struct *mm,
>   		WRITE_ONCE(p->svms.faulting_task, NULL);
>   		if (r) {
>   			pr_debug("failed %d to get svm range pages\n", r);
> +			if (r == -EBUSY)
> +				r = -EAGAIN;
>   			goto unreserve_out;
>   		}
>   


More information about the amd-gfx mailing list