mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Josh Triplett <josh@joshtriplett.org>
To: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Cc: linux-kernel@vger.kernel.org, mingo@kernel.org,
	laijs@cn.fujitsu.com, dipankar@in.ibm.com,
	akpm@linux-foundation.org, mathieu.desnoyers@efficios.com,
	niv@us.ibm.com, tglx@linutronix.de, peterz@infradead.org,
	rostedt@goodmis.org, dhowells@redhat.com, edumazet@google.com,
	darren@dvhart.com, fweisbec@gmail.com, sbw@mit.edu
Subject: Re: [PATCH RFC tip/core/rcu 1/3] documentation: Add needed ACCESS_ONCE() calls to memory-barriers.txt
Date: Thu, 21 Nov 2013 11:43:35 -0800	[thread overview]
Message-ID: <20131121194334.GC14144@jtriplet-mobl1> (raw)
In-Reply-To: <1385056127-6980-1-git-send-email-paulmck@linux.vnet.ibm.com>

On Thu, Nov 21, 2013 at 09:48:45AM -0800, Paul E. McKenney wrote:
> From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
> 
> The Documentation/memory-barriers.txt file was written before the need
> for ACCESS_ONCE() was fully appreciated.  It therefore contains no
> ACCESS_ONCE() calls, which can be a problem when people lift examples
> from it.  This commit therefore adds ACCESS_ONCE() calls.
> 
> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> Cc: David Howells <dhowells@redhat.com>
> ---
>  Documentation/memory-barriers.txt | 204 +++++++++++++++++++++++---------------
>  1 file changed, 124 insertions(+), 80 deletions(-)
> 
> diff --git a/Documentation/memory-barriers.txt b/Documentation/memory-barriers.txt
> index c8c42e64e953..eccc83a40ce1 100644
> --- a/Documentation/memory-barriers.txt
> +++ b/Documentation/memory-barriers.txt
> @@ -194,18 +194,20 @@ There are some minimal guarantees that may be expected of a CPU:
>   (*) On any given CPU, dependent memory accesses will be issued in order, with
>       respect to itself.  This means that for:
>  
> -	Q = P; D = *Q;
> +	ACCESS_ONCE(Q) = P; smp_memory_barrier_depends(); D = ACCESS_ONCE(*Q);

That should be smp_read_barrier_depends().

Also, most of the time shouldn't that use rcu_dereference rather than a
raw smp_read_barrier_depends()?

- Josh Triplett

  parent reply	other threads:[~2013-11-21 19:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-21 17:48 [PATCH RFC tip/core/rcu 0/3] Memory-barrier documentation updates Paul E. McKenney
2013-11-21 17:48 ` [PATCH RFC tip/core/rcu 1/3] documentation: Add needed ACCESS_ONCE() calls to memory-barriers.txt Paul E. McKenney
2013-11-21 17:48   ` [PATCH RFC tip/core/rcu 2/3] documentation: Add long atomic examples " Paul E. McKenney
2013-11-21 19:43   ` Josh Triplett [this message]
2013-11-21 21:16     ` [PATCH RFC tip/core/rcu 1/3] documentation: Add needed ACCESS_ONCE() calls " 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=20131121194334.GC14144@jtriplet-mobl1 \
    --to=josh@joshtriplett.org \
    --cc=akpm@linux-foundation.org \
    --cc=darren@dvhart.com \
    --cc=dhowells@redhat.com \
    --cc=dipankar@in.ibm.com \
    --cc=edumazet@google.com \
    --cc=fweisbec@gmail.com \
    --cc=laijs@cn.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mingo@kernel.org \
    --cc=niv@us.ibm.com \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=sbw@mit.edu \
    --cc=tglx@linutronix.de \
    /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

all inboxes | Powered by JetHome®