From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp1.linux-foundation.org (smtp1.linux-foundation.org [140.211.169.13]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "smtp.linux-foundation.org", Issuer "CA Cert Signing Authority" (verified OK)) by ozlabs.org (Postfix) with ESMTPS id 247CCDDFA2 for ; Wed, 28 May 2008 07:56:18 +1000 (EST) Date: Tue, 27 May 2008 14:55:56 -0700 (PDT) From: Linus Torvalds To: Benjamin Herrenschmidt Subject: Re: MMIO and gcc re-ordering issue In-Reply-To: <1211924335.3286.89.camel@pasglop> Message-ID: References: <1211852026.3286.36.camel@pasglop> <20080526.184047.88207142.davem@davemloft.net> <1211854540.3286.42.camel@pasglop> <20080526.192812.184590464.davem@davemloft.net> <1211859542.3286.46.camel@pasglop> <1211922621.3286.80.camel@pasglop> <1211924335.3286.89.camel@pasglop> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, tpiepho@freescale.com, linuxppc-dev@ozlabs.org, scottwood@freescale.com, David Miller , alan@lxorguk.ukuu.org.uk List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Wed, 28 May 2008, Benjamin Herrenschmidt wrote: > > A problem with __raw_ though is that they -also- don't do byteswap, Well, that's why there is __readl() and __raw_readl(), no? Neither does ordering, and __raw_readl() doesn't do byte-swap. Of course, I'm not going to guarantee every architecture even has all those versions, nor am I going to guarantee they all work as advertised :) For x86, they have historially all been 100% identical. With the inline asm patch I posted, the "__" version (whether "raw" or not) lack the "memory" barrier, so they allow a *little* bit more re-ordering. (They won't be re-ordered wrt spinlocks etc, unless gcc starts reordering volatile asm's against each other, which would be a bug). In practice, I doubt it matters. Whatever small compiler re-ordering it might affect won't have any real performance impack one way or the other, I think. Linus