This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Disable 64-bit atomics for MIPS n32 [committed]
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Torvald Riegel <triegel at redhat dot com>
- Cc: <libc-alpha at sourceware dot org>
- Date: Wed, 28 Jan 2015 22:05:49 +0000
- Subject: Re: Disable 64-bit atomics for MIPS n32 [committed]
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot DEB dot 2 dot 10 dot 1501281844510 dot 16983 at digraph dot polyomino dot org dot uk> <1422480679 dot 29655 dot 187 dot camel at triegel dot csb>
On Wed, 28 Jan 2015, Torvald Riegel wrote:
> On Wed, 2015-01-28 at 18:45 +0000, Joseph Myers wrote:
> > This patch disables use of 64-bit atomics for MIPS n32 to fix the
> > problems with unaligned semaphores.
>
> That works. I would probably preferred to just do this in the semaphore
> bits (ie, checking for __HAVE_64B_ATOMICS and _LP64, but both have the
> same effect for 2.21.
Carlos requested the minimal change in
<https://sourceware.org/ml/libc-alpha/2015-01/msg00597.html>.
> I guess I'll have to add another flag for whether 64B atomics need to be
> naturally aligned or not. I'm not yet sure how to express this best, so
> suggestions are welcome. If we can say (for now) that we only support
> ILP32 and LP64, this might clarify the options we have -- I suspect that
> in most cases where 64B atomics will be useful, this will be for legacy
> code.
>
> OTOH, I'm not sure whether non-naturally-aligned 64B atomics actually
> really help us anywhere. So we could as well just require them to be
> naturally aligned, and use _LP64 to check whether alignment for legacy
> code is sufficient.
My view is: only use atomic operations on properly aligned values, define
SEM_USE_64B_ATOMICS or similar to 1 if __HAVE_64B_ATOMICS && (defined
_LP64 || !SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_22)) to reflect
that new ILP32 ports added in 2.22 and later (such as AArch64 ILP32)
should define their semaphores to be 8-byte-aligned. (Presuming that such
ports should indeed prefer to use the 64-bit atomics here.) And maybe
then allow ports to override that choice.
--
Joseph S. Myers
joseph@codesourcery.com