[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.0708151736180.10497@schroedinger.engr.sgi.com>
Date: Wed, 15 Aug 2007 17:40:33 -0700 (PDT)
From: Christoph Lameter <clameter@....com>
To: Paul Mackerras <paulus@...ba.org>
cc: Satyam Sharma <satyam@...radead.org>,
Stefan Richter <stefanr@...6.in-berlin.de>,
Chris Snook <csnook@...hat.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
linux-arch@...r.kernel.org,
Linus Torvalds <torvalds@...ux-foundation.org>,
netdev@...r.kernel.org, Andrew Morton <akpm@...ux-foundation.org>,
ak@...e.de, heiko.carstens@...ibm.com, davem@...emloft.net,
schwidefsky@...ibm.com, wensong@...ux-vs.org, horms@...ge.net.au,
wjiang@...ilience.com, cfriesen@...tel.com, zlynx@....org,
rpjday@...dspring.com, jesper.juhl@...il.com,
segher@...nel.crashing.org,
Herbert Xu <herbert@...dor.apana.org.au>,
"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
Subject: Re: [PATCH 0/24] make atomic_read() behave consistently across all
architectures
On Thu, 16 Aug 2007, Paul Mackerras wrote:
> Those barriers are for when we need ordering between atomic variables
> and other memory locations. An atomic variable by itself doesn't and
> shouldn't need any barriers for other CPUs to be able to see what's
> happening to it.
It does not need any barriers. As soon as one cpu acquires the
cacheline for write it will be invalidated in the caches of the others. So
the other cpu will have to refetch. No need for volatile.
The issue here may be that the compiler has fetched the atomic variable
earlier and put it into a register. However, that prefetching is limited
because it cannot cross functions calls etc. The only problem could be
loops where the compiler does not refetch the variable since it assumes
that it does not change and there are no function calls in the body of the
loop. But AFAIK these loops need cpu_relax and other measures anyways to
avoid bad effects from busy waiting.
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists