All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jon Masters <jcm@jonmasters.org>
To: "Paul E. McKenney" <paulmck@kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH tip/core/rcu 2/6] Documentation/memory-barriers.txt: ACCESS_ONCE() provides cache coherence
Date: Thu, 23 Apr 2020 23:36:19 -0400	[thread overview]
Message-ID: <f3cdec26-480e-d2e0-3e54-4b0536831fcd@jonmasters.org> (raw)
In-Reply-To: <1392672413-5114-2-git-send-email-paulmck () linux ! vnet ! ibm ! com>

Hi Paul,

On 2/17/14 4:26 PM, Paul E. McKenney wrote:

> The ACCESS_ONCE() primitive provides cache coherence, but the
> documentation does not clearly state this.  This commit therefore upgrades
> the documentation.

<snip>

> +     In short, ACCESS_ONCE() provides "cache coherence" for accesses from
> +     multiple CPUs to a single variable.

(ACCESS_ONCE is now READ_ONCE/WRITE_ONCE but the above added the 
original language around cache coherence)

I would argue that we might want to avoid describing it in this manner. 
The hardware provides cache coherency in order to keep a single memory 
location coherent between multiple observers. These kernel macros only 
tell the compiler to perform the load once. They take advantage of the 
properties of coherence in the presence of multiple observers.

Jon.

-- 
Computer Architect

       reply	other threads:[~2020-04-24  6:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1392672413-5114-2-git-send-email-paulmck () linux ! vnet ! ibm ! com>
2020-04-24  3:36 ` Jon Masters [this message]
2020-04-27 22:59   ` [PATCH tip/core/rcu 2/6] Documentation/memory-barriers.txt: ACCESS_ONCE() provides cache coherence Paul E. McKenney
2014-02-17 21:26 [PATCH tip/core/rcu 0/6] Documentation changes for 3.15 Paul E. McKenney
2014-02-17 21:26 ` [PATCH tip/core/rcu 1/6] documentation: Document call_rcu() safety mechanisms and limitations Paul E. McKenney
2014-02-17 21:26   ` [PATCH tip/core/rcu 2/6] Documentation/memory-barriers.txt: ACCESS_ONCE() provides cache coherence Paul E. McKenney
2014-02-17 21:40     ` Josh Triplett
2014-02-17 22:52       ` Paul E. McKenney

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=f3cdec26-480e-d2e0-3e54-4b0536831fcd@jonmasters.org \
    --to=jcm@jonmasters.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulmck@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.