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: [PATCH] Update to new generic semaphore algorithm v2


On Thu, 2015-01-22 at 09:19 -0800, Steve Ellcey wrote:
> On Thu, 2015-01-22 at 08:54 -0800, Steve Ellcey wrote:
> 
> > Torvald,  I think this patch has broken the MIPS build.  I get a bunch
> > of failures, they start with the new file (sem_waitcommon.c).  It looks
> > like some kind of 32/64 bit issue with the size of semaphores.  Any
> > ideas on how to fix this?
> 
> It looks like MIPS has a problem with the size of a semaphore is in
> its N32 ABI.  
> 
> We have this in sysdeps/mips/bits/atomic.h
> 
> #if _MIPS_SIM == _ABIO32
> #define __HAVE_64B_ATOMICS 0
> #else
> #define __HAVE_64B_ATOMICS 1
> #endif

Does the N32 ABI have atomic operations for 64b operands?  If not, it
shouldn't claim that, and atomic.h should be adapted.  This would fix
the semaphore issue too, because then we don't assume 64b and LP64
anymore.

IIRC mips atomic.h did define 64b ops unless _MIPS_SIM == _ABIO32 in the
past.  So this looks like an existing issue in the mips atomic ops
that's just exposed by the semaphore.

However, I might also be wrong in assuming that having 64b atomics
automatically means having LP64 too.

> And this in sysdeps/mips/nptl/bits/semaphore.h
> 
> #if _MIPS_SIM == _ABI64
> # define __SIZEOF_SEM_T 32
> #else
> # define __SIZEOF_SEM_T 16
> #endif
> 
> 
> So for _ABIN32 we are setting __HAVE_64B_ATOMICS to 1 but still using 32
> bit semaphores.  I am not sure which ifdef to change.

That's the old semaphore implementation.  The new algorithm uses struct
new_sem defined in sysdeps/nptl/internaltypes.h.


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