This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Update to new generic semaphore algorithm v2 -- okay for power and alpha?
- From: Torvald Riegel <triegel at redhat dot com>
- To: Adhemerval Zanella <azanella at linux dot vnet dot ibm dot com>, Richard Henderson <rth at twiddle dot net>
- Cc: GLIBC Devel <libc-alpha at sourceware dot org>
- Date: Fri, 16 Jan 2015 10:55:07 +0100
- Subject: Re: [PATCH] Update to new generic semaphore algorithm v2 -- okay for power and alpha?
- Authentication-results: sourceware.org; auth=none
- References: <1421111716 dot 23151 dot 35 dot camel at triegel dot csb>
Adhemerval, Richard,
the patch
https://sourceware.org/ml/libc-alpha/2015-01/msg00281.html
removes the custom semaphore bits on power and alpha, replacing it with
a atomic_write_barrier in the generic old-semaphore code. OK from your
archs' perspective?
On Tue, 2015-01-13 at 02:15 +0100, Torvald Riegel wrote:
> This patch is a revision of that patch:
> https://sourceware.org/ml/libc-alpha/2014-12/msg00527.html
>
> The changes compare to that patch are aimed at making this as
> non-invasive as possible:
> * Not based on top of the futex clean-up patches anymore. The futex
> wrappers from those patches have simply been copied, so can be replaced
> easily once we do the futex clean-up; furthermore, we still get to do
> proper futex error handling in the new semaphore.
> * It assumes that EINTR is only returned by FUTEX_WAIT if the syscall
> was indeed interrupted by a signal. This conflicts with what the
> current Linux-kernel-side info on when EINTR can be returned, but keeps
> doing what glibc's semaphore has assumed so far. As a result, we don't
> need to change nptl/tst-sem4.
> * Fixes a linknamespace issue by moving sem_timedwait into its own file.
>
> Tested and no regressions on Linux x86_64 and i686. I haven't tested
> the old semaphore version (ie, __old_sem*), but the change is minimal
> (one release fence added -- was already present in the alpha and powerpc
> implementations).
>
> OK?
>
>
> 2015-01-13 Torvald Riegel <triegel@redhat.com>
>
> [BZ #12674]
> * nptl/sem_waitcommon.c: New file. Implement new semaphore algorithm.
> * nptl/sem_wait.c: Include sem_waitcommon.c.
> (__sem_wait_cleanup, do_futex_wait): Remove.
> (__new_sem_wait): Adapt.
> (__new_sem_trywait): New function.
> (__old_sem_trywait): Moved here from nptl/sem_trywait.c.
> * nptl/sem_timedwait.c: Include sem_waitcommon.c.
> (__sem_wait_cleanup, do_futex_timed_wait): Remove.
> (sem_timedwait): Adapt.
> * nptl/sem_post.c (__new_sem_post): Adapt.
> (futex_wake): New function.
> (__old_sem_post): Add release MO fence.
> * nptl/sem_open.c (sem_open): Adapt.
> * nptl/sem_init.c (__new_sem_init): Adapt.
> (futex_private_if_supported): New function.
> * nptl/sem_getvalue.c (__new_sem_getvalue): Adapt.
> (__old_sem_getvalue): Add using previous code.
> * sysdeps/nptl/internaltypes.h: Adapt.
> * nptl/tst-sem13.c (do_test): Adapt.
> * nptl/tst-sem11.c (main): Adapt.
> * nptl/sem_trywait.c: Remove.
> * nptl/DESIGN-sem.txt: Remove.
> * nptl/Makefile (libpthread-routines): Remove sem_trywait.
> (gen-as-const-headers): Remove structsem.sym.
> * nptl/structsem.sym: Remove.
> * sysdeps/unix/sysv/linux/alpha/sem_post.c: Remove.
> * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Remove.
> * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Remove.
> * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Remove.
> * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Remove.
> * sysdeps/unix/sysv/linux/i386/i586/sem_post.S: Remove.
> * sysdeps/unix/sysv/linux/i386/i586/sem_timedwait.S: Remove.
> * sysdeps/unix/sysv/linux/i386/i586/sem_trywait.S: Remove.
> * sysdeps/unix/sysv/linux/i386/i586/sem_wait.S: Remove.
> * sysdeps/unix/sysv/linux/i386/i686/sem_post.S: Remove.
> * sysdeps/unix/sysv/linux/i386/i686/sem_timedwait.S: Remove.
> * sysdeps/unix/sysv/linux/i386/i686/sem_trywait.S: Remove.
> * sysdeps/unix/sysv/linux/i386/i686/sem_wait.S: Remove.
> * sysdeps/unix/sysv/linux/powerpc/sem_post.c: Remove.
> * sysdeps/unix/sysv/linux/sh/sem_post.S: Remove.
> * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Remove.
> * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Remove.
> * sysdeps/unix/sysv/linux/sh/sem_wait.S: Remove.
> * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Remove.
> * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Remove.
> * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Remove.
> * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Remove.
>