From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Subject: Re: [PATCH 1/3] drm/i915: Stop holding a ref to the ppgtt from each vma
Date: Thu, 16 Aug 2018 14:42:08 +0300 [thread overview]
Message-ID: <87d0uiilm7.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <20180816073448.19396-1-chris@chris-wilson.co.uk>
Chris Wilson <chris@chris-wilson.co.uk> writes:
> The context owns both the ppgtt and the vma within it, and our activity
> tracking on the context ensures that we do not release active ppgtt. As
> the context fulfils our obligations for active memory tracking, we can
> relinquish the reference from the vma.
>
The part of owning the vma within it escapes me. The vma is tied
to the object. Is it about that active objects, with their vmas
hold the refs to the context they are executing on?
> This fixes a silly transient refleak from closed vma being kept alive
> until the entire system was idle, keeping all vm alive as well.
>
> Reported-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
> Testcase: igt/gem_ctx_create/files
> Fixes: 3365e2268b6b ("drm/i915: Lazily unbind vma on close")
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
> ---
> drivers/gpu/drm/i915/i915_vma.c | 4 ----
> 1 file changed, 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_vma.c b/drivers/gpu/drm/i915/i915_vma.c
> index 274fd2a7bcb6..31efc971a3a8 100644
> --- a/drivers/gpu/drm/i915/i915_vma.c
> +++ b/drivers/gpu/drm/i915/i915_vma.c
> @@ -199,7 +199,6 @@ vma_create(struct drm_i915_gem_object *obj,
> vma->flags |= I915_VMA_GGTT;
> list_add(&vma->obj_link, &obj->vma_list);
> } else {
> - i915_ppgtt_get(i915_vm_to_ppgtt(vm));
It seems this is the sole user of i915_ppgtt_get so you can
remove that too.
-Mika
> list_add_tail(&vma->obj_link, &obj->vma_list);
> }
>
> @@ -810,9 +809,6 @@ static void __i915_vma_destroy(struct i915_vma *vma)
> if (vma->obj)
> rb_erase(&vma->obj_node, &vma->obj->vma_tree);
>
> - if (!i915_vma_is_ggtt(vma))
> - i915_ppgtt_put(i915_vm_to_ppgtt(vma->vm));
> -
> rbtree_postorder_for_each_entry_safe(iter, n, &vma->active, node) {
> GEM_BUG_ON(i915_gem_active_isset(&iter->base));
> kfree(iter);
> --
> 2.18.0
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2018-08-16 11:43 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-16 7:34 [PATCH 1/3] drm/i915: Stop holding a ref to the ppgtt from each vma Chris Wilson
2018-08-16 7:34 ` [PATCH 2/3] drm/i915: Report the number of closed vma held by each context in debugfs Chris Wilson
2018-08-16 13:29 ` Mika Kuoppala
2018-08-16 13:35 ` Chris Wilson
2018-08-16 7:34 ` [PATCH 3/3] drm/i915: Remove debugfs/i915_ppgtt_info Chris Wilson
2018-08-16 7:41 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/3] drm/i915: Stop holding a ref to the ppgtt from each vma Patchwork
2018-08-16 7:57 ` ✓ Fi.CI.BAT: success " Patchwork
2018-08-16 8:51 ` ✓ Fi.CI.IGT: " Patchwork
2018-08-16 11:42 ` Mika Kuoppala [this message]
2018-08-16 11:49 ` [PATCH 1/3] " Chris Wilson
2018-08-16 12:14 ` Mika Kuoppala
2018-08-16 12:30 ` Chris Wilson
2018-08-16 12:54 ` Chris Wilson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87d0uiilm7.fsf@gaia.fi.intel.com \
--to=mika.kuoppala@linux.intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=intel-gfx@lists.freedesktop.org \
--cc=paulo.r.zanoni@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.