From: Ben Widawsky Subject: Re: [PATCH] drm/i915: reference count for i915_hw_contexts Date: Sat, 20 Apr 2013 11:11:25 -0700 Message-ID: <20130420181125.GB896@bwidawsk.net> References: <20130409221823.GA21133@cantiga.alporthouse.com> <1365552742-3358-1-git-send-email-ben@bwidawsk.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from shiva.localdomain (unknown [209.20.75.48]) by gabe.freedesktop.org (Postfix) with ESMTP id C589BE61C6 for ; Sat, 20 Apr 2013 11:09:00 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1365552742-3358-1-git-send-email-ben@bwidawsk.net> 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: intel-gfx@lists.freedesktop.org Cc: Mika Kuoppala List-Id: intel-gfx@lists.freedesktop.org On Tue, Apr 09, 2013 at 05:12:22PM -0700, Ben Widawsky wrote: > From: Mika Kuoppala > > 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) > > v5: idr_remove and ctx->file_priv = NULL in destroy ioctl (Chris) > This actually will cause a problem if one destroys a context and later > refers to the idea of the context (multiple contexts may have the same > id, but only 1 will exist in the idr). > > Signed-off-by: Mika Kuoppala (v2) > Signed-off-by: Ben Widawsky (v3) > Signed-off-by: Mika Kuoppala (v4) > Signed-off-by: Ben Widawsky (v5) I've tested this pretty darn thoroughly by now. I'm not sure if I can add an r-b to something I've already signed off by, but this is also: Tested-by: Ben Widawsky [snip] -- Ben Widawsky, Intel Open Source Technology Center