From: Segher Boessenkool <segher@kernel.crashing.org>
To: "Chris Friesen" <cfriesen@nortel.com>
Cc: wjiang@resilience.com, rpjday@mindspring.com,
wensong@linux-vs.org, heiko.carstens@de.ibm.com,
linux-kernel@vger.kernel.org, ak@suse.de, netdev@vger.kernel.org,
horms@verge.net.au, akpm@linux-foundation.org,
linux-arch@vger.kernel.org, jesper.juhl@gmail.com,
torvalds@linux-foundation.org, schwidefsky@de.ibm.com,
davem@davemloft.net, zlynx@acm.org,
Chris Snook <csnook@redhat.com>
Subject: Re: [PATCH 24/24] document volatile atomic_read() behavior
Date: Fri, 10 Aug 2007 00:23:47 +0200 [thread overview]
Message-ID: <9452870655b1844283961f8e9e406464@kernel.crashing.org> (raw)
In-Reply-To: <46BB74B9.4070702@nortel.com>
>> 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
prev parent reply other threads:[~2007-08-09 22:24 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-09 14:24 [PATCH 24/24] document volatile atomic_read() behavior Chris Snook
2007-08-09 15:59 ` Segher Boessenkool
2007-08-09 16:26 ` Chris Snook
2007-08-09 19:42 ` Segher Boessenkool
2007-08-09 20:05 ` Chris Snook
2007-08-09 22:34 ` Segher Boessenkool
2007-08-09 20:10 ` Chris Friesen
2007-08-09 22:23 ` Segher Boessenkool [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9452870655b1844283961f8e9e406464@kernel.crashing.org \
--to=segher@kernel.crashing.org \
--cc=ak@suse.de \
--cc=akpm@linux-foundation.org \
--cc=cfriesen@nortel.com \
--cc=csnook@redhat.com \
--cc=davem@davemloft.net \
--cc=heiko.carstens@de.ibm.com \
--cc=horms@verge.net.au \
--cc=jesper.juhl@gmail.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=rpjday@mindspring.com \
--cc=schwidefsky@de.ibm.com \
--cc=torvalds@linux-foundation.org \
--cc=wensong@linux-vs.org \
--cc=wjiang@resilience.com \
--cc=zlynx@acm.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).