This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: glibc 2.21 - Machine maintainers, please test your machines.
- From: Chris Metcalf <cmetcalf at ezchip dot com>
- To: Torvald Riegel <triegel at redhat dot com>
- Cc: Carlos O'Donell <carlos at redhat dot com>, GNU C Library <libc-alpha at sourceware dot org>, "H.J. Lu" <hjl dot tools at gmail dot com>, David Miller <davem at davemloft dot net>, Richard Henderson <rth at redhat dot com>, Mike Frysinger <vapier at gentoo dot org>, Andreas Schwab <schwab at suse dot de>, "Joseph S. Myers" <joseph at codesourcery dot com>, Kaz Kojima <kkojima at rr dot iij4u dot or dot jp>, Thomas Schwinge <thomas at codesourcery dot com>, Marcus Shawcroft <marcus dot shawcroft at linaro dot org>, Chung-Lin Tang <chunglin_tang at mentor dot com>, Adhemerval Zanella <azanella at linux dot vnet dot ibm dot com>, Andreas Krebbel <krebbel at linux dot vnet dot ibm dot com>
- Date: Sat, 24 Jan 2015 16:01:43 -0500
- Subject: Re: glibc 2.21 - Machine maintainers, please test your machines.
- Authentication-results: sourceware.org; auth=none
- Authentication-results: linux.vnet.ibm.com; dkim=none (message not signed) header.d=none;linux.vnet.ibm.com; dmarc=none action=none header.from=ezchip.com;
- References: <54C2BDD7 dot 7000304 at redhat dot com> <54C3B6D5 dot 3090308 at ezchip dot com> <1422119595 dot 29655 dot 42 dot camel at triegel dot csb>
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