mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-23 15:11:16 +00:00
drm/amdgpu: Fix tracking of invalid userptrs
Restore the code that resets mem->invalid. Othewise so mapping userptrs after they got an MMU notifiers would always be skipped. This also avoids unnecessarily calling get_user_pages on BOs that have not been invalidated since the last try. Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com> Reviewed-by: Philip Yang <Philip.Yang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
e7e2505326
commit
f4fd28b6c7
1 changed files with 6 additions and 0 deletions
|
@ -1740,6 +1740,12 @@ static int update_invalid_user_pages(struct amdkfd_process_info *process_info,
|
||||||
}
|
}
|
||||||
|
|
||||||
amdgpu_ttm_tt_get_user_pages_done(bo->tbo.ttm);
|
amdgpu_ttm_tt_get_user_pages_done(bo->tbo.ttm);
|
||||||
|
|
||||||
|
/* Mark the BO as valid unless it was invalidated
|
||||||
|
* again concurrently.
|
||||||
|
*/
|
||||||
|
if (atomic_cmpxchg(&mem->invalid, invalid, 0) != invalid)
|
||||||
|
return -EAGAIN;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue