drm/amdgpu: add a list in VM for BOs in the done state
Subsystems (2)
PATCH 1/1 drm/amdgpu: add a list in VM for BOs in the done state
From: Mihir Bhogilal Patel <[email protected]>
Add a new list in VM for done state i.e. BOs which are invalidated and updated in PTEs.
Signed-off-by Mihir Bhogilal Patel <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 19 ++++++++++++++++--- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h | 3 +++ 2 files changed, 19 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +16 -3
@@ -300,7 +300,7 @@ static void amdgpu_vm_bo_relocated(struct amdgpu_vm_bo_base *vm_bo)static void amdgpu_vm_bo_done (struct amdgpu_vm_bo_base *vm_bo) {spin_lock (&vm_bo->vm->invalidated_lock); -list_del_init (&vm_bo->vm_status); +list_move (&vm_bo->vm_status, &vm_bo->vm->done);spin_unlock (&vm_bo->vm->invalidated_lock); }
@@ -2823,7 +2823,7 @@ int amdgpu_vm_init(struct amdgpu_device *adev, struct amdgpu_vm *vm,INIT_LIST_HEAD (&vm->invalidated);spin_lock_init (&vm->invalidated_lock);INIT_LIST_HEAD (&vm->freed); - +INIT_LIST_HEAD (&vm->done);/* create scheduler entities for page table updates */ r = drm_sched_entity_init(&vm->immediate, DRM_SCHED_PRIORITY_NORMAL,
@@ -3410,11 +3410,13 @@ void amdgpu_debugfs_vm_bo_info(struct amdgpu_vm *vm, struct seq_file *m)u64 total_relocated =0 ;u64 total_moved =0 ;u64 total_invalidated =0 ; +u64 total_done =0 ;unsigned int total_idle_objs =0 ;unsigned int total_evicted_objs =0 ;unsigned int total_relocated_objs =0 ;unsigned int total_moved_objs =0 ;unsigned int total_invalidated_objs =0 ; +unsigned int total_done_objs =0 ;unsigned int id =0 ;seq_puts (m,"\tIdle BOs:\n" );
@@ -3460,8 +3462,17 @@ void amdgpu_debugfs_vm_bo_info(struct amdgpu_vm *vm, struct seq_file *m)continue ; total_invalidated +=amdgpu_bo_print_info (id++, bo_va->base.bo, m); } -spin_unlock (&vm->invalidated_lock); total_invalidated_objs = id; + id =0 ; + +seq_puts (m,"\tDone BOs:\n" ); +list_for_each_entry_safe (bo_va, tmp, &vm->done, base.vm_status) { +if (!bo_va->base.bo) +continue ; + total_done +=amdgpu_bo_print_info (id++, bo_va->base.bo, m); + } +spin_unlock (&vm->invalidated_lock); + total_done_objs = id;seq_printf (m,"\tTotal idle size: %12lld\tobjs:\t%d\n" , total_idle, total_idle_objs);
@@ -3473,5 +3484,7 @@ void amdgpu_debugfs_vm_bo_info(struct amdgpu_vm *vm, struct seq_file *m) total_moved_objs);seq_printf (m,"\tTotal invalidated size: %12lld\tobjs:\t%d\n" , total_invalidated, total_invalidated_objs); +seq_printf (m,"\tTotal done size: %12lld\tobjs:\t%d\n" , total_done, + total_done_objs); }#endif
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h +3 -0
@@ -274,6 +274,9 @@ struct amdgpu_vm {/* BO mappings freed, but not yet updated in the PT */ struct list_head freed; +/* BOs which are invalidated, has been updated in the PTs */ +struct list_head done; +/* contains the page directory */ struct amdgpu_vm_pt root;struct dma_fence *last_update;
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Am 16.10.20 um 12:55 schrieb Mihir Patel:
Quoted 6 lines
From: Mihir Bhogilal Patel <[email protected]>
Add a new list in VM for done state i.e. BOs which are invalidated and updated in PTEs.
Signed-off-by Mihir Bhogilal Patel <[email protected]>
Reviewed-by Christian König <[email protected]>
Quoted 73 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 19 ++++++++++++++++--- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h | 3 +++ 2 files changed, 19 insertions(+), 3 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +16
-3@@ -300,7 +300,7 @@ static void amdgpu_vm_bo_relocated(struct amdgpu_vm_bo_base *vm_bo)static void amdgpu_vm_bo_done (struct amdgpu_vm_bo_base *vm_bo) {spin_lock (&vm_bo->vm->invalidated_lock); -list_del_init (&vm_bo->vm_status); +list_move (&vm_bo->vm_status, &vm_bo->vm->done);spin_unlock (&vm_bo->vm->invalidated_lock); }@@ -2823,7 +2823,7 @@ int amdgpu_vm_init(struct amdgpu_device *adev, struct amdgpu_vm *vm,INIT_LIST_HEAD (&vm->invalidated);spin_lock_init (&vm->invalidated_lock);INIT_LIST_HEAD (&vm->freed); - +INIT_LIST_HEAD (&vm->done);/* create scheduler entities for page table updates */ r = drm_sched_entity_init(&vm->immediate, DRM_SCHED_PRIORITY_NORMAL,@@ -3410,11 +3410,13 @@ void amdgpu_debugfs_vm_bo_info(struct amdgpu_vm *vm, struct seq_file *m)u64 total_relocated =0 ;u64 total_moved =0 ;u64 total_invalidated =0 ; +u64 total_done =0 ;unsigned int total_idle_objs =0 ;unsigned int total_evicted_objs =0 ;unsigned int total_relocated_objs =0 ;unsigned int total_moved_objs =0 ;unsigned int total_invalidated_objs =0 ; +unsigned int total_done_objs =0 ;unsigned int id =0 ;seq_puts (m,"\tIdle BOs:\n" );@@ -3460,8 +3462,17 @@ void amdgpu_debugfs_vm_bo_info(struct amdgpu_vm *vm, struct seq_file *m)continue ; total_invalidated +=amdgpu_bo_print_info (id++, bo_va->base.bo, m); } -spin_unlock (&vm->invalidated_lock); total_invalidated_objs = id; + id =0 ; + +seq_puts (m,"\tDone BOs:\n" ); +list_for_each_entry_safe (bo_va, tmp, &vm->done, base.vm_status) { +if (!bo_va->base.bo) +continue ; + total_done +=amdgpu_bo_print_info (id++, bo_va->base.bo, m); + } +spin_unlock (&vm->invalidated_lock); + total_done_objs = id;seq_printf (m,"\tTotal idle size: %12lld\tobjs:\t%d\n" , total_idle, total_idle_objs);@@ -3473,5 +3484,7 @@ void amdgpu_debugfs_vm_bo_info(struct amdgpu_vm *vm, struct seq_file *m) total_moved_objs);seq_printf (m,"\tTotal invalidated size: %12lld\tobjs:\t%d\n" , total_invalidated, total_invalidated_objs); +seq_printf (m,"\tTotal done size: %12lld\tobjs:\t%d\n" , total_done, + total_done_objs); }#endif drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h +0
-0
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h struct amdgpu_vm { · line 282
Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h +3
-0@@ -274,6 +274,9 @@ struct amdgpu_vm {/* BO mappings freed, but not yet updated in the PT */ struct list_head freed; +/* BOs which are invalidated, has been updated in the PTs */ +struct list_head done; +/* contains the page directory */ struct amdgpu_vm_pt root;struct dma_fence *last_update;
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx