All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Dave Gordon <david.s.gordon@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v4 0/3] improve handling of the driver's default (kernel) context
Date: Thu, 21 Jan 2016 09:21:06 +0100	[thread overview]
Message-ID: <20160121082106.GK19130@phenom.ffwll.local> (raw)
In-Reply-To: <1453230175-19330-1-git-send-email-david.s.gordon@intel.com>

On Tue, Jan 19, 2016 at 07:02:52PM +0000, Dave Gordon wrote:
> During startup, the driver creates a unique "intel_context" that will
> provide a home for orphan requests (i.e. those generated by the driver
> internally, not associated with user batchbuffers).
> 
> However, one of the infelicities of the current code is that the driver
> keeps a per-engine pointer to the default context for that engine (this
> is probably from a decision made early in execlists implementation,
> when it was thought that a context was engine-specific, and not revised
> when it was decided that an "intel_context" represents a multiplex of
> engine-level contexts). All these per-engine pointers actually end up
> pointing to the same unique object.
> 
> To compound this, the refcounting is bogus; the driver holds just one
> reference to the default context, even though there are multiple pointers
> to it (RCS is considered to hold this "on behalf of" the other engines,
> but this can lead to problems during unload as it makes the code sensitive
> to the order of engine teardown -- RCS should be done last, but it isn't).
> 
> Also, some of the execlists batch submission code treats the default
> context differently from any other; testing for it by comparing against
> the per-engine pointer is quite clumsy, especially in debugfs where
> contexts are enumerated from a global list and therefore not automatically
> known to be associated with a particular engine.
> 
> Therefore, we should replace the per-engine pointers with a single
> driver-wide reference, which will make the refcounting sane and simplify
> the code that uses this context for non-user-related requests.
> 
> THIS patchset does NOT address the execlists code's special handling of
> the default context, but it will simplify the planned future cleanup of
> that code.
> 
> v3: don't flag the context created during startup (and fully instantiated
> on all engines) for driver-internal purposes as "is_global_default",
> 1448630935-27377-1-git-send-email-chris@chris-wilson.co.uk notwithstanding.
> (We now call it "the kernel context", and compare against the device-wide
> pointer).  [Chris Wilson] 
> 
> v4: Rebased

entire series vacuumed up, thanks.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2016-01-21  8:21 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-19 19:02 [PATCH v4 0/3] improve handling of the driver's default (kernel) context Dave Gordon
2016-01-19 19:02 ` [PATCH v4 1/3] drm/i915: simplify allocation of driver-internal requests Dave Gordon
2016-01-20  9:56   ` Tvrtko Ursulin
2016-01-20 10:20     ` Chris Wilson
2016-01-22 11:12   ` Tvrtko Ursulin
2016-01-22 12:19     ` [PATCH] Fix pointer tests in error-handling paths Dave Gordon
2016-01-22 13:01       ` Chris Wilson
2016-01-22 13:17         ` Tvrtko Ursulin
2016-01-22 13:34           ` Chris Wilson
2016-01-25 17:54             ` Dave Gordon
2016-01-22 13:07       ` Tvrtko Ursulin
2016-01-25 16:28         ` Daniel Vetter
2016-01-25 17:07           ` Tvrtko Ursulin
2016-01-25 17:57       ` [PATCH v2] " Dave Gordon
2016-01-27 12:33         ` Maarten Lankhorst
2016-01-27 12:41           ` Tvrtko Ursulin
2016-01-27 13:45             ` Maarten Lankhorst
2016-01-19 19:02 ` [PATCH v4 2/3] drm/i915: abolish separate per-ring default_context pointers Dave Gordon
2016-01-19 19:02 ` [PATCH v4 3/3] drm/i915: tidy up a few leftovers Dave Gordon
2016-01-20  7:49 ` ✗ Fi.CI.BAT: warning for improve handling of the driver's default (kernel) context Patchwork
2016-01-20 17:31   ` Dave Gordon
2016-01-21  8:19     ` Daniel Vetter
2016-01-21  8:21 ` Daniel Vetter [this message]
2016-01-27 15:43 ` ✓ Fi.CI.BAT: success for improve handling of the driver's default (kernel) context (rev3) 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=20160121082106.GK19130@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=david.s.gordon@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /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.