All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
	intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH 2/6] drm/i915/gem: Avoid gem_context->mutex for simple vma lookup
Date: Thu, 19 Mar 2020 14:52:21 +0000	[thread overview]
Message-ID: <158462954105.6873.17855848411603572916@build.alporthouse.com> (raw)
In-Reply-To: <99ee9e55-1aeb-5cb7-4378-a62f671f4811@linux.intel.com>

Quoting Tvrtko Ursulin (2020-03-19 14:20:04)
> 
> On 19/03/2020 09:19, Chris Wilson wrote:
> > +static struct i915_vma *eb_lookup_vma(struct i915_execbuffer *eb, u32 handle)
> > +{
> > +     do {
> > +             struct drm_i915_gem_object *obj;
> >               struct i915_vma *vma;
> > +             int err;
> >   
> > -             vma = radix_tree_lookup(handles_vma, handle);
> > +             rcu_read_lock();
> > +             vma = radix_tree_lookup(&eb->gem_context->handles_vma, handle);
> 
> radix_tree_lookup is documented to be RCU safe okay. How about freeing 
> VMAs - is that done after a RCU grace period?

As we are still stuck with the horrible i915_vma.kref semantics (yes, I
know I'm supposed to be fixing that), there are 3 paths which may
destroy i915_vma: the object (RCU safe), the vm (RCU safe) and
i915_vma_parked, not safe in any way shape or form.

A quick and dirty solution would be to move i915_vma_parked behind an
rcu work.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2020-03-19 14:52 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-19  9:19 [Intel-gfx] [PATCH 1/6] drm/i915: Prefer '%ps' for printing function symbol names Chris Wilson
2020-03-19  9:19 ` [Intel-gfx] [PATCH 2/6] drm/i915/gem: Avoid gem_context->mutex for simple vma lookup Chris Wilson
2020-03-19 14:20   ` Tvrtko Ursulin
2020-03-19 14:52     ` Chris Wilson [this message]
2020-03-19 16:02       ` Chris Wilson
2020-03-19  9:19 ` [Intel-gfx] [PATCH 3/6] drm/i915/execlists: Force single submission for sentinels Chris Wilson
2020-03-19 14:31   ` Tvrtko Ursulin
2020-03-19 15:02     ` Chris Wilson
2020-03-19 15:11       ` Tvrtko Ursulin
2020-03-19 15:21         ` Chris Wilson
2020-03-19 15:31           ` Chris Wilson
2020-03-19 16:58             ` Chris Wilson
2020-03-19  9:19 ` [Intel-gfx] [PATCH 4/6] drm/i915/gem: Wait until the context is finally retired before releasing engines Chris Wilson
2020-03-19 14:36   ` Tvrtko Ursulin
2020-03-19  9:19 ` [Intel-gfx] [PATCH 5/6] drm/i915: Use explicit flag to mark unreachable intel_context Chris Wilson
2020-03-19  9:19 ` [Intel-gfx] [PATCH 6/6] drm/i915/gt: Cancel a hung context if already closed Chris Wilson
2020-03-19 14:40   ` Tvrtko Ursulin
2020-03-19 14:43     ` Tvrtko Ursulin
2020-03-19 10:20 ` [Intel-gfx] ✓ Fi.CI.BAT: success for series starting with [1/6] drm/i915: Prefer '%ps' for printing function symbol names Patchwork
2020-03-19 11:39 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2020-03-19 13:53 ` [Intel-gfx] [PATCH 1/6] " Tvrtko Ursulin

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=158462954105.6873.17855848411603572916@build.alporthouse.com \
    --to=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=tvrtko.ursulin@linux.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.