On Fri, Sep 5, 2025 at 2:53 PM Boris Brezillon <[email protected]> wrote: > > On Fri, 05 Sep 2025 12:11:29 +0000 > Alice Ryhl <[email protected]> wrote: > > > static void panthor_vm_cleanup_op_ctx(struct panthor_vm_op_ctx *op_ctx, > > struct panthor_vm *vm) > > { > > - struct panthor_vma *vma, *tmp_vma; > > - > > u32 remaining_pt_count = op_ctx->rsvd_page_tables.count - > > op_ctx->rsvd_page_tables.ptr; > > > > @@ -1134,16 +1091,12 @@ static void panthor_vm_cleanup_op_ctx(struct > > panthor_vm_op_ctx *op_ctx, > > kfree(op_ctx->rsvd_page_tables.pages); > > > > if (op_ctx->map.vm_bo) > > - panthor_vm_bo_put(op_ctx->map.vm_bo); > > + drm_gpuvm_bo_put_deferred(op_ctx->map.vm_bo); > > > > for (u32 i = 0; i < ARRAY_SIZE(op_ctx->preallocated_vmas); i++) > > kfree(op_ctx->preallocated_vmas[i]); > > > > - list_for_each_entry_safe(vma, tmp_vma, &op_ctx->returned_vmas, node) { > > - list_del(&vma->node); > > - panthor_vm_bo_put(vma->base.vm_bo); > > - kfree(vma); > > Maybe I'm missing something, but I don't see the VMAs being freed in > this new version.
Sorry you are right. We can kfree the vma right away after unlink(), but I forgot to add that. Alice
