Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 2 Aug 2013 16:35:42 +0200
From:      Attilio Rao <attilio@freebsd.org>
To:        Jung-uk Kim <jkim@freebsd.org>
Cc:        svn-src-projects@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r253876 - in projects/atomic64/sys/i386: i386 include
Message-ID:  <CAJ-FndDPb%2Bpf0kQayg=ULYgNFsxNYW%2BuTUFWwo=uahV=%2Bz=9Nw@mail.gmail.com>
In-Reply-To: <201308020008.r7208033096591@svn.freebsd.org>
References:  <201308020008.r7208033096591@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Aug 2, 2013 at 2:08 AM, Jung-uk Kim <jkim@freebsd.org> wrote:
> Author: jkim
> Date: Fri Aug  2 00:08:00 2013
> New Revision: 253876
> URL: http://svnweb.freebsd.org/changeset/base/253876
>
> Log:
>   - Implement atomic_cmpset_64(), atomic_swap_64(), and atomic_testandset_64()
>   for i386.
>   - Reimplement atomic_*_64_i386() in C to make it more pleasant to read.
>   Note the generated code may not be optimal but much easier to maintain.

Please don't do this.

The reason why we never had 64 bits atomic on 32-bits architectures is
because we never could implement them in efficient way, namely without
disabling interrupts.
If we make 64 bits atomics available on every 32 bits architecure by
implementing the slow way we could end up developing some patterns in
MI layers which depend on them that end up by being much slower than
expected.

If you want to implement such functions to use only on i386 internal
code it is a different story but you must absolutely use a different
name by atomic_xxx_64() to stress-out the difference, either comment
out that they are heavier than expected and should be careful used.

Attilio


-- 
Peace can only be achieved by understanding - A. Einstein



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJ-FndDPb%2Bpf0kQayg=ULYgNFsxNYW%2BuTUFWwo=uahV=%2Bz=9Nw>