[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <9452870655b1844283961f8e9e406464@kernel.crashing.org>
Date: Fri, 10 Aug 2007 00:23:47 +0200
From: Segher Boessenkool <segher@...nel.crashing.org>
To: "Chris Friesen" <cfriesen@...tel.com>
Cc: wjiang@...ilience.com, rpjday@...dspring.com, wensong@...ux-vs.org,
heiko.carstens@...ibm.com, linux-kernel@...r.kernel.org,
ak@...e.de, netdev@...r.kernel.org, horms@...ge.net.au,
akpm@...ux-foundation.org, linux-arch@...r.kernel.org,
jesper.juhl@...il.com, torvalds@...ux-foundation.org,
schwidefsky@...ibm.com, davem@...emloft.net, zlynx@....org,
Chris Snook <csnook@...hat.com>
Subject: Re: [PATCH 24/24] document volatile atomic_read() behavior
>> Anyway, what's the supposed advantage of *(volatile *) vs. using
>> a real volatile object? That you can access that same object in
>> a non-volatile way?
>
> That's my understanding. That way accesses where you don't care about
> volatility may be optimised.
But those accesses might be done non-atomically then (for example,
if the compiler knows it only needs to write one byte, it might not
bother writing the rest), so that's no good if you want to read the
thing atomically too.
> For instance, in cases where there are already other things
> controlling visibility (as are needed for atomic increment, for
> example) you don't need to make the access itself volatile.
Hrm, you mean within a lock or similar? You'll get the same semantics
as volatile anyway there.
Segher
-
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