drm/amdkfd: retry validation to recover range

GPU vm retry fault recover range need retry validation if

1. range is split in parallel by unmap while recover
2. range migrate to system memory and range is updated in system
memory while recover

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>
This commit is contained in:
Philip Yang 2021-04-19 21:51:27 -04:00 committed by Alex Deucher
parent c3c5cc9a83
commit 4999e398e2
1 changed files with 6 additions and 0 deletions

View File

@ -1402,11 +1402,13 @@ static int svm_range_validate_and_map(struct mm_struct *mm,
svm_range_lock(prange);
if (!prange->actual_loc) {
if (amdgpu_hmm_range_get_pages_done(hmm_range)) {
pr_debug("hmm update the range, need validate again\n");
r = -EAGAIN;
goto unlock_out;
}
}
if (!list_empty(&prange->child_list)) {
pr_debug("range split by unmap in parallel, validate again\n");
r = -EAGAIN;
goto unlock_out;
}
@ -2355,6 +2357,10 @@ out_unlock_svms:
out:
kfd_unref_process(p);
if (r == -EAGAIN) {
pr_debug("recover vm fault later\n");
r = 0;
}
return r;
}