glibc:siddhesh/sem_timedwait

Last commit made on 2014-02-24
Get this branch:
git clone -b siddhesh/sem_timedwait https://git.launchpad.net/glibc

Branch merges

Branch information

Name:
siddhesh/sem_timedwait
Repository:
lp:glibc

Recent commits

8068df4... by Siddhesh Poyarekar <email address hidden>

benchtests: New benchmark for sem_timedwait

Measure performance of the sem_timedwait function for a max wait of
1us in the contended and uncontended case.

21e0d3b... by Siddhesh Poyarekar <email address hidden>

benchtests: Add new directive for benchmark initialization hook

Add a new 'init' directive that specifies the name of the function to
call to do function-specific initialization.

9656e13... by Siddhesh Poyarekar <email address hidden>

Implement benchmarking script in python

b8cd1c4... by Siddhesh Poyarekar <email address hidden>

Minor formatting fix

bd939d2... by Rajalakshmi Srinivasargahvan

print length in strrchr benchtest

The return criteria of strrchr() is to read till NULL even if the
search character is hit. So its better to print len instead of pos.

bc688c1... by Joseph Myers <email address hidden>

Fix __ASSUME_SENDMMSG issues (bug 16611).

Similar to the issues for accept4 and recvmmsg, __ASSUME_SENDMMSG is
also confused about whether it relates to function availability or
socketcall operation availability, and the conditions for the
definition are always wrong (sendmmsg appeared in Linux kernel 3.0,
not 2.6.39); this is now bug 16611.

This patch splits the macro into separate macros like those for
accept4 and recvmmsg, defining them for appropriate kernel versions.

Tested x86_64, including that disassembly of the installed shared
libraries is unchanged by this patch.

 [BZ #16611]
 * sysdeps/unix/sysv/linux/kernel-features.h
 [__LINUX_KERNEL_VERSION >= 0x030000 && __ASSUME_SOCKETCALL]
 (__ASSUME_SENDMMSG_SOCKETCALL): Define.
 [__LINUX_KERNEL_VERSION >= 0x030000 && (__i386__ || __x86_64__ ||
 __powerpc__ || __sh__ || __sparc__)] (__ASSUME_SENDMMSG_SYSCALL):
 Likewise.
 [__i386__ || __powerpc__ || __sh__ || __sparc__]
 (__ASSUME_SENDMMSG_SYSCALL_WITH_SOCKETCALL): Likewise.
 [__ASSUME_SENDMMSG_SOCKETCALL || __ASSUME_SENDMMSG_SYSCALL]
 (__ASSUME_SENDMMSG): Define instead of using previous
 [__LINUX_KERNEL_VERSION >= 0x020627] condition.
 * sysdeps/unix/sysv/linux/aarch64/kernel-features.h
 (__ASSUME_SENDMMSG_SYSCALL): Define.
 * sysdeps/unix/sysv/linux/alpha/kernel-features.h
 [__LINUX_KERNEL_VERSION >= 0x030200] (__ASSUME_SENDMMSG_SYSCALL):
 Likewise.
 * sysdeps/unix/sysv/linux/arm/kernel-features.h
 [__LINUX_KERNEL_VERSION >= 0x030000] (__ASSUME_SENDMMSG_SYSCALL):
 Likewise.
 * sysdeps/unix/sysv/linux/ia64/kernel-features.h
 [__LINUX_KERNEL_VERSION >= 0x030000] (__ASSUME_SENDMMSG_SYSCALL):
 Likewise.
 * sysdeps/unix/sysv/linux/internal_sendmmsg.S [__ASSUME_SOCKETCALL
 && !__ASSUME_SENDMMSG_SYSCALL_WITH_SOCKETCALL &&
 !__ASSUME_SENDMMSG_SYSCALL] (__NR_sendmmsg): Undefine.
 [__ASSUME_SENDMMSG]: Change conditionals to
 [__ASSUME_SENDMMSG_SOCKETCALL].
 * sysdeps/unix/sysv/linux/microblaze/kernel-features.h
 [__LINUX_KERNEL_VERSION >= 0x030300] (__ASSUME_SENDMMSG_SYSCALL):
 Define.
 * sysdeps/unix/sysv/linux/mips/kernel-features.h
 [__LINUX_KERNEL_VERSION >= 0x030100] (__ASSUME_SENDMMSG_SYSCALL):
 Likewise.
 * sysdeps/unix/sysv/linux/sendmmsg.c [__ASSUME_SOCKETCALL &&
 !__ASSUME_SENDMMSG_SYSCALL_WITH_SOCKETCALL &&
 !__ASSUME_SENDMMSG_SYSCALL] (__NR_sendmmsg): Undefine.
 [!__ASSUME_SENDMMSG]: Change conditional to
 [!__ASSUME_SENDMMSG_SOCKETCALL].
 * sysdeps/unix/sysv/linux/tile/kernel-features.h
 [__LINUX_KERNEL_VERSION >= 0x030000] (__ASSUME_SENDMMSG_SYSCALL):
 Define.

 * sysdeps/unix/sysv/linux/hppa/kernel-features.h
 [__LINUX_KERNEL_VERSION >= 0x030100] (__ASSUME_SENDMMSG_SYSCALL):
 Define.

0e31b18... by Joseph Myers <email address hidden>

Fix __ASSUME_RECVMMSG issues (bug 16610).

Similar to the issues for accept4, __ASSUME_RECVMMSG is also confused
about whether it relates to function availability or socketcall
operation availability; this is now bug 16610.

Nothing actually tests __ASSUME_RECVMMSG for function availability,
but implicit in the definition in kernel-features.h is the idea that
it makes sense when the syscall is available and socketcall is not
being used. As with accept4, there are architectures where the
syscall was added later than the socketcall operation, meaning that
assuming glibc is built with recent enough kernel headers, it does not
attempt to use socketcall for these operations and __ASSUME_RECVMMSG
gets defined for kernels >= 2.6.33 even when the syscall was only
added later.

This patch splits the macro into separate macros like those used for
accept4; having similar macro structure in both cases (and for
sendmmsg once I've dealt with that) seems likely to be less confusing
than having a different structure on the basis of nothing actually
needing to assume the recvmmsg function works. Appropriate
definitions are added for all architectures.

Architecture-specific note: Tile's kernel-features.h says "TILE glibc
support starts with 2.6.36", which is accurate in that 2.6.36 was the
first kernel version with Tile support, and on that basis I've made
that header define __ASSUME_RECVMMSG_SYSCALL unconditionally.
However, Tile's configure.ac has arch_minimum_kernel=2.6.32. Since
arch_minimum_kernel is meant to reflect only kernel.org kernel
versions, I think that should change to 2.6.36. (If using glibc with
kernel versions from before a port went in kernel.org, it's your
responsibility to change arch_minimum_kernel in a local patch, and at
the same time to adjust any __ASSUME_* definitions that may not be
correct for your older kernel; for developing the official glibc it
should only ever be necessary to consider what official kernel.org
releases support.)

Tested x86_64, including that disassembly of the installed shared
libraries is unchanged by this patch.

 [BZ #16610]
 * sysdeps/unix/sysv/linux/kernel-features.h
 [__LINUX_KERNEL_VERSION >= 0x020621 && __ASSUME_SOCKETCALL]
 (__ASSUME_RECVMMSG_SOCKETCALL): Define.
 [(__LINUX_KERNEL_VERSION >= 0x020621 && (__i386__ || __x86_64__ ||
 __sparc__)) || (__LINUX_KERNEL_VERSION >= 0x020625 && (__powerpc__
 || __sh__))] (__ASSUME_RECVMMSG_SYSCALL): Likewise.
 [__i386__ || __sparc__]
 (__ASSUME_RECVMMSG_SYSCALL_WITH_SOCKETCALL): Likewise.
 [__ASSUME_RECVMMSG_SOCKETCALL || __ASSUME_RECVMMSG_SYSCALL]
 (__ASSUME_RECVMMSG): Define instead of using previous
 [__LINUX_KERNEL_VERSION >= 0x020621] condition.
 * sysdeps/unix/sysv/linux/aarch64/kernel-features.h
 (__ASSUME_RECVMMSG_SYSCALL): Define.
 * sysdeps/unix/sysv/linux/alpha/kernel-features.h
 [__LINUX_KERNEL_VERSION >= 0x020621] (__ASSUME_RECVMMSG_SYSCALL):
 Likewise.
 * sysdeps/unix/sysv/linux/arm/kernel-features.h
 [__LINUX_KERNEL_VERSION >= 0x020621] (__ASSUME_RECVMMSG_SYSCALL):
 Likewise.
 * sysdeps/unix/sysv/linux/ia64/kernel-features.h
 [__LINUX_KERNEL_VERSION >= 0x020621] (__ASSUME_RECVMMSG_SYSCALL):
 Likewise.
 * sysdeps/unix/sysv/linux/internal_recvmmsg.S [__ASSUME_SOCKETCALL
 && !__ASSUME_RECVMMSG_SYSCALL_WITH_SOCKETCALL &&
 !__ASSUME_RECVMMSG_SYSCALL] (__NR_recvmmsg): Undefine.
 [__ASSUME_RECVMMSG]: Change condition to
 [__ASSUME_RECVMMSG_SOCKETCALL].
 * sysdeps/unix/sysv/linux/microblaze/kernel-features.h
 [__LINUX_KERNEL_VERSION >= 0x020621] (__ASSUME_RECVMMSG_SYSCALL):
 Define.
 (__ASSUME_RECVMMSG_SYSCALL_WITH_SOCKETCALL): Likewise.
 * sysdeps/unix/sysv/linux/mips/kernel-features.h
 [__LINUX_KERNEL_VERSION >= 0x020621] (__ASSUME_RECVMMSG_SYSCALL):
 Likewise.
 * sysdeps/unix/sysv/linux/recvmmsg.c [__ASSUME_SOCKETCALL &&
 !__ASSUME_RECVMMSG_SYSCALL_WITH_SOCKETCALL &&
 !__ASSUME_RECVMMSG_SYSCALL] (__NR_recvmmsg): Undefine.
 [!__ASSUME_RECVMMSG]: Change condition to
 [!__ASSUME_RECVMMSG_SOCKETCALL].
 * sysdeps/unix/sysv/linux/tile/kernel-features.h
 (__ASSUME_RECVMMSG_SYSCALL): Define.

 * sysdeps/unix/sysv/linux/hppa/kernel-features.h
 [__LINUX_KERNEL_VERSION >= 0x020622] (__ASSUME_RECVMMSG_SYSCALL):
 Define.

dd481cc... by Joseph Myers <email address hidden>

Fix __ASSUME_ACCEPT4 issues (bug 16609).

In <https://sourceware.org/ml/libc-alpha/2013-12/msg00008.html>,
Aurelien noted issues with the definition of __ASSUME_ACCEPT4, which I
discussed in more detail in
<https://sourceware.org/ml/libc-alpha/2013-12/msg00014.html>; these
are now bug 16609.

As previously noted, __ASSUME_ACCEPT4 is used in two ways:

* In OS-independent code, to mean "accept4 can be assumed to work
  rather than fail with ENOSYS". It doesn't matter whether it's
  implemented with socketcall or a separate syscall.

* In Linux-specific code, to mean "the socketcall multiplex syscall
  can be assumed to handle the accept4 operation. When used in
  Linux-specific code, it *never* refers to anything relating to the
  accept4 syscall, only to the socketcall multiplexer.

This patch splits the macro into separate __ASSUME_ACCEPT4_SOCKETCALL,
__ASSUME_ACCEPT4_SYSCALL and __ASSUME_ACCEPT4 to clarify the different
cases involved. A macro __ASSUME_SOCKETCALL is added for convenience
in writing logic relating to all socketcall architectures. In
addition, to address the issue of architectures where socketcall
support for accept4 was added before a separate syscall was added (and
so the separate syscall should not be used unless known to be present
or fallback to socketcall is available), a fourth macro
__ASSUME_ACCEPT4_SYSCALL_WITH_SOCKETCALL is added to indicate that the
syscall became available at the same time as socketcall support. This
is then used in the relevant places in a conditional determining
whether to undefine __NR_accept4 (the simple approach to avoiding the
syscall's presence causing problems; I didn't try to implement runtime
fallback from the syscall to socketcall).

Architecture-specific note: alpha defined __ASSUME_ACCEPT4 for 2.6.33
and later, but actually the syscall was added for alpha in 3.2, so
this patch uses the correct condition for __ASSUME_ACCEPT4_SYSCALL
there.

Tested x86_64, including that disassembly of the installed shared
libraries is unchanged by this patch.

 [BZ #16609]
 * sysdeps/unix/sysv/linux/kernel-features.h [__i386__ ||
 __powerpc__ || __s390__ || __sh__ || __sparc__]
 (__ASSUME_SOCKETCALL): Define.
 [__LINUX_KERNEL_VERSION && __ASSUME_SOCKETCALL]
 (__ASSUME_ACCEPT4_SOCKETCALL): Likewise.
 [(__LINUX_KERNEL_VERSION >= 0x02061c && (__x86_64__ || __sparc__))
 || (__LINUX_KERNEL_VERSION >= 0x020625 && (__powerpc__ ||
 __sh__))] (__ASSUME_ACCEPT4_SYSCALL): Likewise.
 [__sparc__] (__ASSUME_ACCEPT4_SYSCALL_WITH_SOCKETCALL): Likewise.
 [__ASSUME_ACCEPT4_SOCKETCALL || __ASSUME_ACCEPT4_SYSCALL]
 (__ASSUME_ACCEPT4): Define instead of using previous
 [__LINUX_KERNEL_VERSION >= 0x02061c && (__i386__ || __x86_64__ ||
 __powerpc__ || __sparc__ || __s390__)] condition.
 * sysdeps/unix/sysv/linux/aarch64/kernel-features.h
 (__ASSUME_ACCEPT4): Change to __ASSUME_ACCEPT4_SYSCALL.
 * sysdeps/unix/sysv/linux/accept4.c [__ASSUME_SOCKETCALL &&
 !__ASSUME_ACCEPT4_SYSCALL_WITH_SOCKETCALL &&
 !__ASSUME_ACCEPT4_SYSCALL] (__NR_accept4): Undefine.
 [!__ASSUME_ACCEPT4]: Change condition to
 [!__ASSUME_ACCEPT4_SOCKETCALL].
 * sysdeps/unix/sysv/linux/alpha/kernel-features.h
 (__ASSUME_ACCEPT4): Change to __ASSUME_ACCEPT4_SYSCALL. Correct
 condition to [__LINUX_KERNEL_VERSION >= 0x030200].
 * sysdeps/unix/sysv/linux/arm/kernel-features.h
 [__LINUX_KERNEL_VERSION >= 0x020624] (__ASSUME_ACCEPT4): Change to
 __ASSUME_ACCEPT4_SYSCALL.
 * sysdeps/unix/sysv/linux/i386/accept4.S [__ASSUME_ACCEPT4]:
 Change conditions to [__ASSUME_ACCEPT4_SOCKETCALL].
 * sysdeps/unix/sysv/linux/ia64/kernel-features.h
 [__LINUX_KERNEL_VERSION >= 0x030300] (__ASSUME_ACCEPT4): Change to
 __ASSUME_ACCEPT4_SYSCALL.
 * sysdeps/unix/sysv/linux/internal_accept4.S [__ASSUME_SOCKETCALL
 && !__ASSUME_ACCEPT4_SYSCALL_WITH_SOCKETCALL &&
 !__ASSUME_ACCEPT4_SYSCALL] (__NR_accept4): Undefine.
 [__ASSUME_ACCEPT4]: Change condition to
 [__ASSUME_ACCEPT4_SOCKETCALL].
 * sysdeps/unix/sysv/linux/m68k/kernel-features.h
 (__ASSUME_SOCKETCALL): Define.
 [__LINUX_KERNEL_VERSION >= 0x02061c] (__ASSUME_ACCEPT4): Remove.
 * sysdeps/unix/sysv/linux/microblaze/kernel-features.h
 (__ASSUME_SOCKETCALL): Define.
 (__ASSUME_ACCEPT4): Remove.
 [__LINUX_KERNEL_VERSION >= 0x020621] (__ASSUME_ACCEPT4_SYSCALL):
 Define.
 * sysdeps/unix/sysv/linux/mips/kernel-features.h
 [__LINUX_KERNEL_VERSION >= 0x02061f] (__ASSUME_ACCEPT4_SYSCALL):
 Likewise.
 * sysdeps/unix/sysv/linux/tile/kernel-features.h
 (__ASSUME_ACCEPT4): Change to __ASSUME_ACCEPT4_SYSCALL.

 * sysdeps/unix/sysv/linux/hppa/kernel-features.h
 [__LINUX_KERNEL_VERSION >= 0x020622] (__ASSUME_ACCEPT4_SYSCALL):
 Define.

5d7b57c... by Joseph Myers <email address hidden>

Update ARM HWCAP data.

This patch updates the ARM HWCAP data (both bits/hwcap.h and
dl-procinfo.[ch]) to match Linux 3.13.

 * sysdeps/unix/sysv/linux/arm/bits/hwcap.h (HWCAP_ARM_VFPD32): New
 macro.
 (HWCAP_ARM_LPAE): Likewise.
 (HWCAP_ARM_EVTSTRM): Likewise.
 * sysdeps/unix/sysv/linux/arm/dl-procinfo.c (_dl_arm_cap_flags):
 Add vpfd32, lpae and evtstrm.
 * sysdeps/unix/sysv/linux/arm/dl-procinfo.h (_DL_HWCAP_COUNT):
 Increase to 22.

63689d6... by Joseph Myers <email address hidden>

Move tests of clog10 from libm-test.inc to auto-libm-test-in.

This patch moves tests of clog10 to auto-libm-test-in. Note that this
means gen-auto-libm-tests will now depend on the recent MPC 1.0.2
release which added a fix for a bug that made gen-auto-libm-tests hang
for clog10. (It still can't conveniently be used for cacos cacosh
casin casinh catan catanh csin csinh because of extreme slowness of
those functions for special cases in MPC; at least some slow cases of
csin / csinh are fixed in MPC trunk, but not in a release.)

Tested x86_64 and x86 and ulps updated accordingly.

 * math/auto-libm-test-in: Add tests of clog10.
 * math/auto-libm-test-out: Regenerated.
 * math/libm-test.inc (clog10_test_data): Use AUTO_TESTS_c_c.
 * sysdeps/i386/fpu/libm-test-ulps: Update.
 * sysdeps/x86_64/fpu/libm-test-ulps: Likewise.