Skip to content

Commit 0c8c0e7

Browse files
jameszhu-amdalexdeucher
authored andcommitted
drm/amdgpu: make an improvement on amdgpu_hmm_range_get_pages
Only schedule when hmm_range_fault returns error. Signed-off-by: James Zhu <James.Zhu@amd.com> Acked-by: Felix Kuehling <Felix.Kuehling@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 78b4dfd commit 0c8c0e7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ int amdgpu_hmm_range_get_pages(struct mmu_interval_notifier *notifier,
199199
hmm_range->notifier_seq = mmu_interval_read_begin(notifier);
200200
r = hmm_range_fault(hmm_range);
201201
if (unlikely(r)) {
202+
schedule();
202203
/*
203204
* FIXME: This timeout should encompass the retry from
204205
* mmu_interval_read_retry() as well.
@@ -212,7 +213,6 @@ int amdgpu_hmm_range_get_pages(struct mmu_interval_notifier *notifier,
212213
break;
213214
hmm_range->hmm_pfns += MAX_WALK_BYTE >> PAGE_SHIFT;
214215
hmm_range->start = hmm_range->end;
215-
schedule();
216216
} while (hmm_range->end < end);
217217

218218
hmm_range->start = start;

0 commit comments

Comments
 (0)