From: Chris Wilson Subject: Re: [PATCH v3 03/16] drm/i915: reference count for i915_hw_contexts Date: Tue, 9 Apr 2013 23:18:23 +0100 Message-ID: <20130409221823.GA21133@cantiga.alporthouse.com> References: <1365089568-20457-1-git-send-email-mika.kuoppala@intel.com> <1365089568-20457-4-git-send-email-mika.kuoppala@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mga14.intel.com (mga14.intel.com [143.182.124.37]) by gabe.freedesktop.org (Postfix) with ESMTP id 83109E6355 for ; Tue, 9 Apr 2013 15:18:33 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1365089568-20457-4-git-send-email-mika.kuoppala@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: Mika Kuoppala Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Thu, Apr 04, 2013 at 06:32:35PM +0300, Mika Kuoppala wrote: > In preparation to do analysis of which context was > guilty of gpu hung, store kreffed context pointer > into request struct. > > This allows us to inspect contexts when gpu is reset > even if those contexts would already be released > by userspace. > > v2: track i915_hw_context pointers instead of using ctx_ids > (from Chris Wilson) > > v3 (Ben): Get rid of do_release() and handle refcounting more compactly. > (recommended by Chis) > > v4: kref_* put inside static inlines (Daniel Vetter) > remove code duplication on freeing context (Chris Wilson) > > Signed-off-by: Mika Kuoppala (v2) > Signed-off-by: Ben Widawsky (v3) > Signed-off-by: Mika Kuoppala (v4) > --- > @@ -511,7 +520,7 @@ int i915_gem_context_destroy_ioctl(struct drm_device *dev, void *data, > return -ENOENT; > } > > - do_destroy(ctx); > + i915_gem_context_unreference(ctx); This needs to remove the ctx from the idr as well as dropping the reference associated with the id. -Chris -- Chris Wilson, Intel Open Source Technology Centre