Skip to contentSkip to conversation

drm/amdgpu: fix amdgpu_vm_fini

PATCH In review Christian König 2 participants 2 messages Oct 18, 2018 – Oct 19, 2018 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: fix amdgpu_vm_fini

We should not remove mappings in rbtree_postorder_for_each_entry_safe because that rebalances the tree.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +0 -1
index 6904d794d60a..01d94de6a6a1 100644
@@ -3235,7 +3235,6 @@ void amdgpu_vm_fini(struct amdgpu_device *adev, struct amdgpu_vm *vm)
 	rbtree_postorder_for_each_entry_safe(mapping, tmp,
 					     &vm->va.rb_root, rb) {
 		list_del(&mapping->list);
-		amdgpu_vm_it_remove(mapping, &vm->va);
 		kfree(mapping);
 	}
 	list_for_each_entry_safe(mapping, tmp, &vm->freed, list) {
Signature · 6 lines
2.14.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 20181018123140.62411-1-christian.koenig-5C7GfCeVMHo@public.gmane.org

#2 lore raw
Quoted 13 lines · Christian König

We should not remove mappings in rbtree_postorder_for_each_entry_safe because that rebalances the tree.

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 1 -
  1 file changed, 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +0 -0
index 6904d794d60a..01d94de6a6a1 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c void amdgpu_vm_fini(struct amdgpu_device *adev, struct amdgpu_vm *vm) · line 3238

Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +0 -1
@@ -3235,7 +3235,6 @@ void amdgpu_vm_fini(struct amdgpu_device *adev, struct amdgpu_vm *vm)
  	rbtree_postorder_for_each_entry_safe(mapping, tmp,
  					     &vm->va.rb_root, rb) {
  		list_del(&mapping->list);
-		amdgpu_vm_it_remove(mapping, &vm->va);
  		kfree(mapping);

At least, we should add some comments here, like rb_root would be invalid, we cannot use it any more, although that is fact. Or as you suggested to me before, we can change to while(next_node)...:)

anyway, depending on your favorite, Reviewed-by: Chunming Zhou <[email protected]>

drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c void amdgpu_vm_fini(struct amdgpu_device *adev, struct amdgpu_vm *vm) · line 3240

Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +0 -0
  	}
  	list_for_each_entry_safe(mapping, tmp, &vm->freed, list) {

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx