svn commit: r284922 - in head/sys: amd64/include i386/include

Konstantin Belousov kib at FreeBSD.org
Mon Jun 29 09:58:41 UTC 2015


Author: kib
Date: Mon Jun 29 09:58:40 2015
New Revision: 284922
URL: https://svnweb.freebsd.org/changeset/base/284922

Log:
  Add a comment about too strong semantic of atomic_load_acq() on x86.
  
  Submitted by:	bde
  MFC after:	2 weeks

Modified:
  head/sys/amd64/include/atomic.h
  head/sys/i386/include/atomic.h

Modified: head/sys/amd64/include/atomic.h
==============================================================================
--- head/sys/amd64/include/atomic.h	Mon Jun 29 07:53:44 2015	(r284921)
+++ head/sys/amd64/include/atomic.h	Mon Jun 29 09:58:40 2015	(r284922)
@@ -296,6 +296,15 @@ __storeload_barrier(void)
 }
 #endif /* _KERNEL*/
 
+/*
+ * C11-standard acq/rel semantics only apply when the variable in the
+ * call is the same for acq as it is for rel.  However, our previous
+ * (x86) implementations provided much stronger ordering than required
+ * (essentially what is called seq_cst order in C11).  This
+ * implementation provides the historical strong ordering since some
+ * callers depend on it.
+ */
+
 #define	ATOMIC_LOAD(TYPE)					\
 static __inline u_##TYPE					\
 atomic_load_acq_##TYPE(volatile u_##TYPE *p)			\

Modified: head/sys/i386/include/atomic.h
==============================================================================
--- head/sys/i386/include/atomic.h	Mon Jun 29 07:53:44 2015	(r284921)
+++ head/sys/i386/include/atomic.h	Mon Jun 29 09:58:40 2015	(r284922)
@@ -278,6 +278,15 @@ __storeload_barrier(void)
 }
 #endif /* _KERNEL*/
 
+/*
+ * C11-standard acq/rel semantics only apply when the variable in the
+ * call is the same for acq as it is for rel.  However, our previous
+ * (x86) implementations provided much stronger ordering than required
+ * (essentially what is called seq_cst order in C11).  This
+ * implementation provides the historical strong ordering since some
+ * callers depend on it.
+ */
+
 #define	ATOMIC_LOAD(TYPE)					\
 static __inline u_##TYPE					\
 atomic_load_acq_##TYPE(volatile u_##TYPE *p)			\


More information about the svn-src-all mailing list