From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jesse Barnes Subject: Re: [PATCH 1/4] drm/i915: Only insert the mb() before updating the fence parameter Date: Thu, 11 Oct 2012 12:41:53 -0700 Message-ID: <20121011124153.320ea65e@jbarnes-desktop> References: <6c3329lntgg@orsmga002.jf.intel.com> <1349807080-9005-1-git-send-email-chris@chris-wilson.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from oproxy12-pub.bluehost.com (oproxy12-pub.bluehost.com [50.87.16.10]) by gabe.freedesktop.org (Postfix) with SMTP id F31239E81C for ; Thu, 11 Oct 2012 12:41:14 -0700 (PDT) In-Reply-To: <1349807080-9005-1-git-send-email-chris@chris-wilson.co.uk> 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: Chris Wilson Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Tue, 9 Oct 2012 19:24:37 +0100 Chris Wilson wrote: > With a fence, we only need to insert a memory barrier around the actual > fence alteration for CPU accesses through the GTT. Performing the > barrier in flush-fence was inserting unnecessary and expensive barriers > for never fenced objects. > > Note removing the barriers from flush-fence, which was effectively a > barrier before every direct access through the GTT, revealed that we > where missing a barrier before the first access through the GTT. Lack of > that barrier was sufficient to cause GPU hangs. > > v2: Add a couple more comments to explain the new barriers > The docs are slippery on MMIO vs cached accesses (less so on actual I/O port ops), but this does look correct. You might improve the comments a little and quote the IA32 manuals a bit, saying that you're trying to order previous cached accesses with subsequent MMIO accesses that will affect what the CPU reads or writes. Other than that: Reviewed-by: Jesse Barnes -- Jesse Barnes, Intel Open Source Technology Center