From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Wilson Subject: Re: [PATCH] drm/i915: protect force_wake_(get|put) with the gt_lock Date: Sun, 06 Nov 2011 11:57:55 +0000 Message-ID: References: <20111106104644.GA2940@phenom.ffwll.local> <1320579094-1605-1-git-send-email-daniel.vetter@ffwll.ch> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTP id D15239E733 for ; Sun, 6 Nov 2011 03:58:02 -0800 (PST) In-Reply-To: <1320579094-1605-1-git-send-email-daniel.vetter@ffwll.ch> 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 Cc: Daniel Vetter List-Id: intel-gfx@lists.freedesktop.org On Sun, 6 Nov 2011 12:31:34 +0100, Daniel Vetter wrote: > We don't have any read in a fastpath that needs forcewake, so I've > decided to not care much about overhead. > > This prevents tests/gem_hangcheck_forcewake from i-g-t from killing my > snb on recent kernels - something must have slightly changed the > timings. Almost there. You just haven't explained the rationale for *this* patch, which is that hangcheck needs to acquire the forcewake in order to read the registers and hangcheck must not take the struct_mutex (or else deadlock with wait_request and a hung GPU). So there is a choice here: introduce a new locking rule for forcewake, or use the existing struct_mutex inside hangcheck and therefore drop the mutex for wait_request. The first definitely feels safer than dropping struct_mutex on waits, and I haven't thought of any tangible benefits for doing so (other than concurrent clients might see an improvement). -Chris -- Chris Wilson, Intel Open Source Technology Centre