Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 26 Jul 2015 05:31:03 +1000 (EST)
From:      Bruce Evans <brde@optusnet.com.au>
To:        Alan Cox <alc@rice.edu>
Cc:        John-Mark Gurney <jmg@funkthat.com>, Alan Cox <alc@freebsd.org>,  src-committers@freebsd.org, svn-src-all@freebsd.org,  svn-src-head@freebsd.org
Subject:   Re: svn commit: r285854 - head/sys/amd64/include
Message-ID:  <20150726051421.C892@besplex.bde.org>
In-Reply-To: <55B3CF86.200@rice.edu>
References:  <201507241943.t6OJhJaq090500@repo.freebsd.org> <20150724211532.GO78154@funkthat.com> <55B3CF86.200@rice.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 25 Jul 2015, Alan Cox wrote:

> On 07/24/2015 16:15, John-Mark Gurney wrote:
>> Alan Cox wrote this message on Fri, Jul 24, 2015 at 19:43 +0000:
>>> ...
>>> Log:
>>>   Add a comment discussing the appropriate use of the atomic_*() functions
>>>   with acquire and release semantics versus the *mb() functions on amd64
>>>   processors.
>> Please put this documentation in the atomic(9) man page where it is
>> easier to read and access...  it's probably best to just move it
>> there and reference atomic(9) here...

Your "." key is still sticky.

>> Also, this advice isn't amd64 specific is it?  If it isn't, why is it
>> in an amd64 include file?
>
> While the first sentence is not amd64 specific, the core of this
> paragraph, the third, four, and fifth sentences, is very amd64 specific.
> In particular, the redundancy of the rmb() and wmb() functions for
> ordinary cases of interprocessor memory ordering is not generally true
> across architectures that we support.  For example, on arm64 or powerpc,
> these functions do provide non-redundant ordering.

It all applies to i386.  Literally after s/amd64/x86/g.

> But, I do agree that the first sentence also belongs in a man page, like
> atomic(9).  Today, however, we have no man page documenting the *mb()
> functions.

These functions are documented in atomic(9) by their absence.  Since they
are undocumented, they don't exist :-).

The man page is also deficient and wrong about the MD set of types
available.  It says that the 64 bit type is [always] available, but
it is unavailable on most or all 32-bit arches for most or all
operations.  It says that the set of available smaller types is
MD but the only way to find the set is to read the source code.
The small types are just bloat, since they are unusable in MI code
and never used in MD code for at least amd64 and i386.

*mb() is similar.  It acts in an undocumented MD way, so it is unusable
in MI code.

Bruce



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