drm/amdgpu: Remove explicit wait after VM validate
PD or PT might have to be moved during validation and this move has to be completed before updating it. If page table updates are done using SDMA then this serializing is done by SDMA command submission. And if PD/PT updates are done by CPU, then explicit waiting for PD/PT updates are done in amdgpu VM amdgpu_vm_wait_pd function. Sync to PD BO moving fence to handle corner case where none of the PTs are updated but PD is evicted. Signed-off-by: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com> Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com> Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
39e9456903
commit
9130cc01d1
@ -901,6 +901,26 @@ static int process_validate_vms(struct amdkfd_process_info *process_info)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int process_sync_pds_resv(struct amdkfd_process_info *process_info,
|
||||||
|
struct amdgpu_sync *sync)
|
||||||
|
{
|
||||||
|
struct amdgpu_vm *peer_vm;
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
list_for_each_entry(peer_vm, &process_info->vm_list_head,
|
||||||
|
vm_list_node) {
|
||||||
|
struct amdgpu_bo *pd = peer_vm->root.base.bo;
|
||||||
|
|
||||||
|
ret = amdgpu_sync_resv(amdgpu_ttm_adev(pd->tbo.bdev),
|
||||||
|
sync, pd->tbo.resv,
|
||||||
|
AMDGPU_FENCE_OWNER_UNDEFINED, false);
|
||||||
|
if (ret)
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int process_update_pds(struct amdkfd_process_info *process_info,
|
static int process_update_pds(struct amdkfd_process_info *process_info,
|
||||||
struct amdgpu_sync *sync)
|
struct amdgpu_sync *sync)
|
||||||
{
|
{
|
||||||
@ -2045,13 +2065,10 @@ int amdgpu_amdkfd_gpuvm_restore_process_bos(void *info, struct dma_fence **ef)
|
|||||||
if (ret)
|
if (ret)
|
||||||
goto validate_map_fail;
|
goto validate_map_fail;
|
||||||
|
|
||||||
/* Wait for PD/PTs validate to finish */
|
ret = process_sync_pds_resv(process_info, &sync_obj);
|
||||||
/* FIXME: I think this isn't needed */
|
if (ret) {
|
||||||
list_for_each_entry(peer_vm, &process_info->vm_list_head,
|
pr_debug("Memory eviction: Failed to sync to PD BO moving fence. Try again\n");
|
||||||
vm_list_node) {
|
goto validate_map_fail;
|
||||||
struct amdgpu_bo *bo = peer_vm->root.base.bo;
|
|
||||||
|
|
||||||
ttm_bo_wait(&bo->tbo, false, false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Validate BOs and map them to GPUVM (update VM page tables). */
|
/* Validate BOs and map them to GPUVM (update VM page tables). */
|
||||||
|
Loading…
Reference in New Issue
Block a user