All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junchang Wang <junchangwang@gmail.com>
To: perfbook@vger.kernel.org, paulmck@linux.vnet.ibm.com
Cc: Junchang Wang <junchangwang@gmail.com>
Subject: [PATCH 1/4] Figure Storage Hazard-Pointer Storage and Erasure: Switch from ACCESS_ONCE() to READ_ONCE()/WRITE_ONCE()
Date: Sat, 10 Jun 2017 22:28:28 +0800	[thread overview]
Message-ID: <1497104910-4596-2-git-send-email-junchangwang@gmail.com> (raw)
In-Reply-To: <1497104910-4596-1-git-send-email-junchangwang@gmail.com>

Signed-off-by: Junchang Wang <junchangwang@gmail.com>
---
 defer/hazptr.tex | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/defer/hazptr.tex b/defer/hazptr.tex
index cdde323..10ae7a1 100644
--- a/defer/hazptr.tex
+++ b/defer/hazptr.tex
@@ -26,12 +26,12 @@ may safely be freed.
  2 {
  3   void *tmp;
  4 
- 5   tmp = ACCESS_ONCE(*p);
- 6   ACCESS_ONCE(*hp) = tmp;
+ 5   tmp = READ_ONCE(*p);
+ 6   WRITE_ONCE(*hp, tmp);
  7   smp_mb();
- 8   if (tmp != ACCESS_ONCE(*p) ||
+ 8   if (tmp != READ_ONCE(*p) ||
  9       tmp == HAZPTR_POISON) {
-10     ACCESS_ONCE(*hp) = NULL;
+10     WRITE_ONCE(*hp, NULL);
 11     return 0;
 12   }
 13   return 1;
@@ -40,7 +40,7 @@ may safely be freed.
 16 void hp_erase(void **hp)
 17 {
 18   smp_mb();
-19   ACCESS_ONCE(*hp) = NULL;
+19   WRITE_ONCE(*hp, NULL);
 20   hp_free(hp);
 21 }
 \end{verbbox}
-- 
2.7.4


  reply	other threads:[~2017-06-10 14:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-10 14:28 [PATCH 0/4] Update on Chapter Deferred Processing Junchang Wang
2017-06-10 14:28 ` Junchang Wang [this message]
2017-06-10 14:28 ` [PATCH 2/4] route_hazptr: Switch from ACCESS_ONCE() to READ_ONCE()/WRITE_ONCE() Junchang Wang
2017-06-10 14:28 ` [PATCH 3/4] route_seqlock: " Junchang Wang
2017-06-10 14:35 ` [PATCH 0/4] Update on Chapter Deferred Processing Junchang Wang
2017-06-10 17:08   ` 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=1497104910-4596-2-git-send-email-junchangwang@gmail.com \
    --to=junchangwang@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.