[PATCH 1/4] Figure Storage Hazard-Pointer Storage and Erasure: Switch from ACCESS_ONCE() to READ_ONCE()/WRITE_ONCE()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Junchang Wang <junchangwang@xxxxxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe perfbook" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux