[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAH5fLgg3zKBG5FzLnVmQ1P-fZ=GDH2RN_jwFLEJ86tqwEXTvAA@mail.gmail.com>
Date: Fri, 5 Sep 2025 15:01:16 +0200
From: Alice Ryhl <aliceryhl@...gle.com>
To: Boris Brezillon <boris.brezillon@...labora.com>
Cc: Danilo Krummrich <dakr@...nel.org>, Matthew Brost <matthew.brost@...el.com>,
Thomas Hellström <thomas.hellstrom@...ux.intel.com>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>, Maxime Ripard <mripard@...nel.org>,
Thomas Zimmermann <tzimmermann@...e.de>, David Airlie <airlied@...il.com>, Simona Vetter <simona@...ll.ch>,
Steven Price <steven.price@....com>, Daniel Almeida <daniel.almeida@...labora.com>,
Liviu Dudau <liviu.dudau@....com>, dri-devel@...ts.freedesktop.org,
linux-kernel@...r.kernel.org, rust-for-linux@...r.kernel.org
Subject: Re: [PATCH 2/2] panthor: use drm_gpuva_unlink_defer()
On Fri, Sep 5, 2025 at 2:53 PM Boris Brezillon
<boris.brezillon@...labora.com> wrote:
>
> On Fri, 05 Sep 2025 12:11:29 +0000
> Alice Ryhl <aliceryhl@...gle.com> 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
Powered by blists - more mailing lists