From owner-svn-src-head@freebsd.org Mon Jun 29 09:58:41 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 837E298F053; Mon, 29 Jun 2015 09:58:41 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 533AA2DF1; Mon, 29 Jun 2015 09:58:41 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5T9wfY8024694; Mon, 29 Jun 2015 09:58:41 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5T9weY9024691; Mon, 29 Jun 2015 09:58:40 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201506290958.t5T9weY9024691@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 29 Jun 2015 09:58:40 +0000 (UTC) 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 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jun 2015 09:58:41 -0000 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) \