All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Mateo Lozano, Oscar" <oscar.mateo@intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>,
	"ville.syrjala@linux.intel.com" <ville.syrjala@linux.intel.com>
Cc: "intel-gfx@lists.freedesktop.org" <intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH] drm/i915: Unpin last_context at reset
Date: Thu, 19 Jun 2014 16:21:50 +0000	[thread overview]
Message-ID: <92648605EABDA246B775AAB04C95A7A301320F9E@IRSMSX103.ger.corp.intel.com> (raw)
In-Reply-To: <20140619074722.GC10572@nuc-i3427.alporthouse.com>

> -----Original Message-----
> From: Intel-gfx [mailto:intel-gfx-bounces@lists.freedesktop.org] On Behalf
> Of Chris Wilson
> Sent: Thursday, June 19, 2014 8:47 AM
> To: ville.syrjala@linux.intel.com
> Cc: intel-gfx@lists.freedesktop.org
> Subject: Re: [Intel-gfx] [PATCH] drm/i915: Unpin last_context at reset
> 
> On Wed, Jun 18, 2014 at 10:04:48PM +0300, ville.syrjala@linux.intel.com
> wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >
> > We're forgetting to unpin the last_context from the ggtt at GPU reset
> > time. This leads to the vma pin_count leaking at every reset if the
> > last context wasn't the ring default context. Further use of the same
> > context will trigger the pin_count check in i915_gem_object_pin() and
> > userspace will be faced with EBUSY as a result.
> >
> > This plaques kms_flip rather badly since it performs lots of resets,
> > and every fd has its own default context these days.
> >
> > Fix the problem by properly unpinning the last context at reset.
> 
> Ah, the context reset here is faked because we never restore the default
> context state.  Hmm, in fact, I get the impression that we should just delete
> i915_gem_context_reset(), and make i915_gem_context_enable() function
> correctly after the GPU is reset.
> -Chris

I´m doing something similar in a parallel conversation (see http://lists.freedesktop.org/archives/intel-gfx/2014-June/047744.html). My proposal was to make both the APPGTT switch and default context switch completely synchronous (RING_PP_DIR_BASE/GEN8_RING_PDP for the PPGTT, CCID for the context) in i915_gem_context_enable(). That way we get rid of i915_gem_context_reset() and we don´t need all the gpu reset special casing inside ppgtt->switch_mm.
Daniel wants a completely asynchronous thing, which seems complex without intel_ring_begin, ring->flush, intel_ring_advance, etc..

  reply	other threads:[~2014-06-19 16:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-18 19:04 [PATCH] drm/i915: Unpin last_context at reset ville.syrjala
2014-06-18 19:04 ` [PATCH igt] tests/gem_ctx_exec: Add reset-pin-leak subtest ville.syrjala
2014-06-19  7:47 ` [PATCH] drm/i915: Unpin last_context at reset Chris Wilson
2014-06-19 16:21   ` Mateo Lozano, Oscar [this message]
2014-06-23 10:07 ` Ville Syrjälä
2014-07-07 14:38   ` Daniel Vetter

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=92648605EABDA246B775AAB04C95A7A301320F9E@IRSMSX103.ger.corp.intel.com \
    --to=oscar.mateo@intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=ville.syrjala@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.