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: sem_trywait changes broke sparc


On Sun, 2015-01-25 at 12:08 -0800, David Miller wrote:
> The testsuite no longer runs because links fail with:
> 
> /home/davem/src/GIT/GLIBC/build-sparcv9/nptl/tst-sem1.o: In function `do_test':
> /home/davem/src/GIT/GLIBC/glibc/nptl/tst-sem1.c:48: undefined reference to `sem_trywait'
> /home/davem/src/GIT/GLIBC/glibc/nptl/tst-sem1.c:55: undefined reference to `sem_trywait'
> collect2: ld returned 1 exit status
> 
> A little late in the game to be installing changes like this perhaps?

Dave,

sorry for the breakage.  I don't have access to a sparc machine, so I
just rely on code inspection.  What the patch broke is that sparc still
uses sem_trywait.c and that it seems to also use the generic
nptl/sem_trywait.c on non-sparc32.

There's two things you can do to fix this:

1) Move sem_trywait.c into sem_wait.c for all sparc.  For non-sparc32,
copy the old nptl/sem_trywait.c contents.

2) Use the new generic semaphore.  This has the advantage that it
actually fixes the semaphore bug (#12674) on sparc too.  (BTW, if we
don't do it, we should reopen the bug for sparc; Carlos had marked it as
resolved fixed, and I hadn't realized until now that this is only fixed
for all archs except sparc).
I'm not sure whether this works as-is for pre-v9 sparc, or you need to
adapt -- I would have to study the pre-v9 atomics definition again to
know this.  AFAIR, atomics do work but you don't use a custom lock in
the semaphore, but one from a global array of locks.  So, using just the
atomics might lead to decreased contention between unrelated semaphores.
If you value that higher than the gain of not having to maintain a
sparc-custom semaphore, I think you should use option 1) and use the new
semaphore algorithm.

Which one do you prefer?


Regarding your statement that this was committed late: This patch was
first posted on Dec 5.  While I didn't CC you explicitly (which I should
have done I guess), I pointed out the sparc issue in the email:

  sparc still has its own semaphore implementation.  I'd like to get
  feedback from sparc maintainers regarding what should happen with it.

Also, the release wiki mentioned this patch as blocker.  So, I think it
shouldn't have been too surprising that this was on the list of things
we wanted to get into this release.


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