This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: glibc 2.21 - Machine maintainers, please test your machines.


On 1/24/2015 12:13 PM, Torvald Riegel wrote:

One thing you could test is set __HAVE_64B_ATOMICS to 0 on tilegx32, and
see whether it makes the semaphore tests pass.  If it avoids the issue,
what is __alignof (sem_t) on tilegx32?

I think the problem is that sem_t is defined to have only "long" alignment
in bits/semaphore.h.  So structures passed from applications will have only
4-byte alignment on most ILP32 architectures.

One way to fix this is to make the struct new_sem be defined to be
on an 8-byte aligned boundary regardless, so you round up the start of the
structure internally to an 8-byte boundary before using it.
Obviously that constrains the size of struct new_sem to be
4 bytes less than the external one, but if we drop the "pad" field then
this is OK.  I'm not sure exactly how awkward this would be.

Otherwise I don't see a way to avoid using 32-bit atomics only.  Presumably
we just need a way to indicate whether atomics must be self-size-aligned
or not, and then the code can generically figure out what's appropriate to do.
Although honestly, my guess is that x32 would benefit from a
performance boost with self-size-aligned atomics, so doing my
suggestion unconditionally might be best with ILP32 regardless.
--
Chris Metcalf, EZChip Semiconductor
http://www.ezchip.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]