public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>,
	Intel-gfx@lists.freedesktop.org,
	Tvrtko Ursulin <tvrtko.ursulin@intel.com>,
	Nick Hoath <nicholas.hoath@intel.com>
Subject: Re: [PATCH v4 4/4] drm/i915: Fix premature LRC unpin in GuC mode
Date: Thu, 21 Jan 2016 13:51:30 +0000	[thread overview]
Message-ID: <56A0E262.5010704@linux.intel.com> (raw)
In-Reply-To: <20160121123210.GJ16147@nuc-i3427.alporthouse.com>


On 21/01/16 12:32, Chris Wilson wrote:
> On Thu, Jan 21, 2016 at 12:14:10PM +0000, Tvrtko Ursulin wrote:
>> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>>
>> In GuC mode LRC pinning lifetime depends exclusively on the
>> request liftime. Since that is terminated by the seqno update
>> that opens up a race condition between GPU finishing writing
>> out the context image and the driver unpinning the LRC.
>>
>> To extend the LRC lifetime we will employ a similar approach
>> to what legacy ringbuffer submission does.
>>
>> We will start tracking the last submitted context per engine
>> and keep it pinned until it is replaced by another one.
>>
>> Note that the driver unload path is a bit fragile and could
>> benefit greatly from efforts to unify the legacy and exec
>> list submission code paths.
>>
>> At the moment i915_gem_context_fini has special casing for the
>> two which are potentialy not needed, and also depends on
>> i915_gem_cleanup_ringbuffer running before itself.
>>
>> v2:
>>   * Move pinning into engine->emit_request and actually fix
>>     the reference/unreference logic. (Chris Wilson)
>>
>>   * ring->dev can be NULL on driver unload so use a different
>>     route towards it.
>>
>> v3:
>>   * Rebase.
>>   * Handle the reset path. (Chris Wilson)
>>   * Exclude default context from the pinning - it is impossible
>>     to get it right before default context special casing in
>>     general is eliminated.
>>
>> v4:
>>   * Rebased & moved context tracking to
>>     intel_logical_ring_advance_and_submit.
>>
>> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>> Issue: VIZ-4277
>> Cc: Chris Wilson <chris@chris-wilson.co.uk>
>> Cc: Nick Hoath <nicholas.hoath@intel.com>
>
> Whilst it saddens me to see yet another (impossible) special case added
> that will just have to be deleted again, the series is
> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>

Thanks and sorry, hopefully it will get cleanup up soon. There seems to 
be a growing number of people who want it done.

And I still need to get back to your VMA rewrite and breadcrumbs would 
be nice as well.

> I wonder if it is possible to poison the context objects before and
> after, then do a deferred check for stray writes, and use that mode for
> igt/gem_ctx_* (with some tests targetting active->idle vs
> context-close). Would still be susceptible to timing as we need to
> hit the interval between the seqno being complete and the delayed context
> save, but that seems like the most reliable way to detect the error?

First it needs to be tested with GuC to check that it actually fixes the 
issue. And pass CI of course.

But I can't really figure where would you put this poisoning? You could 
put something in in exec list mode after context complete and check it 
before it is used next time, but I did not think we can hit this in exec 
list mode, only in GuC. You think it is possible?

And in GuC mode I have no idea at which point you would put "poisoning" in?

Regards,

Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2016-01-21 13:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-21 12:14 [PATCH v2 1/4] drm/i915: Make LRC (un)pinning work on context and engine Tvrtko Ursulin
2016-01-21 12:14 ` [PATCH v2 2/4] drm/i915: Make LRC pinning own a reference to the context Tvrtko Ursulin
2016-01-21 12:14 ` [PATCH 3/4] drm/i915: Extract context unpinning to its own function Tvrtko Ursulin
2016-01-22 16:19   ` [PATCH v2] " Tvrtko Ursulin
2016-01-21 12:14 ` [PATCH v4 4/4] drm/i915: Fix premature LRC unpin in GuC mode Tvrtko Ursulin
2016-01-21 12:32   ` Chris Wilson
2016-01-21 13:51     ` Tvrtko Ursulin [this message]
2016-01-21 14:10       ` Chris Wilson
2016-01-21 14:06 ` ✗ Fi.CI.BAT: failure for series starting with [v2,1/4] drm/i915: Make LRC (un)pinning work on context and engine Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2016-01-25 11:25 [PATCH v2 1/4] " Tvrtko Ursulin
2016-01-25 11:25 ` [PATCH v4 4/4] drm/i915: Fix premature LRC unpin in GuC mode 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=56A0E262.5010704@linux.intel.com \
    --to=tvrtko.ursulin@linux.intel.com \
    --cc=Intel-gfx@lists.freedesktop.org \
    --cc=chris@chris-wilson.co.uk \
    --cc=nicholas.hoath@intel.com \
    --cc=tvrtko.ursulin@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox