Skip to content

Commit

Permalink
drm/amdkfd: flag added to handle errors from svm validate and map
Browse files Browse the repository at this point in the history
If a return error is raised during validation and mapping of a
prange, this flag is set. It is a rare occurrence, but it could happen
when `amdgpu_hmm_range_get_pages_done` returns true. In such cases,
the caller should retry. However, it is important to ensure that the
prange is updated correctly during the retry.

Signed-off-by: Alex Sierra <[email protected]>
Reviewed-by: Felix Kuehling <[email protected]>
  • Loading branch information
alexsierrag committed May 30, 2023
1 parent 79673f8 commit a3940ea
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/gpu/drm/amd/amdkfd/kfd_svm.c
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,7 @@ svm_range_is_same_attrs(struct kfd_process *p, struct svm_range *prange,
}
}

return true;
return !prange->is_error_flag;
}

/**
Expand Down Expand Up @@ -1655,6 +1655,7 @@ static int svm_range_validate_and_map(struct mm_struct *mm,
unreserve_out:
svm_range_unreserve_bos(&ctx);

prange->is_error_flag = !!r;
if (!r)
prange->validate_timestamp = ktime_get_boottime();

Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/amd/amdkfd/kfd_svm.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ struct svm_range {
DECLARE_BITMAP(bitmap_aip, MAX_GPU_INSTANCE);
bool validated_once;
bool mapped_to_gpu;
bool is_error_flag;
};

static inline void svm_range_lock(struct svm_range *prange)
Expand Down

0 comments on commit a3940ea

Please sign in to comment.