All of lore.kernel.org
 help / color / mirror / Atom feed
From: Akira Yokosawa <akiyks@gmail.com>
To: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Cc: perfbook@vger.kernel.org, Akira Yokosawa <akiyks@gmail.com>
Subject: [PATCH 09/14] advsync: Use READ_ONCE()/WRITE_ONCE() in sequence of 'Device Operations'
Date: Mon, 17 Apr 2017 07:22:29 +0900	[thread overview]
Message-ID: <d007aa6f-9c53-bbcc-e2c8-463bd7c2a9d4@gmail.com> (raw)
In-Reply-To: <be8c3cb5-9ee2-9f60-bfcd-e729389304f9@gmail.com>

From 20904d88784deb41bfb853b198017eca6a058bc8 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <akiyks@gmail.com>
Date: Sun, 16 Apr 2017 23:44:56 +0900
Subject: [PATCH 09/14] advsync: Use READ_ONCE()/WRITE_ONCE() in sequence of 'Device Operations'

Using pseudo-asm code here results in a redundant look. In this
section, using READ_ONCE()/WRITE_ONCE() in code sequence gives
a good contrast with the resulting ordering of memory accesses.

Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
---
 advsync/memorybarriers.tex | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/advsync/memorybarriers.tex b/advsync/memorybarriers.tex
index 7b50511..f94b113 100644
--- a/advsync/memorybarriers.tex
+++ b/advsync/memorybarriers.tex
@@ -1261,15 +1261,15 @@ Some devices present their control interfaces as collections of memory
 locations, but the order in which the control registers are accessed is very
 important.  For instance, imagine an Ethernet card with a set of internal
 registers that are accessed through an address port register~(A) and a data
-port register~(D).  To read internal register~5, the following code might then
-be used:
+port register~(D).  To read internal register~5, the following code (in C)
+might then be used:

 \vspace{5pt}
 \begin{minipage}[t]{\columnwidth}
 \scriptsize
 \begin{verbatim}
-*A = 5;
-x = *D;
+WRITE_ONCE(*A, 5);
+x = READ_ONCE(*D);
 \end{verbatim}
 \vspace{1pt}
 \end{minipage}
-- 
2.7.4



  parent reply	other threads:[~2017-04-16 22:22 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-16 22:11 [PATCH 00/14] advsync: Use pseudo asm in code sequence Akira Yokosawa
2017-04-16 22:13 ` [PATCH 01/14] advsync: Use pseudo asm in sequence in 'Paring' section Akira Yokosawa
2017-04-16 22:14 ` [PATCH 02/14] advsync: Substitute READ_ONCE()/WRITE_ONCE() for ACCESS_ONCE() Akira Yokosawa
2017-04-16 22:15 ` [PATCH 03/14] advsync: Use pseudo asm in sequence in 'Review of Locking Impl' Akira Yokosawa
2017-04-16 22:17 ` [PATCH 04/14] advsync: Backport upstream commits regarding reordering example Akira Yokosawa
2017-04-16 22:18 ` [PATCH 05/14] advsync: Use pseudo asm in " Akira Yokosawa
2017-04-16 22:19 ` [PATCH 06/14] advsync: Use pseudo asm in another " Akira Yokosawa
2017-04-16 22:19 ` [PATCH 07/14] advsync: Avoid indent after minipages Akira Yokosawa
2017-04-16 22:20 ` [PATCH 08/14] advsync: Add footnote to imply necessity of data dependency barrier Akira Yokosawa
2017-04-16 22:22 ` Akira Yokosawa [this message]
2017-04-16 22:23 ` [PATCH 10/14] advsync: Use READ_ONCE()/WRITE_ONCE() in sequence in 'Guarantees' Akira Yokosawa
2017-04-16 22:24 ` [PATCH 11/14] advsync: Rename Section 'Guarantees' to 'Minimal Guarantees' Akira Yokosawa
2017-04-16 22:25 ` [PATCH 12/14] advsync: Add another footnote implying data dependency barrier Akira Yokosawa
2017-04-16 22:26 ` [PATCH 13/14] advsync: Use pseudo asm in sequence in 'Data Dependency Barriers' Akira Yokosawa
2017-04-16 22:27 ` [PATCH 14/14] advsync: Use pseudo asm in sequence in 'SMP Barrier Pairing' Akira Yokosawa
2017-04-17 15:39 ` [PATCH 00/14] advsync: Use pseudo asm in code sequence 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=d007aa6f-9c53-bbcc-e2c8-463bd7c2a9d4@gmail.com \
    --to=akiyks@gmail.com \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=perfbook@vger.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.