Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 29 Jun 2015 09:58:40 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r284922 - in head/sys: amd64/include i386/include
Message-ID:  <201506290958.t5T9weY9024691@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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)			\



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201506290958.t5T9weY9024691>