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: [PATCH v3] drm/i915: Add to timeline requires the timeline mutex
Date: Mon, 08 Jul 2019 14:32:25 +0100	[thread overview]
Message-ID: <156259274575.9375.11752216809720039961@skylake-alporthouse-com> (raw)
In-Reply-To: <156258852175.9375.12523322915332431559@skylake-alporthouse-com>

Quoting Chris Wilson (2019-07-08 13:22:01)
> Quoting Tvrtko Ursulin (2019-07-08 13:18:02)
> > 
> > On 08/07/2019 12:39, Chris Wilson wrote:
> > > v2: Though it doesn't affect the current users, contexts may share
> > > timelines so check if we already hold the right mutex.
> 
> > > +int intel_context_prepare_remote_request(struct intel_context *ce,
> > > +                                      struct i915_request *rq)
> > > +{
> > > +     struct intel_timeline *tl = ce->ring->timeline;
> > > +     int err;
> > > +
> > > +     /* Only suitable for use in remotely modifying this context */
> > > +     GEM_BUG_ON(rq->hw_context == ce);
> > > +
> > > +     if (rq->timeline != tl) { /* beware timeline sharing */
> > > +             err = mutex_lock_interruptible_nested(&tl->mutex,
> > > +                                                   SINGLE_DEPTH_NESTING);
> > 
> > Which caller is holding tl->mutex?
> 
> None today, but it is conceivable. So rather than have a mysterious
> deadlock not reported by lockdep in the future, nip the problem in the
> bud.

Just in case, creating a request takes the timeline->mutex and holds it
until submitted. So the scenario I considered was if one user context
wanted to modify another one (which could work), but they happen to be
on a common timeline.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2019-07-08 13:32 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-08 11:19 [PATCH 1/2] drm/i915/oa: Reconfigure contexts on the fly Chris Wilson
2019-07-08 11:19 ` [PATCH 2/2] drm/i915: Add to timeline requires the timeline mutex Chris Wilson
2019-07-08 11:22   ` [PATCH v2] " Chris Wilson
2019-07-08 11:39   ` [PATCH v3] " Chris Wilson
2019-07-08 12:18     ` Tvrtko Ursulin
2019-07-08 12:22       ` Chris Wilson
2019-07-08 13:32         ` Chris Wilson [this message]
2019-07-08 13:40           ` Tvrtko Ursulin
2019-07-08 13:47             ` Chris Wilson
2019-07-08 13:49               ` Chris Wilson
2019-07-08 11:52 ` ✓ Fi.CI.BAT: success for series starting with [1/2] drm/i915/oa: Reconfigure contexts on the fly (rev2) Patchwork
2019-07-08 12:10 ` [PATCH 1/2] drm/i915/oa: Reconfigure contexts on the fly Tvrtko Ursulin
2019-07-08 12:16   ` Chris Wilson
2019-07-08 12:24     ` Tvrtko Ursulin
2019-07-08 13:39       ` Chris Wilson
2019-07-11  7:23         ` Tvrtko Ursulin
2019-07-11  7:59           ` Chris Wilson
2019-07-11 15:05         ` Chris Wilson
2019-07-08 12:35 ` ✓ Fi.CI.BAT: success for series starting with [1/2] drm/i915/oa: Reconfigure contexts on the fly (rev3) Patchwork
2019-07-08 17:37 ` ✓ Fi.CI.IGT: " Patchwork
2019-07-11 15:12 ` [PATCH v3] drm/i915/oa: Reconfigure contexts on the fly Chris Wilson
2019-07-11 17:59 ` ✓ Fi.CI.BAT: success for series starting with [v3] drm/i915/oa: Reconfigure contexts on the fly (rev4) Patchwork
2019-07-12 19:39 ` ✓ Fi.CI.IGT: " Patchwork

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=156259274575.9375.11752216809720039961@skylake-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.